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.ProxyIF; 26 27 private import gio.AsyncResultIF; 28 private import gio.Cancellable; 29 private import gio.IOStream; 30 private import gio.ProxyAddress; 31 private import gio.ProxyIF; 32 private import gio.c.functions; 33 public import gio.c.types; 34 private import glib.ErrorG; 35 private import glib.GException; 36 private import glib.Str; 37 private import gobject.ObjectG; 38 public import gtkc.giotypes; 39 40 41 /** 42 * A #GProxy handles connecting to a remote host via a given type of 43 * proxy server. It is implemented by the 'gio-proxy' extension point. 44 * The extensions are named after their proxy protocol name. As an 45 * example, a SOCKS5 proxy implementation can be retrieved with the 46 * name 'socks5' using the function 47 * g_io_extension_point_get_extension_by_name(). 48 * 49 * Since: 2.26 50 */ 51 public interface ProxyIF{ 52 /** Get the main Gtk struct */ 53 public GProxy* getProxyStruct(bool transferOwnership = false); 54 55 /** the main Gtk struct as a void* */ 56 protected void* getStruct(); 57 58 59 /** */ 60 public static GType getType() 61 { 62 return g_proxy_get_type(); 63 } 64 65 /** 66 * Lookup "gio-proxy" extension point for a proxy implementation that supports 67 * specified protocol. 68 * 69 * Params: 70 * protocol = the proxy protocol name (e.g. http, socks, etc) 71 * 72 * Returns: return a #GProxy or NULL if protocol 73 * is not supported. 74 * 75 * Since: 2.26 76 */ 77 public static ProxyIF getDefaultForProtocol(string protocol); 78 79 /** 80 * Given @connection to communicate with a proxy (eg, a 81 * #GSocketConnection that is connected to the proxy server), this 82 * does the necessary handshake to connect to @proxy_address, and if 83 * required, wraps the #GIOStream to handle proxy payload. 84 * 85 * Params: 86 * connection = a #GIOStream 87 * proxyAddress = a #GProxyAddress 88 * cancellable = a #GCancellable 89 * 90 * Returns: a #GIOStream that will replace @connection. This might 91 * be the same as @connection, in which case a reference 92 * will be added. 93 * 94 * Since: 2.26 95 * 96 * Throws: GException on failure. 97 */ 98 public IOStream connect(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable); 99 100 /** 101 * Asynchronous version of g_proxy_connect(). 102 * 103 * Params: 104 * connection = a #GIOStream 105 * proxyAddress = a #GProxyAddress 106 * cancellable = a #GCancellable 107 * callback = a #GAsyncReadyCallback 108 * userData = callback data 109 * 110 * Since: 2.26 111 */ 112 public void connectAsync(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable, GAsyncReadyCallback callback, void* userData); 113 114 /** 115 * See g_proxy_connect(). 116 * 117 * Params: 118 * result = a #GAsyncResult 119 * 120 * Returns: a #GIOStream. 121 * 122 * Since: 2.26 123 * 124 * Throws: GException on failure. 125 */ 126 public IOStream connectFinish(AsyncResultIF result); 127 128 /** 129 * Some proxy protocols expect to be passed a hostname, which they 130 * will resolve to an IP address themselves. Others, like SOCKS4, do 131 * not allow this. This function will return %FALSE if @proxy is 132 * implementing such a protocol. When %FALSE is returned, the caller 133 * should resolve the destination hostname first, and then pass a 134 * #GProxyAddress containing the stringified IP address to 135 * g_proxy_connect() or g_proxy_connect_async(). 136 * 137 * Returns: %TRUE if hostname resolution is supported. 138 * 139 * Since: 2.26 140 */ 141 public bool supportsHostname(); 142 }