| 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 |
|
|---|
| 60 |
|
|---|
| 61 |
private import glib.Str; |
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
private import gio.InetSocketAddress; |
|---|
| 66 |
|
|---|
| 67 |
/** |
|---|
| 68 |
* Description |
|---|
| 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 |
if(gProxyAddress is null) |
|---|
| 96 |
{ |
|---|
| 97 |
this = null; |
|---|
| 98 |
return; |
|---|
| 99 |
} |
|---|
| 100 |
//Check if there already is a D object for this gtk struct |
|---|
| 101 |
void* ptr = getDObject(cast(GObject*)gProxyAddress); |
|---|
| 102 |
if( ptr !is null ) |
|---|
| 103 |
{ |
|---|
| 104 |
this = cast(ProxyAddress)ptr; |
|---|
| 105 |
return; |
|---|
| 106 |
} |
|---|
| 107 |
super(cast(GInetSocketAddress*)gProxyAddress); |
|---|
| 108 |
this.gProxyAddress = gProxyAddress; |
|---|
| 109 |
} |
|---|
| 110 |
|
|---|
| 111 |
protected override void setStruct(GObject* obj) |
|---|
| 112 |
{ |
|---|
| 113 |
super.setStruct(obj); |
|---|
| 114 |
gProxyAddress = cast(GProxyAddress*)obj; |
|---|
| 115 |
} |
|---|
| 116 |
|
|---|
| 117 |
/** |
|---|
| 118 |
*/ |
|---|
| 119 |
|
|---|
| 120 |
/** |
|---|
| 121 |
* Gets proxy's destination hostname. |
|---|
| 122 |
* Since 2.26 |
|---|
| 123 |
* Returns: the proxy's destination hostname |
|---|
| 124 |
*/ |
|---|
| 125 |
public string getDestinationHostname() |
|---|
| 126 |
{ |
|---|
| 127 |
// const gchar * g_proxy_address_get_destination_hostname (GProxyAddress *proxy); |
|---|
| 128 |
return Str.toString(g_proxy_address_get_destination_hostname(gProxyAddress)); |
|---|
| 129 |
} |
|---|
| 130 |
|
|---|
| 131 |
/** |
|---|
| 132 |
* Gets proxy's destination port. |
|---|
| 133 |
* Since 2.26 |
|---|
| 134 |
* Returns: the proxy's destination port |
|---|
| 135 |
*/ |
|---|
| 136 |
public ushort getDestinationPort() |
|---|
| 137 |
{ |
|---|
| 138 |
// guint16 g_proxy_address_get_destination_port (GProxyAddress *proxy); |
|---|
| 139 |
return g_proxy_address_get_destination_port(gProxyAddress); |
|---|
| 140 |
} |
|---|
| 141 |
|
|---|
| 142 |
/** |
|---|
| 143 |
* Gets proxy's password. |
|---|
| 144 |
* Since 2.26 |
|---|
| 145 |
* Returns: the proxy's password |
|---|
| 146 |
*/ |
|---|
| 147 |
public string getPassword() |
|---|
| 148 |
{ |
|---|
| 149 |
// const gchar * g_proxy_address_get_password (GProxyAddress *proxy); |
|---|
| 150 |
return Str.toString(g_proxy_address_get_password(gProxyAddress)); |
|---|
| 151 |
} |
|---|
| 152 |
|
|---|
| 153 |
/** |
|---|
| 154 |
* Gets proxy's protocol. |
|---|
| 155 |
* Since 2.26 |
|---|
| 156 |
* Returns: the proxy's protocol |
|---|
| 157 |
*/ |
|---|
| 158 |
public string getProtocol() |
|---|
| 159 |
{ |
|---|
| 160 |
// const gchar * g_proxy_address_get_protocol (GProxyAddress *proxy); |
|---|
| 161 |
return Str.toString(g_proxy_address_get_protocol(gProxyAddress)); |
|---|
| 162 |
} |
|---|
| 163 |
|
|---|
| 164 |
/** |
|---|
| 165 |
* Gets proxy's username. |
|---|
| 166 |
* Since 2.26 |
|---|
| 167 |
* Returns: the proxy's username |
|---|
| 168 |
*/ |
|---|
| 169 |
public string getUsername() |
|---|
| 170 |
{ |
|---|
| 171 |
// const gchar * g_proxy_address_get_username (GProxyAddress *proxy); |
|---|
| 172 |
return Str.toString(g_proxy_address_get_username(gProxyAddress)); |
|---|
| 173 |
} |
|---|
| 174 |
|
|---|
| 175 |
/** |
|---|
| 176 |
* Creates a new GProxyAddress for inetaddr with protocol that should |
|---|
| 177 |
* tunnel through dest_hostname and dest_port. |
|---|
| 178 |
* Since 2.26 |
|---|
| 179 |
* Params: |
|---|
| 180 |
* inetaddr = The proxy server GInetAddress. |
|---|
| 181 |
* port = The proxy server port. |
|---|
| 182 |
* protocol = The proxy protocol to support, in lower case (e.g. socks, http). |
|---|
| 183 |
* destHostname = The destination hostname the the proxy should tunnel to. |
|---|
| 184 |
* destPort = The destination port to tunnel to. |
|---|
| 185 |
* username = The username to authenticate to the proxy server |
|---|
| 186 |
* (or NULL). [allow-none] |
|---|
| 187 |
* password = The password to authenticate to the proxy server |
|---|
| 188 |
* (or NULL). [allow-none] |
|---|
| 189 |
* Throws: ConstructionException GTK+ fails to create the object. |
|---|
| 190 |
*/ |
|---|
| 191 |
public this (GInetAddress* inetaddr, ushort port, string protocol, string destHostname, ushort destPort, string username, string password) |
|---|
| 192 |
{ |
|---|
| 193 |
// 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); |
|---|
| 194 |
auto p = g_proxy_address_new(inetaddr, port, Str.toStringz(protocol), Str.toStringz(destHostname), destPort, Str.toStringz(username), Str.toStringz(password)); |
|---|
| 195 |
if(p is null) |
|---|
| 196 |
{ |
|---|
| 197 |
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))"); |
|---|
| 198 |
} |
|---|
| 199 |
this(cast(GProxyAddress*) p); |
|---|
| 200 |
} |
|---|
| 201 |
} |
|---|