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 gobject.ObjectG; 36 public import gtkc.giotypes; 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. 68 * 69 * Since: 2.26 70 */ 71 public static ProxyResolverIF getDefault(); 72 73 /** 74 * Checks if @resolver can be used on this system. (This is used 75 * internally; g_proxy_resolver_get_default() will only return a proxy 76 * resolver that returns %TRUE for this method.) 77 * 78 * Returns: %TRUE if @resolver is supported. 79 * 80 * Since: 2.26 81 */ 82 public bool isSupported(); 83 84 /** 85 * Looks into the system proxy configuration to determine what proxy, 86 * if any, to use to connect to @uri. The returned proxy URIs are of 87 * the form `<protocol>://[user[:password]@]host:port` or 88 * `direct://`, where <protocol> could be http, rtsp, socks 89 * or other proxying protocol. 90 * 91 * If you don't know what network protocol is being used on the 92 * socket, you should use `none` as the URI protocol. 93 * In this case, the resolver might still return a generic proxy type 94 * (such as SOCKS), but would not return protocol-specific proxy types 95 * (such as http). 96 * 97 * `direct://` is used when no proxy is needed. 98 * Direct connection should not be attempted unless it is part of the 99 * returned array of proxies. 100 * 101 * Params: 102 * uri = a URI representing the destination to connect to 103 * cancellable = a #GCancellable, or %NULL 104 * 105 * Returns: A 106 * NULL-terminated array of proxy URIs. Must be freed 107 * with g_strfreev(). 108 * 109 * Since: 2.26 110 * 111 * Throws: GException on failure. 112 */ 113 public string[] lookup(string uri, Cancellable cancellable); 114 115 /** 116 * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more 117 * details. 118 * 119 * Params: 120 * uri = a URI representing the destination to connect to 121 * cancellable = a #GCancellable, or %NULL 122 * callback = callback to call after resolution completes 123 * userData = data for @callback 124 * 125 * Since: 2.26 126 */ 127 public void lookupAsync(string uri, Cancellable cancellable, GAsyncReadyCallback callback, void* userData); 128 129 /** 130 * Call this function to obtain the array of proxy URIs when 131 * g_proxy_resolver_lookup_async() is complete. See 132 * g_proxy_resolver_lookup() for more details. 133 * 134 * Params: 135 * result = the result passed to your #GAsyncReadyCallback 136 * 137 * Returns: A 138 * NULL-terminated array of proxy URIs. Must be freed 139 * with g_strfreev(). 140 * 141 * Since: 2.26 142 * 143 * Throws: GException on failure. 144 */ 145 public string[] lookupFinish(AsyncResultIF result); 146 }