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