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