source: appstream-generator/build/girepo/gio/ProxyAddress.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 5.1 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.ProxyAddress;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.InetAddress;
26private import gio.InetSocketAddress;
27private import gio.SocketAddress;
28private import glib.ConstructionException;
29private import glib.Str;
30private import gobject.ObjectG;
31
32
33/**
34 * Support for proxied #GInetSocketAddress.
35 *
36 * Since: 2.26
37 */
38public class ProxyAddress : InetSocketAddress
39{
40        /** the main Gtk struct */
41        protected GProxyAddress* gProxyAddress;
42
43        /** Get the main Gtk struct */
44        public GProxyAddress* getProxyAddressStruct()
45        {
46                return gProxyAddress;
47        }
48
49        /** the main Gtk struct as a void* */
50        protected override void* getStruct()
51        {
52                return cast(void*)gProxyAddress;
53        }
54
55        protected override void setStruct(GObject* obj)
56        {
57                gProxyAddress = cast(GProxyAddress*)obj;
58                super.setStruct(obj);
59        }
60
61        /**
62         * Sets our main struct and passes it to the parent class.
63         */
64        public this (GProxyAddress* gProxyAddress, bool ownedRef = false)
65        {
66                this.gProxyAddress = gProxyAddress;
67                super(cast(GInetSocketAddress*)gProxyAddress, ownedRef);
68        }
69
70
71        /** */
72        public static GType getType()
73        {
74                return g_proxy_address_get_type();
75        }
76
77        /**
78         * Creates a new #GProxyAddress for @inetaddr with @protocol that should
79         * tunnel through @dest_hostname and @dest_port.
80         *
81         * (Note that this method doesn't set the #GProxyAddress:uri or
82         * #GProxyAddress:destination-protocol fields; use g_object_new()
83         * directly if you want to set those.)
84         *
85         * Params:
86         *     inetaddr = The proxy server #GInetAddress.
87         *     port = The proxy server port.
88         *     protocol = The proxy protocol to support, in lower case (e.g. socks, http).
89         *     destHostname = The destination hostname the proxy should tunnel to.
90         *     destPort = The destination port to tunnel to.
91         *     username = The username to authenticate to the proxy server
92         *         (or %NULL).
93         *     password = The password to authenticate to the proxy server
94         *         (or %NULL).
95         *
96         * Returns: a new #GProxyAddress
97         *
98         * Since: 2.26
99         *
100         * Throws: ConstructionException GTK+ fails to create the object.
101         */
102        public this(InetAddress inetaddr, ushort port, string protocol, string destHostname, ushort destPort, string username, string password)
103        {
104                auto p = g_proxy_address_new((inetaddr is null) ? null : inetaddr.getInetAddressStruct(), port, Str.toStringz(protocol), Str.toStringz(destHostname), destPort, Str.toStringz(username), Str.toStringz(password));
105               
106                if(p is null)
107                {
108                        throw new ConstructionException("null returned by new");
109                }
110               
111                this(cast(GProxyAddress*) p, true);
112        }
113
114        /**
115         * Gets @proxy's destination hostname; that is, the name of the host
116         * that will be connected to via the proxy, not the name of the proxy
117         * itself.
118         *
119         * Returns: the @proxy's destination hostname
120         *
121         * Since: 2.26
122         */
123        public string getDestinationHostname()
124        {
125                return Str.toString(g_proxy_address_get_destination_hostname(gProxyAddress));
126        }
127
128        /**
129         * Gets @proxy's destination port; that is, the port on the
130         * destination host that will be connected to via the proxy, not the
131         * port number of the proxy itself.
132         *
133         * Returns: the @proxy's destination port
134         *
135         * Since: 2.26
136         */
137        public ushort getDestinationPort()
138        {
139                return g_proxy_address_get_destination_port(gProxyAddress);
140        }
141
142        /**
143         * Gets the protocol that is being spoken to the destination
144         * server; eg, "http" or "ftp".
145         *
146         * Returns: the @proxy's destination protocol
147         *
148         * Since: 2.34
149         */
150        public string getDestinationProtocol()
151        {
152                return Str.toString(g_proxy_address_get_destination_protocol(gProxyAddress));
153        }
154
155        /**
156         * Gets @proxy's password.
157         *
158         * Returns: the @proxy's password
159         *
160         * Since: 2.26
161         */
162        public string getPassword()
163        {
164                return Str.toString(g_proxy_address_get_password(gProxyAddress));
165        }
166
167        /**
168         * Gets @proxy's protocol. eg, "socks" or "http"
169         *
170         * Returns: the @proxy's protocol
171         *
172         * Since: 2.26
173         */
174        public string getProtocol()
175        {
176                return Str.toString(g_proxy_address_get_protocol(gProxyAddress));
177        }
178
179        /**
180         * Gets the proxy URI that @proxy was constructed from.
181         *
182         * Returns: the @proxy's URI, or %NULL if unknown
183         *
184         * Since: 2.34
185         */
186        public string getUri()
187        {
188                return Str.toString(g_proxy_address_get_uri(gProxyAddress));
189        }
190
191        /**
192         * Gets @proxy's username.
193         *
194         * Returns: the @proxy's username
195         *
196         * Since: 2.26
197         */
198        public string getUsername()
199        {
200                return Str.toString(g_proxy_address_get_username(gProxyAddress));
201        }
202}
Note: See TracBrowser for help on using the repository browser.