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 64 private import gio.TlsDatabase; 65 66 67 68 69 /** 70 */ 71 public class TlsBackend 72 { 73 74 /** the main Gtk struct */ 75 protected GTlsBackend* gTlsBackend; 76 77 78 public GTlsBackend* getTlsBackendStruct() 79 { 80 return gTlsBackend; 81 } 82 83 84 /** the main Gtk struct as a void* */ 85 protected void* getStruct() 86 { 87 return cast(void*)gTlsBackend; 88 } 89 90 /** 91 * Sets our main struct and passes it to the parent class 92 */ 93 public this (GTlsBackend* gTlsBackend) 94 { 95 this.gTlsBackend = gTlsBackend; 96 } 97 98 /** 99 */ 100 101 /** 102 * Gets the default GTlsBackend for the system. 103 * Since 2.28 104 * Returns: a GTlsBackend. [transfer none] 105 */ 106 public static TlsBackend getDefault() 107 { 108 // GTlsBackend * g_tls_backend_get_default (void); 109 auto p = g_tls_backend_get_default(); 110 111 if(p is null) 112 { 113 return null; 114 } 115 116 return ObjectG.getDObject!(TlsBackend)(cast(GTlsBackend*) p); 117 } 118 119 /** 120 * Checks if TLS is supported; if this returns FALSE for the default 121 * GTlsBackend, it means no "real" TLS backend is available. 122 * Since 2.28 123 * Returns: whether or not TLS is supported 124 */ 125 public int supportsTls() 126 { 127 // gboolean g_tls_backend_supports_tls (GTlsBackend *backend); 128 return g_tls_backend_supports_tls(gTlsBackend); 129 } 130 131 /** 132 * Gets the default GTlsDatabase used to verify TLS connections. 133 * Since 2.30 134 * Returns: the default database, which should be unreffed when done. [transfer full] 135 */ 136 public TlsDatabase getDefaultDatabase() 137 { 138 // GTlsDatabase * g_tls_backend_get_default_database (GTlsBackend *backend); 139 auto p = g_tls_backend_get_default_database(gTlsBackend); 140 141 if(p is null) 142 { 143 return null; 144 } 145 146 return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p); 147 } 148 149 /** 150 * Gets the GType of backend's GTlsCertificate implementation. 151 * Since 2.28 152 * Returns: the GType of backend's GTlsCertificate implementation. 153 */ 154 public GType getCertificateType() 155 { 156 // GType g_tls_backend_get_certificate_type (GTlsBackend *backend); 157 return g_tls_backend_get_certificate_type(gTlsBackend); 158 } 159 160 /** 161 * Gets the GType of backend's GTlsClientConnection implementation. 162 * Since 2.28 163 * Returns: the GType of backend's GTlsClientConnection implementation. 164 */ 165 public GType getClientConnectionType() 166 { 167 // GType g_tls_backend_get_client_connection_type (GTlsBackend *backend); 168 return g_tls_backend_get_client_connection_type(gTlsBackend); 169 } 170 171 /** 172 * Gets the GType of backend's GTlsServerConnection implementation. 173 * Since 2.28 174 * Returns: the GType of backend's GTlsServerConnection implementation. 175 */ 176 public GType getServerConnectionType() 177 { 178 // GType g_tls_backend_get_server_connection_type (GTlsBackend *backend); 179 return g_tls_backend_get_server_connection_type(gTlsBackend); 180 } 181 182 /** 183 * Gets the GType of backend's GTlsFileDatabase implementation. 184 * Since 2.30 185 * Returns: the GType of backend's GTlsFileDatabase implementation. 186 */ 187 public GType getFileDatabaseType() 188 { 189 // GType g_tls_backend_get_file_database_type (GTlsBackend *backend); 190 return g_tls_backend_get_file_database_type(gTlsBackend); 191 } 192 }