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 module gio.TlsBackendT; 26 27 public import gio.TlsBackend; 28 public import gio.TlsBackendIF; 29 public import gio.TlsDatabase; 30 public import gobject.ObjectG; 31 public import gtkc.gio; 32 public import gtkc.giotypes; 33 34 35 /** 36 * TLS (Transport Layer Security, aka SSL) backend 37 * 38 * Since: 2.28 39 */ 40 public template TlsBackendT(TStruct) 41 { 42 /** Get the main Gtk struct */ 43 public GTlsBackend* getTlsBackendStruct() 44 { 45 return cast(GTlsBackend*)getStruct(); 46 } 47 48 49 /** 50 * Gets the default #GTlsBackend for the system. 51 * 52 * Return: a #GTlsBackend 53 * 54 * Since: 2.28 55 */ 56 public static TlsBackendIF getDefault() 57 { 58 auto p = g_tls_backend_get_default(); 59 60 if(p is null) 61 { 62 return null; 63 } 64 65 return ObjectG.getDObject!(TlsBackend, TlsBackendIF)(cast(GTlsBackend*) p); 66 } 67 68 /** 69 * Gets the #GType of @backend's #GTlsCertificate implementation. 70 * 71 * Return: the #GType of @backend's #GTlsCertificate 72 * implementation. 73 * 74 * Since: 2.28 75 */ 76 public GType getCertificateType() 77 { 78 return g_tls_backend_get_certificate_type(getTlsBackendStruct()); 79 } 80 81 /** 82 * Gets the #GType of @backend's #GTlsClientConnection implementation. 83 * 84 * Return: the #GType of @backend's #GTlsClientConnection 85 * implementation. 86 * 87 * Since: 2.28 88 */ 89 public GType getClientConnectionType() 90 { 91 return g_tls_backend_get_client_connection_type(getTlsBackendStruct()); 92 } 93 94 /** 95 * Gets the default #GTlsDatabase used to verify TLS connections. 96 * 97 * Return: the default database, which should be 98 * unreffed when done. 99 * 100 * Since: 2.30 101 */ 102 public TlsDatabase getDefaultDatabase() 103 { 104 auto p = g_tls_backend_get_default_database(getTlsBackendStruct()); 105 106 if(p is null) 107 { 108 return null; 109 } 110 111 return ObjectG.getDObject!(TlsDatabase)(cast(GTlsDatabase*) p, true); 112 } 113 114 /** 115 * Gets the #GType of @backend's #GTlsFileDatabase implementation. 116 * 117 * Return: the #GType of backend's #GTlsFileDatabase implementation. 118 * 119 * Since: 2.30 120 */ 121 public GType getFileDatabaseType() 122 { 123 return g_tls_backend_get_file_database_type(getTlsBackendStruct()); 124 } 125 126 /** 127 * Gets the #GType of @backend's #GTlsServerConnection implementation. 128 * 129 * Return: the #GType of @backend's #GTlsServerConnection 130 * implementation. 131 * 132 * Since: 2.28 133 */ 134 public GType getServerConnectionType() 135 { 136 return g_tls_backend_get_server_connection_type(getTlsBackendStruct()); 137 } 138 139 /** 140 * Checks if TLS is supported; if this returns %FALSE for the default 141 * #GTlsBackend, it means no "real" TLS backend is available. 142 * 143 * Return: whether or not TLS is supported 144 * 145 * Since: 2.28 146 */ 147 public bool supportsTls() 148 { 149 return g_tls_backend_supports_tls(getTlsBackendStruct()) != 0; 150 } 151 }