1 module soup.ProxyURIResolverT;
2 
3 public  import gio.Cancellable;
4 public  import glib.MainContext;
5 public  import gobject.ObjectG;
6 public  import soup.URI;
7 public  import soup.c.functions;
8 public  import soup.c.types;
9 
10 
11 /**
12  * #SoupProxyURIResolver is an interface for finding appropriate HTTP
13  * proxies to use.
14  * 
15  * Deprecated: #SoupSession now has a #SoupSession:proxy-resolver
16  * property that takes a #GProxyResolver (which is semantically
17  * identical to #SoupProxyURIResolver).
18  * 
19  * Even in older releases of libsoup, you are not likely to have to
20  * implement this interface on your own; instead, you should usually
21  * just be able to use #SoupProxyResolverDefault.
22  */
23 public template ProxyURIResolverT(TStruct)
24 {
25 	/** Get the main Gtk struct */
26 	public SoupProxyURIResolver* getProxyURIResolverStruct(bool transferOwnership = false)
27 	{
28 		if (transferOwnership)
29 			ownedRef = false;
30 		return cast(SoupProxyURIResolver*)getStruct();
31 	}
32 
33 
34 	/**
35 	 * Asynchronously determines a proxy URI to use for @msg and calls
36 	 * @callback.
37 	 *
38 	 * Deprecated: #SoupProxyURIResolver is deprecated in favor of
39 	 * #GProxyResolver
40 	 *
41 	 * Params:
42 	 *     uri = the #SoupURI you want a proxy for
43 	 *     asyncContext = the #GMainContext to invoke @callback in
44 	 *     cancellable = a #GCancellable, or %NULL
45 	 *     callback = callback to invoke with the proxy address
46 	 *     userData = data for @callback
47 	 *
48 	 * Since: 2.26.3
49 	 */
50 	public void getProxyUriAsync(URI uri, MainContext asyncContext, Cancellable cancellable, SoupProxyURIResolverCallback callback, void* userData)
51 	{
52 		soup_proxy_uri_resolver_get_proxy_uri_async(getProxyURIResolverStruct(), (uri is null) ? null : uri.getURIStruct(), (asyncContext is null) ? null : asyncContext.getMainContextStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), callback, userData);
53 	}
54 
55 	/**
56 	 * Synchronously determines a proxy URI to use for @uri. If @uri
57 	 * should be sent via proxy, *@proxy_uri will be set to the URI of the
58 	 * proxy, else it will be set to %NULL.
59 	 *
60 	 * Deprecated: #SoupProxyURIResolver is deprecated in favor of
61 	 * #GProxyResolver
62 	 *
63 	 * Params:
64 	 *     uri = the #SoupURI you want a proxy for
65 	 *     cancellable = a #GCancellable, or %NULL
66 	 *     proxyUri = on return, will contain the proxy URI
67 	 *
68 	 * Returns: %SOUP_STATUS_OK if successful, or a transport-level
69 	 *     error.
70 	 *
71 	 * Since: 2.26.3
72 	 */
73 	public uint getProxyUriSync(URI uri, Cancellable cancellable, out URI proxyUri)
74 	{
75 		SoupURI* outproxyUri = null;
76 
77 		auto __p = soup_proxy_uri_resolver_get_proxy_uri_sync(getProxyURIResolverStruct(), (uri is null) ? null : uri.getURIStruct(), (cancellable is null) ? null : cancellable.getCancellableStruct(), &outproxyUri);
78 
79 		proxyUri = ObjectG.getDObject!(URI)(outproxyUri);
80 
81 		return __p;
82 	}
83 }