1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = GTlsServerConnection.html 27 * outPack = gio 28 * outFile = TlsServerConnection 29 * strct = GTlsServerConnection 30 * realStrct= 31 * ctorStrct=GIOStream 32 * clss = TlsServerConnection 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = GTlsConnection 38 * implements: 39 * prefixes: 40 * - g_tls_server_connection_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.ErrorG 47 * - glib.GException 48 * - gio.IOStream 49 * - gio.TlsCertificate 50 * structWrap: 51 * - GIOStream* -> IOStream 52 * - GTlsCertificate* -> TlsCertificate 53 * module aliases: 54 * local aliases: 55 * overrides: 56 */ 57 58 module gio.TlsServerConnection; 59 60 public import gtkc.giotypes; 61 62 private import gtkc.gio; 63 private import glib.ConstructionException; 64 private import gobject.ObjectG; 65 66 private import glib.ErrorG; 67 private import glib.GException; 68 private import gio.IOStream; 69 private import gio.TlsCertificate; 70 71 72 private import gio.TlsConnection; 73 74 /** 75 * GTlsServerConnection is the server-side subclass of GTlsConnection, 76 * representing a server-side TLS connection. 77 */ 78 public class TlsServerConnection : TlsConnection 79 { 80 81 /** the main Gtk struct */ 82 protected GTlsServerConnection* gTlsServerConnection; 83 84 85 /** Get the main Gtk struct */ 86 public GTlsServerConnection* getTlsServerConnectionStruct() 87 { 88 return gTlsServerConnection; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected override void* getStruct() 94 { 95 return cast(void*)gTlsServerConnection; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GTlsServerConnection* gTlsServerConnection) 102 { 103 super(cast(GTlsConnection*)gTlsServerConnection); 104 this.gTlsServerConnection = gTlsServerConnection; 105 } 106 107 protected override void setStruct(GObject* obj) 108 { 109 super.setStruct(obj); 110 gTlsServerConnection = cast(GTlsServerConnection*)obj; 111 } 112 113 /** 114 */ 115 116 /** 117 * Creates a new GTlsServerConnection wrapping base_io_stream (which 118 * must have pollable input and output streams). 119 * Since 2.28 120 * Params: 121 * baseIoStream = the GIOStream to wrap 122 * certificate = the default server certificate, or NULL. [allow-none] 123 * Throws: GException on failure. 124 * Throws: ConstructionException GTK+ fails to create the object. 125 */ 126 public this (IOStream baseIoStream, TlsCertificate certificate) 127 { 128 // GIOStream * g_tls_server_connection_new (GIOStream *base_io_stream, GTlsCertificate *certificate, GError **error); 129 GError* err = null; 130 131 auto p = g_tls_server_connection_new((baseIoStream is null) ? null : baseIoStream.getIOStreamStruct(), (certificate is null) ? null : certificate.getTlsCertificateStruct(), &err); 132 133 if (err !is null) 134 { 135 throw new GException( new ErrorG(err) ); 136 } 137 138 if(p is null) 139 { 140 throw new ConstructionException("null returned by g_tls_server_connection_new((baseIoStream is null) ? null : baseIoStream.getIOStreamStruct(), (certificate is null) ? null : certificate.getTlsCertificateStruct(), &err)"); 141 } 142 this(cast(GTlsServerConnection*) p); 143 } 144 }