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 
73 private import glib.Str;
74 private import glib.ErrorG;
75 private import glib.GException;
76 private import gio.AsyncResultIF;
77 private import gio.Cancellable;
78 private import gio.IOStream;
79 private import gio.ProxyAddress;
80 
81 
82 
83 
84 /**
85  * A GProxy handles connecting to a remote host via a given type of
86  * proxy server. It is implemented by the 'gio-proxy' extension point.
87  * The extensions are named after their proxy protocol name. As an
88  * example, a SOCKS5 proxy implementation can be retrieved with the
89  * name 'socks5' using the function
90  * g_io_extension_point_get_extension_by_name().
91  */
92 public interface ProxyIF
93 {
94 	
95 	
96 	public GProxy* getProxyTStruct();
97 	
98 	/** the main Gtk struct as a void* */
99 	protected void* getStruct();
100 	
101 	
102 	/**
103 	 */
104 	
105 	/**
106 	 * Given connection to communicate with a proxy (eg, a
107 	 * GSocketConnection that is connected to the proxy server), this
108 	 * does the necessary handshake to connect to proxy_address, and if
109 	 * required, wraps the GIOStream to handle proxy payload.
110 	 * Since 2.26
111 	 * Params:
112 	 * proxy = a GProxy
113 	 * connection = a GIOStream
114 	 * proxyAddress = a GProxyAddress
115 	 * cancellable = a GCancellable. [allow-none]
116 	 * Returns: a GIOStream that will replace connection. This might be the same as connection, in which case a reference will be added. [transfer full]
117 	 * Throws: GException on failure.
118 	 */
119 	public IOStream gProxyConnect(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable);
120 	
121 	/**
122 	 * Asynchronous version of g_proxy_connect().
123 	 * Since 2.26
124 	 * Params:
125 	 * proxy = a GProxy
126 	 * connection = a GIOStream
127 	 * proxyAddress = a GProxyAddress
128 	 * cancellable = a GCancellable. [allow-none]
129 	 * callback = a GAsyncReadyCallback. [scope async]
130 	 * userData = callback data. [closure]
131 	 */
132 	public void gProxyConnectAsync(IOStream connection, ProxyAddress proxyAddress, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
133 	
134 	/**
135 	 * See g_proxy_connect().
136 	 * Since 2.26
137 	 * Params:
138 	 * result = a GAsyncResult
139 	 * Returns: a GIOStream. [transfer full]
140 	 * Throws: GException on failure.
141 	 */
142 	public IOStream gProxyConnectFinish(AsyncResultIF result);
143 	
144 	/**
145 	 * Lookup "gio-proxy" extension point for a proxy implementation that supports
146 	 * specified protocol.
147 	 * Since 2.26
148 	 * Params:
149 	 * protocol = the proxy protocol name (e.g. http, socks, etc)
150 	 * Returns: return a GProxy or NULL if protocol is not supported. [transfer full]
151 	 */
152 	public static ProxyIF gProxyGetDefaultForProtocol(string protocol);
153 	
154 	/**
155 	 * Some proxy protocols expect to be passed a hostname, which they
156 	 * will resolve to an IP address themselves. Others, like SOCKS4, do
157 	 * not allow this. This function will return FALSE if proxy is
158 	 * implementing such a protocol. When FALSE is returned, the caller
159 	 * should resolve the destination hostname first, and then pass a
160 	 * GProxyAddress containing the stringified IP address to
161 	 * g_proxy_connect() or g_proxy_connect_async().
162 	 * Since 2.26
163 	 * Returns: TRUE if hostname resolution is supported.
164 	 */
165 	public int gProxySupportsHostname();
166 }