Formatting cleanup
[glib.git] / gio / gnetworkmonitor.h
blobe525293b585483f00d3821a81a006c51b136be5d
1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright 2011 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
22 #error "Only <gio/gio.h> can be included directly."
23 #endif
25 #ifndef __G_NETWORK_MONITOR_H__
26 #define __G_NETWORK_MONITOR_H__
28 #include <gio/giotypes.h>
30 G_BEGIN_DECLS
32 /**
33 * G_NETWORK_MONITOR_EXTENSION_POINT_NAME:
35 * Extension point for network status monitoring functionality.
36 * See <link linkend="extending-gio">Extending GIO</link>.
38 * Since: 2.30
40 #define G_NETWORK_MONITOR_EXTENSION_POINT_NAME "gio-network-monitor"
42 #define G_TYPE_NETWORK_MONITOR (g_network_monitor_get_type ())
43 #define G_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitor))
44 #define G_IS_NETWORK_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_NETWORK_MONITOR))
45 #define G_NETWORK_MONITOR_GET_INTERFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), G_TYPE_NETWORK_MONITOR, GNetworkMonitorInterface))
47 typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface;
49 struct _GNetworkMonitorInterface {
50 GTypeInterface g_iface;
52 void (*network_changed) (GNetworkMonitor *monitor,
53 gboolean available);
55 gboolean (*can_reach) (GNetworkMonitor *monitor,
56 GSocketConnectable *connectable,
57 GCancellable *cancellable,
58 GError **error);
59 void (*can_reach_async) (GNetworkMonitor *monitor,
60 GSocketConnectable *connectable,
61 GCancellable *cancellable,
62 GAsyncReadyCallback callback,
63 gpointer user_data);
64 gboolean (*can_reach_finish) (GNetworkMonitor *monitor,
65 GAsyncResult *result,
66 GError **error);
69 GType g_network_monitor_get_type (void) G_GNUC_CONST;
70 GNetworkMonitor *g_network_monitor_get_default (void);
72 gboolean g_network_monitor_get_network_available (GNetworkMonitor *monitor);
74 gboolean g_network_monitor_can_reach (GNetworkMonitor *monitor,
75 GSocketConnectable *connectable,
76 GCancellable *cancellable,
77 GError **error);
78 void g_network_monitor_can_reach_async (GNetworkMonitor *monitor,
79 GSocketConnectable *connectable,
80 GCancellable *cancellable,
81 GAsyncReadyCallback callback,
82 gpointer user_data);
83 gboolean g_network_monitor_can_reach_finish (GNetworkMonitor *monitor,
84 GAsyncResult *result,
85 GError **error);
87 G_END_DECLS
89 #endif /* __G_NETWORK_MONITOR_H__ */