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 = GProxy.html 27 * outPack = gio 28 * outFile = ProxyIF 29 * strct = GProxy 30 * realStrct= 31 * ctorStrct= 32 * clss = ProxyT 33 * interf = ProxyIF 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - g_initable_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ErrorG 48 * - glib.GException 49 * - gio.AsyncResultIF 50 * - gio.Cancellable 51 * - gio.IOStream 52 * - gio.ProxyAddress 53 * structWrap: 54 * - GAsyncResult* -> AsyncResultIF 55 * - GCancellable* -> Cancellable 56 * - GIOStream* -> IOStream 57 * - GProxy* -> ProxyIF 58 * - GProxyAddress* -> ProxyAddress 59 * module aliases: 60 * local aliases: 61 * overrides: 62 */ 63 64 module gio.ProxyIF; 65 66 public import gtkc.giotypes; 67 68 private import gtkc.gio; 69 private import glib.ConstructionException; 70 private import gobject.ObjectG; 71 72 private import glib.Str; 73 private import glib.ErrorG; 74 private import glib.GException; 75 private import gio.AsyncResultIF; 76 private import gio.Cancellable; 77 private import gio.IOStream; 78 private import gio.ProxyAddress; 79 80 81 82 /** 83 * A GProxy handles connecting to a remote host via a given type of 84 * proxy server. It is implemented by the 'gio-proxy' extension point. 85 * The extensions are named after their proxy protocol name. As an 86 * example, a SOCKS5 proxy implementation can be retrieved with the 87 * name 'socks5' using the function 88 * g_io_extension_point_get_extension_by_name(). 89 */ 90 public interface ProxyIF 91 { 92 93 94 /** Get the main Gtk struct */ 95 public GProxy* getProxyTStruct(); 96 97 /** the main Gtk struct as a void* */ 98 protected void* getStruct(); 99 100 101 /** 102 */ 103 104 /** 105 * Given connection to communicate with a proxy (eg, a 106 * GSocketConnection that is connected to the proxy server), this 107 * does the necessary handshake to connect to proxy_address, and if 108 * required, wraps the GIOStream to handle proxy payload. 109 * Since 2.26 110 * Params: 111 * proxy = a GProxy 112 * connection = a GIOStream 113 * proxyAddress = a GProxyAddress 114 * cancellable = a GCancellable. [allow-none] 115 * Returns: a GIOStream that will replace connection. This might be the same as connection, in which case a reference will be added. [transfer full] 116 * Throws: GException on failure. 117 */ 118 public IOStream gProxyConnect(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable); 119 120 /** 121 * Asynchronous version of g_proxy_connect(). 122 * Since 2.26 123 * Params: 124 * proxy = a GProxy 125 * connection = a GIOStream 126 * proxyAddress = a GProxyAddress 127 * cancellable = a GCancellable. [allow-none] 128 * callback = a GAsyncReadyCallback. [scope async] 129 * userData = callback data. [closure] 130 */ 131 public void gProxyConnectAsync(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable, GAsyncReadyCallback callback, void* userData); 132 133 /** 134 * See g_proxy_connect(). 135 * Since 2.26 136 * Params: 137 * result = a GAsyncResult 138 * Returns: a GIOStream. [transfer full] 139 * Throws: GException on failure. 140 */ 141 public IOStream gProxyConnectFinish(AsyncResultIF result); 142 143 /** 144 * Lookup "gio-proxy" extension point for a proxy implementation that supports 145 * specified protocol. 146 * Since 2.26 147 * Params: 148 * protocol = the proxy protocol name (e.g. http, socks, etc) 149 * Returns: return a GProxy or NULL if protocol is not supported. [transfer full] 150 */ 151 public static ProxyIF gProxyGetDefaultForProtocol(string protocol); 152 153 /** 154 * Some proxy protocols expect to be passed a hostname, which they 155 * will resolve to an IP address themselves. Others, like SOCKS4, do 156 * not allow this. This function will return FALSE if proxy is 157 * implementing such a protocol. When FALSE is returned, the caller 158 * should resolve the destination hostname first, and then pass a 159 * GProxyAddress containing the stringified IP address to 160 * g_proxy_connect() or g_proxy_connect_async(). 161 * Since 2.26 162 * Returns: TRUE if hostname resolution is supported. 163 */ 164 public int gProxySupportsHostname(); 165 }