1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
2 /*
3  * Copyright © 2009–2011 Collabora Ltd.
4  *
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.1 of the License, or (at your option) any later version.
9  *
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.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors:
20  *   Jonny Lamb <jonny.lamb@collabora.co.uk>
21  *   Will Thompson <will.thompson@collabora.co.uk>
22  */
23 
24 #ifndef MCD_CONNECTIVITY_MONITOR_H
25 #define MCD_CONNECTIVITY_MONITOR_H
26 
27 #include <glib-object.h>
28 
29 G_BEGIN_DECLS
30 
31 #define MCD_TYPE_CONNECTIVITY_MONITOR (mcd_connectivity_monitor_get_type ())
32 #define MCD_CONNECTIVITY_MONITOR(o) \
33   (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \
34       McdConnectivityMonitor))
35 #define MCD_CONNECTIVITY_MONITOR_CLASS(k) \
36   (G_TYPE_CHECK_CLASS_CAST ((k), MCD_TYPE_CONNECTIVITY_MONITOR, \
37       McdConnectivityMonitorClass))
38 #define MCD_IS_CONNECTIVITY_MONITOR(o) \
39   (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_CONNECTIVITY_MONITOR))
40 #define MCD_IS_CONNECTIVITY_MONITOR_CLASS(k) \
41   (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_CONNECTIVITY_MONITOR))
42 #define MCD_CONNECTIVITY_MONITOR_GET_CLASS(o) \
43   (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \
44       McdConnectivityMonitorClass))
45 
46 typedef struct _McdConnectivityMonitor McdConnectivityMonitor;
47 typedef struct _McdConnectivityMonitorClass McdConnectivityMonitorClass;
48 typedef struct _McdConnectivityMonitorPrivate McdConnectivityMonitorPrivate;
49 
50 struct _McdConnectivityMonitor {
51   GObject parent;
52   McdConnectivityMonitorPrivate *priv;
53 };
54 
55 struct _McdConnectivityMonitorClass {
56   GObjectClass parent_class;
57 };
58 
59 GType mcd_connectivity_monitor_get_type (void);
60 
61 /* public methods */
62 
63 McdConnectivityMonitor *mcd_connectivity_monitor_new (void);
64 
65 gboolean mcd_connectivity_monitor_is_online (McdConnectivityMonitor *connectivity);
66 
67 gboolean mcd_connectivity_monitor_get_use_conn (McdConnectivityMonitor *connectivity);
68 void mcd_connectivity_monitor_set_use_conn (McdConnectivityMonitor *connectivity,
69     gboolean use_conn);
70 
71 typedef struct _McdInhibit McdInhibit;
72 McdInhibit *mcd_inhibit_hold (McdInhibit *inhibit);
73 void mcd_inhibit_release (McdInhibit *inhibit);
74 
75 G_END_DECLS
76 
77 #endif /* MCD_CONNECTIVITY_MONITOR_H */
78 
79