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.Proxy;
31 private import gio.ProxyAddress;
32 private import gio.ProxyIF;
33 private import glib.ErrorG;
34 private import glib.GException;
35 private import glib.Str;
36 private import gobject.ObjectG;
37 private import gtkc.gio;
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();
54 
55 	/** the main Gtk struct as a void* */
56 	protected void* getStruct();
57 
58 	/**
59 	 */
60 
61 	/**
62 	 * Lookup "gio-proxy" extension point for a proxy implementation that supports
63 	 * specified protocol.
64 	 *
65 	 * Params:
66 	 *     protocol = the proxy protocol name (e.g. http, socks, etc)
67 	 *
68 	 * Return: return a #GProxy or NULL if protocol
69 	 *     is not supported.
70 	 *
71 	 * Since: 2.26
72 	 */
73 	public static ProxyIF getDefaultForProtocol(string protocol);
74 
75 	/**
76 	 * Given @connection to communicate with a proxy (eg, a
77 	 * #GSocketConnection that is connected to the proxy server), this
78 	 * does the necessary handshake to connect to @proxy_address, and if
79 	 * required, wraps the #GIOStream to handle proxy payload.
80 	 *
81 	 * Params:
82 	 *     connection = a #GIOStream
83 	 *     proxyAddress = a #GProxyAddress
84 	 *     cancellable = a #GCancellable
85 	 *
86 	 * Return: a #GIOStream that will replace @connection. This might
87 	 *     be the same as @connection, in which case a reference
88 	 *     will be added.
89 	 *
90 	 * Since: 2.26
91 	 *
92 	 * Throws: GException on failure.
93 	 */
94 	public IOStream connect(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable);
95 
96 	/**
97 	 * Asynchronous version of g_proxy_connect().
98 	 *
99 	 * Params:
100 	 *     connection = a #GIOStream
101 	 *     proxyAddress = a #GProxyAddress
102 	 *     cancellable = a #GCancellable
103 	 *     callback = a #GAsyncReadyCallback
104 	 *     userData = callback data
105 	 *
106 	 * Since: 2.26
107 	 */
108 	public void connectAsync(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
109 
110 	/**
111 	 * See g_proxy_connect().
112 	 *
113 	 * Params:
114 	 *     result = a #GAsyncResult
115 	 *
116 	 * Return: a #GIOStream.
117 	 *
118 	 * Since: 2.26
119 	 *
120 	 * Throws: GException on failure.
121 	 */
122 	public IOStream connectFinish(AsyncResultIF result);
123 
124 	/**
125 	 * Some proxy protocols expect to be passed a hostname, which they
126 	 * will resolve to an IP address themselves. Others, like SOCKS4, do
127 	 * not allow this. This function will return %FALSE if @proxy is
128 	 * implementing such a protocol. When %FALSE is returned, the caller
129 	 * should resolve the destination hostname first, and then pass a
130 	 * #GProxyAddress containing the stringified IP address to
131 	 * g_proxy_connect() or g_proxy_connect_async().
132 	 *
133 	 * Return: %TRUE if hostname resolution is supported.
134 	 *
135 	 * Since: 2.26
136 	 */
137 	public bool supportsHostname();
138 }