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