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  * Description
70  * Support for proxied GInetSocketAddress.
71  */
72 public class ProxyAddress : InetSocketAddress
73 {
74 	
75 	/** the main Gtk struct */
76 	protected GProxyAddress* gProxyAddress;
77 	
78 	
79 	public GProxyAddress* getProxyAddressStruct()
80 	{
81 		return gProxyAddress;
82 	}
83 	
84 	
85 	/** the main Gtk struct as a void* */
86 	protected override void* getStruct()
87 	{
88 		return cast(void*)gProxyAddress;
89 	}
90 	
91 	/**
92 	 * Sets our main struct and passes it to the parent class
93 	 */
94 	public this (GProxyAddress* gProxyAddress)
95 	{
96 		super(cast(GInetSocketAddress*)gProxyAddress);
97 		this.gProxyAddress = gProxyAddress;
98 	}
99 	
100 	protected override void setStruct(GObject* obj)
101 	{
102 		super.setStruct(obj);
103 		gProxyAddress = cast(GProxyAddress*)obj;
104 	}
105 	
106 	/**
107 	 */
108 	
109 	/**
110 	 * Gets proxy's destination hostname.
111 	 * Since 2.26
112 	 * Returns: the proxy's destination hostname
113 	 */
114 	public string getDestinationHostname()
115 	{
116 		// const gchar * g_proxy_address_get_destination_hostname  (GProxyAddress *proxy);
117 		return Str.toString(g_proxy_address_get_destination_hostname(gProxyAddress));
118 	}
119 	
120 	/**
121 	 * Gets proxy's destination port.
122 	 * Since 2.26
123 	 * Returns: the proxy's destination port
124 	 */
125 	public ushort getDestinationPort()
126 	{
127 		// guint16 g_proxy_address_get_destination_port  (GProxyAddress *proxy);
128 		return g_proxy_address_get_destination_port(gProxyAddress);
129 	}
130 	
131 	/**
132 	 * Gets proxy's password.
133 	 * Since 2.26
134 	 * Returns: the proxy's password
135 	 */
136 	public string getPassword()
137 	{
138 		// const gchar * g_proxy_address_get_password (GProxyAddress *proxy);
139 		return Str.toString(g_proxy_address_get_password(gProxyAddress));
140 	}
141 	
142 	/**
143 	 * Gets proxy's protocol.
144 	 * Since 2.26
145 	 * Returns: the proxy's protocol
146 	 */
147 	public string getProtocol()
148 	{
149 		// const gchar * g_proxy_address_get_protocol (GProxyAddress *proxy);
150 		return Str.toString(g_proxy_address_get_protocol(gProxyAddress));
151 	}
152 	
153 	/**
154 	 * Gets proxy's username.
155 	 * Since 2.26
156 	 * Returns: the proxy's username
157 	 */
158 	public string getUsername()
159 	{
160 		// const gchar * g_proxy_address_get_username (GProxyAddress *proxy);
161 		return Str.toString(g_proxy_address_get_username(gProxyAddress));
162 	}
163 	
164 	/**
165 	 * Creates a new GProxyAddress for inetaddr with protocol that should
166 	 * tunnel through dest_hostname and dest_port.
167 	 * Since 2.26
168 	 * Params:
169 	 * inetaddr = The proxy server GInetAddress.
170 	 * port = The proxy server port.
171 	 * protocol = The proxy protocol to support, in lower case (e.g. socks, http).
172 	 * destHostname = The destination hostname the the proxy should tunnel to.
173 	 * destPort = The destination port to tunnel to.
174 	 * username = The username to authenticate to the proxy server
175 	 * (or NULL). [allow-none]
176 	 * password = The password to authenticate to the proxy server
177 	 * (or NULL). [allow-none]
178 	 * Throws: ConstructionException GTK+ fails to create the object.
179 	 */
180 	public this (GInetAddress* inetaddr, ushort port, string protocol, string destHostname, ushort destPort, string username, string password)
181 	{
182 		// 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);
183 		auto p = g_proxy_address_new(inetaddr, port, Str.toStringz(protocol), Str.toStringz(destHostname), destPort, Str.toStringz(username), Str.toStringz(password));
184 		if(p is null)
185 		{
186 			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))");
187 		}
188 		this(cast(GProxyAddress*) p);
189 	}
190 }