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 
67 private import glib.ErrorG;
68 private import glib.GException;
69 private import gio.IOStream;
70 private import gio.TlsCertificate;
71 
72 
73 
74 private import gio.TlsConnection;
75 
76 /**
77  * GTlsServerConnection is the server-side subclass of GTlsConnection,
78  * representing a server-side TLS connection.
79  */
80 public class TlsServerConnection : TlsConnection
81 {
82 	
83 	/** the main Gtk struct */
84 	protected GTlsServerConnection* gTlsServerConnection;
85 	
86 	
87 	public GTlsServerConnection* getTlsServerConnectionStruct()
88 	{
89 		return gTlsServerConnection;
90 	}
91 	
92 	
93 	/** the main Gtk struct as a void* */
94 	protected override void* getStruct()
95 	{
96 		return cast(void*)gTlsServerConnection;
97 	}
98 	
99 	/**
100 	 * Sets our main struct and passes it to the parent class
101 	 */
102 	public this (GTlsServerConnection* gTlsServerConnection)
103 	{
104 		super(cast(GTlsConnection*)gTlsServerConnection);
105 		this.gTlsServerConnection = gTlsServerConnection;
106 	}
107 	
108 	protected override void setStruct(GObject* obj)
109 	{
110 		super.setStruct(obj);
111 		gTlsServerConnection = cast(GTlsServerConnection*)obj;
112 	}
113 	
114 	/**
115 	 */
116 	
117 	/**
118 	 * Creates a new GTlsServerConnection wrapping base_io_stream (which
119 	 * must have pollable input and output streams).
120 	 * Since 2.28
121 	 * Params:
122 	 * baseIoStream = the GIOStream to wrap
123 	 * certificate = the default server certificate, or NULL. [allow-none]
124 	 * Throws: GException on failure.
125 	 * Throws: ConstructionException GTK+ fails to create the object.
126 	 */
127 	public this (IOStream baseIoStream, TlsCertificate certificate)
128 	{
129 		// GIOStream * g_tls_server_connection_new (GIOStream *base_io_stream,  GTlsCertificate *certificate,  GError **error);
130 		GError* err = null;
131 		
132 		auto p = g_tls_server_connection_new((baseIoStream is null) ? null : baseIoStream.getIOStreamStruct(), (certificate is null) ? null : certificate.getTlsCertificateStruct(), &err);
133 		
134 		if (err !is null)
135 		{
136 			throw new GException( new ErrorG(err) );
137 		}
138 		
139 		if(p is null)
140 		{
141 			throw new ConstructionException("null returned by g_tls_server_connection_new((baseIoStream is null) ? null : baseIoStream.getIOStreamStruct(), (certificate is null) ? null : certificate.getTlsCertificateStruct(), &err)");
142 		}
143 		this(cast(GTlsServerConnection*) p);
144 	}
145 }