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 = GSimpleProxyResolver.html 27 * outPack = gio 28 * outFile = SimpleProxyResolver 29 * strct = GSimpleProxyResolver 30 * realStrct= 31 * ctorStrct= 32 * clss = SimpleProxyResolver 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - ProxyResolverIF 40 * prefixes: 41 * - g_simple_proxy_resolver_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - gio.ProxyResolverT 48 * - gio.ProxyResolverIF 49 * structWrap: 50 * module aliases: 51 * local aliases: 52 * overrides: 53 */ 54 55 module gio.SimpleProxyResolver; 56 57 public import gtkc.giotypes; 58 59 private import gtkc.gio; 60 private import glib.ConstructionException; 61 private import gobject.ObjectG; 62 63 64 private import gio.ProxyResolverT; 65 private import gio.ProxyResolverIF; 66 67 68 69 private import gobject.ObjectG; 70 71 /** 72 * GSimpleProxyResolver is a simple GProxyResolver implementation 73 * that handles a single default proxy, multiple URI-scheme-specific 74 * proxies, and a list of hosts that proxies should not be used for. 75 * 76 * GSimpleProxyResolver is never the default proxy resolver, but it 77 * can be used as the base class for another proxy resolver 78 * implementation, or it can be created and used manually, such as 79 * with g_socket_client_set_proxy_resolver(). 80 */ 81 public class SimpleProxyResolver : ObjectG, ProxyResolverIF 82 { 83 84 /** the main Gtk struct */ 85 protected GSimpleProxyResolver* gSimpleProxyResolver; 86 87 88 public GSimpleProxyResolver* getSimpleProxyResolverStruct() 89 { 90 return gSimpleProxyResolver; 91 } 92 93 94 /** the main Gtk struct as a void* */ 95 protected override void* getStruct() 96 { 97 return cast(void*)gSimpleProxyResolver; 98 } 99 100 /** 101 * Sets our main struct and passes it to the parent class 102 */ 103 public this (GSimpleProxyResolver* gSimpleProxyResolver) 104 { 105 super(cast(GObject*)gSimpleProxyResolver); 106 this.gSimpleProxyResolver = gSimpleProxyResolver; 107 } 108 109 protected override void setStruct(GObject* obj) 110 { 111 super.setStruct(obj); 112 gSimpleProxyResolver = cast(GSimpleProxyResolver*)obj; 113 } 114 115 // Minimal implementation. 116 mixin ProxyResolverT!(GProxyResolver); 117 118 /** 119 */ 120 121 /** 122 * Creates a new GSimpleProxyResolver. See 123 * "default-proxy" and 124 * "ignore-hosts" for more details on how the 125 * arguments are interpreted. 126 * Since 2.36 127 * Params: 128 * defaultProxy = the default proxy to use, eg 129 * "socks://192.168.1.1". [allow-none] 130 * ignoreHosts = an optional list of hosts/IP addresses 131 * to not use a proxy for. [allow-none] 132 * Returns: a new GSimpleProxyResolver 133 */ 134 public static GProxyResolver* newSimpleProxyResolver(string defaultProxy, char** ignoreHosts) 135 { 136 // GProxyResolver * g_simple_proxy_resolver_new (const gchar *default_proxy, gchar **ignore_hosts); 137 return g_simple_proxy_resolver_new(Str.toStringz(defaultProxy), ignoreHosts); 138 } 139 140 /** 141 * Sets the default proxy on resolver, to be used for any URIs that 142 * don't match "ignore-hosts" or a proxy set 143 * via g_simple_proxy_resolver_set_uri_proxy(). 144 * If default_proxy starts with "socks://", 145 * GSimpleProxyResolver will treat it as referring to all three of 146 * the socks5, socks4a, and 147 * socks4 proxy types. 148 * Since 2.36 149 * Params: 150 * defaultProxy = the default proxy to use 151 */ 152 public void setDefaultProxy(string defaultProxy) 153 { 154 // void g_simple_proxy_resolver_set_default_proxy (GSimpleProxyResolver *resolver, const gchar *default_proxy); 155 g_simple_proxy_resolver_set_default_proxy(gSimpleProxyResolver, Str.toStringz(defaultProxy)); 156 } 157 158 /** 159 * Sets the list of ignored hosts. 160 * See "ignore-hosts" for more details on how the 161 * ignore_hosts argument is interpreted. 162 * Since 2.36 163 * Params: 164 * ignoreHosts = NULL-terminated list of hosts/IP addresses 165 * to not use a proxy for 166 */ 167 public void setIgnoreHosts(char** ignoreHosts) 168 { 169 // void g_simple_proxy_resolver_set_ignore_hosts (GSimpleProxyResolver *resolver, gchar **ignore_hosts); 170 g_simple_proxy_resolver_set_ignore_hosts(gSimpleProxyResolver, ignoreHosts); 171 } 172 173 /** 174 * Adds a URI-scheme-specific proxy to resolver; URIs whose scheme 175 * matches uri_scheme (and which don't match 176 * "ignore-hosts") will be proxied via proxy. 177 * As with "default-proxy", if proxy starts with 178 * "socks://", GSimpleProxyResolver will treat it 179 * as referring to all three of the socks5, 180 * socks4a, and socks4 proxy 181 * types. 182 * Since 2.36 183 * Params: 184 * uriScheme = the URI scheme to add a proxy for 185 * proxy = the proxy to use for uri_scheme 186 */ 187 public void setUriProxy(string uriScheme, string proxy) 188 { 189 // void g_simple_proxy_resolver_set_uri_proxy (GSimpleProxyResolver *resolver, const gchar *uri_scheme, const gchar *proxy); 190 g_simple_proxy_resolver_set_uri_proxy(gSimpleProxyResolver, Str.toStringz(uriScheme), Str.toStringz(proxy)); 191 } 192 }