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  = GProxyAddress.html
27  * outPack = gio
28  * outFile = ProxyAddress
29  * strct   = GProxyAddress
30  * realStrct=
31  * ctorStrct=GSocketAddress
32  * clss    = ProxyAddress
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_proxy_address_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gio.ProxyAddress;
54 
55 public  import gtkc.giotypes;
56 
57 private import gtkc.gio;
58 private import glib.ConstructionException;
59 private import gobject.ObjectG;
60 
61 
62 private import glib.Str;
63 
64 
65 
66 private import gio.InetSocketAddress;
67 
68 /**
69  * Support for proxied GInetSocketAddress.
70  */
71 public class ProxyAddress : InetSocketAddress
72 {
73 	
74 	/** the main Gtk struct */
75 	protected GProxyAddress* gProxyAddress;
76 	
77 	
78 	public GProxyAddress* getProxyAddressStruct()
79 	{
80 		return gProxyAddress;
81 	}
82 	
83 	
84 	/** the main Gtk struct as a void* */
85 	protected override void* getStruct()
86 	{
87 		return cast(void*)gProxyAddress;
88 	}
89 	
90 	/**
91 	 * Sets our main struct and passes it to the parent class
92 	 */
93 	public this (GProxyAddress* gProxyAddress)
94 	{
95 		super(cast(GInetSocketAddress*)gProxyAddress);
96 		this.gProxyAddress = gProxyAddress;
97 	}
98 	
99 	protected override void setStruct(GObject* obj)
100 	{
101 		super.setStruct(obj);
102 		gProxyAddress = cast(GProxyAddress*)obj;
103 	}
104 	
105 	/**
106 	 */
107 	
108 	/**
109 	 * Gets the protocol that is being spoken to the destination
110 	 * server; eg, "http" or "ftp".
111 	 * Since 2.34
112 	 * Returns: the proxy's destination protocol
113 	 */
114 	public string getDestinationProtocol()
115 	{
116 		// const gchar * g_proxy_address_get_destination_protocol  (GProxyAddress *proxy);
117 		return Str.toString(g_proxy_address_get_destination_protocol(gProxyAddress));
118 	}
119 	
120 	/**
121 	 * Gets proxy's destination hostname; that is, the name of the host
122 	 * that will be connected to via the proxy, not the name of the proxy
123 	 * itself.
124 	 * Since 2.26
125 	 * Returns: the proxy's destination hostname
126 	 */
127 	public string getDestinationHostname()
128 	{
129 		// const gchar * g_proxy_address_get_destination_hostname  (GProxyAddress *proxy);
130 		return Str.toString(g_proxy_address_get_destination_hostname(gProxyAddress));
131 	}
132 	
133 	/**
134 	 * Gets proxy's destination port; that is, the port on the
135 	 * destination host that will be connected to via the proxy, not the
136 	 * port number of the proxy itself.
137 	 * Since 2.26
138 	 * Returns: the proxy's destination port
139 	 */
140 	public ushort getDestinationPort()
141 	{
142 		// guint16 g_proxy_address_get_destination_port  (GProxyAddress *proxy);
143 		return g_proxy_address_get_destination_port(gProxyAddress);
144 	}
145 	
146 	/**
147 	 * Gets proxy's password.
148 	 * Since 2.26
149 	 * Returns: the proxy's password
150 	 */
151 	public string getPassword()
152 	{
153 		// const gchar * g_proxy_address_get_password (GProxyAddress *proxy);
154 		return Str.toString(g_proxy_address_get_password(gProxyAddress));
155 	}
156 	
157 	/**
158 	 * Gets proxy's protocol. eg, "socks" or "http"
159 	 * Since 2.26
160 	 * Returns: the proxy's protocol
161 	 */
162 	public string getProtocol()
163 	{
164 		// const gchar * g_proxy_address_get_protocol (GProxyAddress *proxy);
165 		return Str.toString(g_proxy_address_get_protocol(gProxyAddress));
166 	}
167 	
168 	/**
169 	 * Gets proxy's username.
170 	 * Since 2.26
171 	 * Returns: the proxy's username
172 	 */
173 	public string getUsername()
174 	{
175 		// const gchar * g_proxy_address_get_username (GProxyAddress *proxy);
176 		return Str.toString(g_proxy_address_get_username(gProxyAddress));
177 	}
178 	
179 	/**
180 	 * Gets the proxy URI that proxy was constructed from.
181 	 * Since 2.34
182 	 * Returns: the proxy's URI, or NULL if unknown
183 	 */
184 	public string getUri()
185 	{
186 		// const gchar * g_proxy_address_get_uri (GProxyAddress *proxy);
187 		return Str.toString(g_proxy_address_get_uri(gProxyAddress));
188 	}
189 	
190 	/**
191 	 * Creates a new GProxyAddress for inetaddr with protocol that should
192 	 * tunnel through dest_hostname and dest_port.
193 	 * (Note that this method doesn't set the "uri" or
194 	 * "destination-protocol" fields; use g_object_new()
195 	 * directly if you want to set those.)
196 	 * Since 2.26
197 	 * Params:
198 	 * inetaddr = The proxy server GInetAddress.
199 	 * port = The proxy server port.
200 	 * protocol = The proxy protocol to support, in lower case (e.g. socks, http).
201 	 * destHostname = The destination hostname the proxy should tunnel to.
202 	 * destPort = The destination port to tunnel to.
203 	 * username = The username to authenticate to the proxy server
204 	 * (or NULL). [allow-none]
205 	 * password = The password to authenticate to the proxy server
206 	 * (or NULL). [allow-none]
207 	 * Throws: ConstructionException GTK+ fails to create the object.
208 	 */
209 	public this (GInetAddress* inetaddr, ushort port, string protocol, string destHostname, ushort destPort, string username, string password)
210 	{
211 		// GSocketAddress * g_proxy_address_new (GInetAddress *inetaddr,  guint16 port,  const gchar *protocol,  const gchar *dest_hostname,  guint16 dest_port,  const gchar *username,  const gchar *password);
212 		auto p = g_proxy_address_new(inetaddr, port, Str.toStringz(protocol), Str.toStringz(destHostname), destPort, Str.toStringz(username), Str.toStringz(password));
213 		if(p is null)
214 		{
215 			throw new ConstructionException("null returned by g_proxy_address_new(inetaddr, port, Str.toStringz(protocol), Str.toStringz(destHostname), destPort, Str.toStringz(username), Str.toStringz(password))");
216 		}
217 		this(cast(GProxyAddress*) p);
218 	}
219 }