summaryrefslogtreecommitdiff
path: root/src/nm-sleep-monitor.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-10-09 00:36:35 -0400
committerDan Williams <dcbw@redhat.com>2012-10-13 09:20:00 -0500
commit64fd8eea7706038e5d38c8463a1c765ed9331db2 (patch)
treedf10a68a2239beac107237f27b9c4c0ab6e0cb30 /src/nm-sleep-monitor.h
parent27a14a7d116cfd23b215a9b0bf236d44f29aea56 (diff)
downloadNetworkManager-64fd8eea7706038e5d38c8463a1c765ed9331db2.tar.gz
core: factor out the upower suspend/resume code (bgo #677694)
Factor the code that listens for upower sleeping and resuming signals out into a class code NMSleepMonitor.
Diffstat (limited to 'src/nm-sleep-monitor.h')
-rw-r--r--src/nm-sleep-monitor.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nm-sleep-monitor.h b/src/nm-sleep-monitor.h
new file mode 100644
index 0000000000..173e6a1369
--- /dev/null
+++ b/src/nm-sleep-monitor.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2012 Red Hat, Inc.
+ * Author: Matthias Clasen <mclasen@redhat.com>
+ */
+
+#ifndef NM_SLEEP_MONITOR_H
+#define NM_SLEEP_MONITOR_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_SLEEP_MONITOR (nm_sleep_monitor_get_type ())
+#define NM_SLEEP_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_SLEEP_MONITOR, NMSleepMonitor))
+#define NM_SLEEP_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), NM_TYPE_SLEEP_MONITOR, NMSleepMonitorClass))
+#define NM_SLEEP_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_SLEEP_MONITOR, NMSleepMonitorClass))
+#define NM_IS_SLEEP_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NM_TYPE_SLEEP_MONITOR))
+#define NM_IS_SLEEP_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NM_TYPE_SLEEP_MONITOR))
+
+#define NM_SLEEP_MONITOR_SLEEPING "sleeping"
+#define NM_SLEEP_MONITOR_RESUMING "resuming"
+
+typedef struct _NMSleepMonitor NMSleepMonitor;
+typedef struct _NMSleepMonitorClass NMSleepMonitorClass;
+
+GType nm_sleep_monitor_get_type (void) G_GNUC_CONST;
+NMSleepMonitor *nm_sleep_monitor_get (void);
+
+G_END_DECLS
+
+#endif /* NM_SLEEP_MONITOR_H */
+