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

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

Initial release

File size: 6.2 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.NetworkMonitorIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.AsyncResultIF;
26private import gio.Cancellable;
27private import gio.NetworkMonitor;
28private import gio.NetworkMonitorIF;
29private import gio.SocketConnectableIF;
30private import glib.ErrorG;
31private import glib.GException;
32private import gobject.ObjectG;
33private import gobject.Signals;
34private import std.algorithm;
35
36
37/**
38 * #GNetworkMonitor provides an easy-to-use cross-platform API
39 * for monitoring network connectivity. On Linux, the implementation
40 * is based on the kernel's netlink interface.
41 *
42 * Since: 2.32
43 */
44public interface NetworkMonitorIF{
45        /** Get the main Gtk struct */
46        public GNetworkMonitor* getNetworkMonitorStruct();
47
48        /** the main Gtk struct as a void* */
49        protected void* getStruct();
50
51
52        /**
53         * Gets the default #GNetworkMonitor for the system.
54         *
55         * Returns: a #GNetworkMonitor
56         *
57         * Since: 2.32
58         */
59        public static NetworkMonitorIF getDefault();
60
61        /**
62         * Attempts to determine whether or not the host pointed to by
63         * @connectable can be reached, without actually trying to connect to
64         * it.
65         *
66         * This may return %TRUE even when #GNetworkMonitor:network-available
67         * is %FALSE, if, for example, @monitor can determine that
68         * @connectable refers to a host on a local network.
69         *
70         * If @monitor believes that an attempt to connect to @connectable
71         * will succeed, it will return %TRUE. Otherwise, it will return
72         * %FALSE and set @error to an appropriate error (such as
73         * %G_IO_ERROR_HOST_UNREACHABLE).
74         *
75         * Note that although this does not attempt to connect to
76         * @connectable, it may still block for a brief period of time (eg,
77         * trying to do multicast DNS on the local network), so if you do not
78         * want to block, you should use g_network_monitor_can_reach_async().
79         *
80         * Params:
81         *     connectable = a #GSocketConnectable
82         *     cancellable = a #GCancellable, or %NULL
83         *
84         * Returns: %TRUE if @connectable is reachable, %FALSE if not.
85         *
86         * Since: 2.32
87         *
88         * Throws: GException on failure.
89         */
90        public bool canReach(SocketConnectableIF connectable, Cancellable cancellable);
91
92        /**
93         * Asynchronously attempts to determine whether or not the host
94         * pointed to by @connectable can be reached, without actually
95         * trying to connect to it.
96         *
97         * For more details, see g_network_monitor_can_reach().
98         *
99         * When the operation is finished, @callback will be called.
100         * You can then call g_network_monitor_can_reach_finish()
101         * to get the result of the operation.
102         *
103         * Params:
104         *     connectable = a #GSocketConnectable
105         *     cancellable = a #GCancellable, or %NULL
106         *     callback = a #GAsyncReadyCallback to call when the
107         *         request is satisfied
108         *     userData = the data to pass to callback function
109         */
110        public void canReachAsync(SocketConnectableIF connectable, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
111
112        /**
113         * Finishes an async network connectivity test.
114         * See g_network_monitor_can_reach_async().
115         *
116         * Params:
117         *     result = a #GAsyncResult
118         *
119         * Returns: %TRUE if network is reachable, %FALSE if not.
120         *
121         * Throws: GException on failure.
122         */
123        public bool canReachFinish(AsyncResultIF result);
124
125        /**
126         * Gets a more detailed networking state than
127         * g_network_monitor_get_network_available().
128         *
129         * If #GNetworkMonitor:network-available is %FALSE, then the
130         * connectivity state will be %G_NETWORK_CONNECTIVITY_LOCAL.
131         *
132         * If #GNetworkMonitor:network-available is %TRUE, then the
133         * connectivity state will be %G_NETWORK_CONNECTIVITY_FULL (if there
134         * is full Internet connectivity), %G_NETWORK_CONNECTIVITY_LIMITED (if
135         * the host has a default route, but appears to be unable to actually
136         * reach the full Internet), or %G_NETWORK_CONNECTIVITY_PORTAL (if the
137         * host is trapped behind a "captive portal" that requires some sort
138         * of login or acknowledgement before allowing full Internet access).
139         *
140         * Note that in the case of %G_NETWORK_CONNECTIVITY_LIMITED and
141         * %G_NETWORK_CONNECTIVITY_PORTAL, it is possible that some sites are
142         * reachable but others are not. In this case, applications can
143         * attempt to connect to remote servers, but should gracefully fall
144         * back to their "offline" behavior if the connection attempt fails.
145         *
146         * Returns: the network connectivity state
147         *
148         * Since: 2.44
149         */
150        public GNetworkConnectivity getConnectivity();
151
152        /**
153         * Checks if the network is available. "Available" here means that the
154         * system has a default route available for at least one of IPv4 or
155         * IPv6. It does not necessarily imply that the public Internet is
156         * reachable. See #GNetworkMonitor:network-available for more details.
157         *
158         * Returns: whether the network is available
159         *
160         * Since: 2.32
161         */
162        public bool getNetworkAvailable();
163
164        /**
165         * Checks if the network is metered.
166         * See #GNetworkMonitor:network-metered for more details.
167         *
168         * Returns: whether the connection is metered
169         *
170         * Since: 2.46
171         */
172        public bool getNetworkMetered();
173
174        /**
175         * Emitted when the network configuration changes. If @available is
176         * %TRUE, then some hosts may be reachable that were not reachable
177         * before, while others that were reachable before may no longer be
178         * reachable. If @available is %FALSE, then no remote hosts are
179         * reachable.
180         *
181         * Params:
182         *     available = the current value of #GNetworkMonitor:network-available
183         *
184         * Since: 2.32
185         */
186        gulong addOnNetworkChanged(void delegate(bool, NetworkMonitorIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
187}
Note: See TracBrowser for help on using the repository browser.