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.ProxyResolverIF;
26 
27 private import gio.AsyncResultIF;
28 private import gio.Cancellable;
29 private import gio.ProxyResolverIF;
30 private import gio.c.functions;
31 public  import gio.c.types;
32 private import glib.ErrorG;
33 private import glib.GException;
34 private import glib.Str;
35 private import glib.c.functions;
36 private import gobject.ObjectG;
37 
38 
39 /**
40  * #GProxyResolver provides synchronous and asynchronous network proxy
41  * resolution. #GProxyResolver is used within #GSocketClient through
42  * the method g_socket_connectable_proxy_enumerate().
43  * 
44  * Implementations of #GProxyResolver based on libproxy and GNOME settings can
45  * be found in glib-networking. GIO comes with an implementation for use inside
46  * Flatpak portals.
47  *
48  * Since: 2.26
49  */
50 public interface ProxyResolverIF{
51 	/** Get the main Gtk struct */
52 	public GProxyResolver* getProxyResolverStruct(bool transferOwnership = false);
53 
54 	/** the main Gtk struct as a void* */
55 	protected void* getStruct();
56 
57 
58 	/** */
59 	public static GType getType()
60 	{
61 		return g_proxy_resolver_get_type();
62 	}
63 
64 	/**
65 	 * Gets the default #GProxyResolver for the system.
66 	 *
67 	 * Returns: the default #GProxyResolver, which
68 	 *     will be a dummy object if no proxy resolver is available
69 	 *
70 	 * Since: 2.26
71 	 */
72 	public static ProxyResolverIF getDefault()
73 	{
74 		auto __p = g_proxy_resolver_get_default();
75 
76 		if(__p is null)
77 		{
78 			return null;
79 		}
80 
81 		return ObjectG.getDObject!(ProxyResolverIF)(cast(GProxyResolver*) __p);
82 	}
83 
84 	/**
85 	 * Checks if @resolver can be used on this system. (This is used
86 	 * internally; g_proxy_resolver_get_default() will only return a proxy
87 	 * resolver that returns %TRUE for this method.)
88 	 *
89 	 * Returns: %TRUE if @resolver is supported.
90 	 *
91 	 * Since: 2.26
92 	 */
93 	public bool isSupported();
94 
95 	/**
96 	 * Looks into the system proxy configuration to determine what proxy,
97 	 * if any, to use to connect to @uri. The returned proxy URIs are of
98 	 * the form `<protocol>://[user[:password]@]host:port` or
99 	 * `direct://`, where <protocol> could be http, rtsp, socks
100 	 * or other proxying protocol.
101 	 *
102 	 * If you don't know what network protocol is being used on the
103 	 * socket, you should use `none` as the URI protocol.
104 	 * In this case, the resolver might still return a generic proxy type
105 	 * (such as SOCKS), but would not return protocol-specific proxy types
106 	 * (such as http).
107 	 *
108 	 * `direct://` is used when no proxy is needed.
109 	 * Direct connection should not be attempted unless it is part of the
110 	 * returned array of proxies.
111 	 *
112 	 * Params:
113 	 *     uri = a URI representing the destination to connect to
114 	 *     cancellable = a #GCancellable, or %NULL
115 	 *
116 	 * Returns: A
117 	 *     NULL-terminated array of proxy URIs. Must be freed
118 	 *     with g_strfreev().
119 	 *
120 	 * Since: 2.26
121 	 *
122 	 * Throws: GException on failure.
123 	 */
124 	public string[] lookup(string uri, Cancellable cancellable);
125 
126 	/**
127 	 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
128 	 * details.
129 	 *
130 	 * Params:
131 	 *     uri = a URI representing the destination to connect to
132 	 *     cancellable = a #GCancellable, or %NULL
133 	 *     callback = callback to call after resolution completes
134 	 *     userData = data for @callback
135 	 *
136 	 * Since: 2.26
137 	 */
138 	public void lookupAsync(string uri, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
139 
140 	/**
141 	 * Call this function to obtain the array of proxy URIs when
142 	 * g_proxy_resolver_lookup_async() is complete. See
143 	 * g_proxy_resolver_lookup() for more details.
144 	 *
145 	 * Params:
146 	 *     result = the result passed to your #GAsyncReadyCallback
147 	 *
148 	 * Returns: A
149 	 *     NULL-terminated array of proxy URIs. Must be freed
150 	 *     with g_strfreev().
151 	 *
152 	 * Since: 2.26
153 	 *
154 	 * Throws: GException on failure.
155 	 */
156 	public string[] lookupFinish(AsyncResultIF result);
157 }