summaryrefslogtreecommitdiff
path: root/src/connectivity-monitor.h
blob: de10e10759f9f96b6409f7a1981b679fb2fb43db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
 * Copyright © 2009–2011 Collabora Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Authors:
 *   Jonny Lamb <jonny.lamb@collabora.co.uk>
 *   Will Thompson <will.thompson@collabora.co.uk>
 */

#ifndef MCD_CONNECTIVITY_MONITOR_H
#define MCD_CONNECTIVITY_MONITOR_H

#include <glib-object.h>

G_BEGIN_DECLS

#define MCD_TYPE_CONNECTIVITY_MONITOR (mcd_connectivity_monitor_get_type ())
#define MCD_CONNECTIVITY_MONITOR(o) \
  (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \
      McdConnectivityMonitor))
#define MCD_CONNECTIVITY_MONITOR_CLASS(k) \
  (G_TYPE_CHECK_CLASS_CAST ((k), MCD_TYPE_CONNECTIVITY_MONITOR, \
      McdConnectivityMonitorClass))
#define MCD_IS_CONNECTIVITY_MONITOR(o) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_CONNECTIVITY_MONITOR))
#define MCD_IS_CONNECTIVITY_MONITOR_CLASS(k) \
  (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_CONNECTIVITY_MONITOR))
#define MCD_CONNECTIVITY_MONITOR_GET_CLASS(o) \
  (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \
      McdConnectivityMonitorClass))

typedef struct _McdConnectivityMonitor McdConnectivityMonitor;
typedef struct _McdConnectivityMonitorClass McdConnectivityMonitorClass;
typedef struct _McdConnectivityMonitorPrivate McdConnectivityMonitorPrivate;

struct _McdConnectivityMonitor {
  GObject parent;
  McdConnectivityMonitorPrivate *priv;
};

struct _McdConnectivityMonitorClass {
  GObjectClass parent_class;
};

GType mcd_connectivity_monitor_get_type (void);

/* public methods */

McdConnectivityMonitor *mcd_connectivity_monitor_new (void);

gboolean mcd_connectivity_monitor_is_online (McdConnectivityMonitor *connectivity);

gboolean mcd_connectivity_monitor_get_use_conn (McdConnectivityMonitor *connectivity);
void mcd_connectivity_monitor_set_use_conn (McdConnectivityMonitor *connectivity,
    gboolean use_conn);

typedef struct _McdInhibit McdInhibit;
McdInhibit *mcd_inhibit_hold (McdInhibit *inhibit);
void mcd_inhibit_release (McdInhibit *inhibit);

G_END_DECLS

#endif /* MCD_CONNECTIVITY_MONITOR_H */