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