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  = GTlsBackend.html
27  * outPack = gio
28  * outFile = TlsBackend
29  * strct   = GTlsBackend
30  * realStrct=
31  * ctorStrct=
32  * clss    = TlsBackend
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_tls_backend_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gio.TlsDatabase
47  * structWrap:
48  * 	- GTlsBackend* -> TlsBackend
49  * 	- GTlsDatabase* -> TlsDatabase
50  * module aliases:
51  * local aliases:
52  * overrides:
53  */
54 
55 module gio.TlsBackend;
56 
57 public  import gtkc.giotypes;
58 
59 private import gtkc.gio;
60 private import glib.ConstructionException;
61 private import gobject.ObjectG;
62 
63 private import gio.TlsDatabase;
64 
65 
66 
67 /**
68  */
69 public class TlsBackend
70 {
71 	
72 	/** the main Gtk struct */
73 	protected GTlsBackend* gTlsBackend;
74 	
75 	
76 	/** Get the main Gtk struct */
77 	public GTlsBackend* getTlsBackendStruct()
78 	{
79 		return gTlsBackend;
80 	}
81 	
82 	
83 	/** the main Gtk struct as a void* */
84 	protected void* getStruct()
85 	{
86 		return cast(void*)gTlsBackend;
87 	}
88 	
89 	/**
90 	 * Sets our main struct and passes it to the parent class
91 	 */
92 	public this (GTlsBackend* gTlsBackend)
93 	{
94 		this.gTlsBackend = gTlsBackend;
95 	}
96 	
97 	/**
98 	 */
99 	
100 	/**
101 	 * Gets the default GTlsBackend for the system.
102 	 * Since 2.28
103 	 * Returns: a GTlsBackend. [transfer none]
104 	 */
105 	public static TlsBackend getDefault()
106 	{
107 		// GTlsBackend * g_tls_backend_get_default (void);
108 		auto p = g_tls_backend_get_default();
109 		
110 		if(p is null)
111 		{
112 			return null;
113 		}
114 		
115 		return ObjectG.getDObject!(TlsBackend)(cast(GTlsBackend*) p);
116 	}
117 	
118 	/**
119 	 * Checks if TLS is supported; if this returns FALSE for the default
120 	 * GTlsBackend, it means no "real" TLS backend is available.
121 	 * Since 2.28
122 	 * Returns: whether or not TLS is supported
123 	 */
124 	public int supportsTls()
125 	{
126 		// gboolean g_tls_backend_supports_tls (GTlsBackend *backend);
127 		return g_tls_backend_supports_tls(gTlsBackend);
128 	}
129 	
130 	/**
131 	 * Gets the default GTlsDatabase used to verify TLS connections.
132 	 * Since 2.30
133 	 * Returns: the default database, which should be unreffed when done. [transfer full]
134 	 */
135 	public TlsDatabase getDefaultDatabase()
136 	{
137 		// GTlsDatabase * g_tls_backend_get_default_database (GTlsBackend *backend);
138 		auto p = g_tls_backend_get_default_database(gTlsBackend);
139 		
140 		if(p is null)
141 		{
142 			return null;
143 		}
144 		
145 		return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p);
146 	}
147 	
148 	/**
149 	 * Gets the GType of backend's GTlsCertificate implementation.
150 	 * Since 2.28
151 	 * Returns: the GType of backend's GTlsCertificate implementation.
152 	 */
153 	public GType getCertificateType()
154 	{
155 		// GType g_tls_backend_get_certificate_type (GTlsBackend *backend);
156 		return g_tls_backend_get_certificate_type(gTlsBackend);
157 	}
158 	
159 	/**
160 	 * Gets the GType of backend's GTlsClientConnection implementation.
161 	 * Since 2.28
162 	 * Returns: the GType of backend's GTlsClientConnection implementation.
163 	 */
164 	public GType getClientConnectionType()
165 	{
166 		// GType g_tls_backend_get_client_connection_type  (GTlsBackend *backend);
167 		return g_tls_backend_get_client_connection_type(gTlsBackend);
168 	}
169 	
170 	/**
171 	 * Gets the GType of backend's GTlsServerConnection implementation.
172 	 * Since 2.28
173 	 * Returns: the GType of backend's GTlsServerConnection implementation.
174 	 */
175 	public GType getServerConnectionType()
176 	{
177 		// GType g_tls_backend_get_server_connection_type  (GTlsBackend *backend);
178 		return g_tls_backend_get_server_connection_type(gTlsBackend);
179 	}
180 	
181 	/**
182 	 * Gets the GType of backend's GTlsFileDatabase implementation.
183 	 * Since 2.30
184 	 * Returns: the GType of backend's GTlsFileDatabase implementation.
185 	 */
186 	public GType getFileDatabaseType()
187 	{
188 		// GType g_tls_backend_get_file_database_type  (GTlsBackend *backend);
189 		return g_tls_backend_get_file_database_type(gTlsBackend);
190 	}
191 }