1 /*
2  * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
3  *
4  * This library is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #if !defined (__LIBEDATASERVER_H_INSIDE__) && !defined (LIBEDATASERVER_COMPILATION)
18 #error "Only <libedataserver/libedataserver.h> should be included directly."
19 #endif
20 
21 #ifndef E_NETWORK_MONITOR_H
22 #define E_NETWORK_MONITOR_H
23 
24 #include <gio/gio.h>
25 
26 /* Standard GObject macros */
27 #define E_TYPE_NETWORK_MONITOR \
28 	(e_network_monitor_get_type ())
29 #define E_NETWORK_MONITOR(obj) \
30 	(G_TYPE_CHECK_INSTANCE_CAST \
31 	((obj), E_TYPE_NETWORK_MONITOR, ENetworkMonitor))
32 #define E_NETWORK_MONITOR_CLASS(cls) \
33 	(G_TYPE_CHECK_CLASS_CAST \
34 	((cls), E_TYPE_NETWORK_MONITOR, ENetworkMonitorClass))
35 #define E_IS_NETWORK_MONITOR(obj) \
36 	(G_TYPE_CHECK_INSTANCE_TYPE \
37 	((obj), E_TYPE_NETWORK_MONITOR))
38 #define E_IS_NETWORK_MONITOR_CLASS(cls) \
39 	(G_TYPE_CHECK_CLASS_TYPE \
40 	((cls), E_TYPE_NETWORK_MONITOR))
41 #define E_NETWORK_MONITOR_GET_CLASS(obj) \
42 	(G_TYPE_INSTANCE_GET_CLASS \
43 	((obj), E_TYPE_NETWORK_MONITOR, ENetworkMonitorClass))
44 
45 G_BEGIN_DECLS
46 
47 typedef struct _ENetworkMonitor ENetworkMonitor;
48 typedef struct _ENetworkMonitorClass ENetworkMonitorClass;
49 typedef struct _ENetworkMonitorPrivate ENetworkMonitorPrivate;
50 
51 /**
52  * E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME: (value "always-online")
53  *
54  * A special name, which can be used as a GIO name in the call
55  * to e_network_monitor_set_gio_name(), which is used to report
56  * the network as always reachable.
57  *
58  * Since: 3.22
59  **/
60 #define E_NETWORK_MONITOR_ALWAYS_ONLINE_NAME "always-online"
61 
62 /**
63  * ENetworkMonitor:
64  *
65  * Contains only private data that should be read and manipulated using
66  * the functions below. Implements #GNetworkMonitorInterface.
67  *
68  * Since: 3.22
69  **/
70 struct _ENetworkMonitor {
71 	/*< private >*/
72 	GObject parent;
73 	ENetworkMonitorPrivate *priv;
74 };
75 
76 struct _ENetworkMonitorClass {
77 	GObjectClass parent_class;
78 };
79 
80 GType		e_network_monitor_get_type		(void) G_GNUC_CONST;
81 GNetworkMonitor *
82 		e_network_monitor_get_default		(void);
83 GSList *	e_network_monitor_list_gio_names	(ENetworkMonitor *network_monitor);
84 gchar *		e_network_monitor_dup_gio_name		(ENetworkMonitor *network_monitor);
85 void		e_network_monitor_set_gio_name		(ENetworkMonitor *network_monitor,
86 							 const gchar *gio_name);
87 
88 G_END_DECLS
89 
90 #endif /* E_NETWORK_MONITOR_H */
91