]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - liblightdm-qt/QLightDM/power.h
Merge with trunk
[sojka/lightdm.git] / liblightdm-qt / QLightDM / power.h
1 /*
2  * Copyright (C) 2010-2011 David Edmundson.
3  * Copyright (C) 2010-2011 Robert Ancell
4  * Author: David Edmundson <kde@davidedmundson.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by the Free
8  * Software Foundation; either version 2 or version 3 of the License.
9  * See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
10  */
11
12 #ifndef QLIGHTDM_POWER_H
13 #define QLIGHTDM_POWER_H
14
15 #include <QObject>
16
17 namespace QLightDM
18 {
19     class PowerInterface : public QObject
20     {
21         Q_OBJECT
22     public:
23         Q_PROPERTY(bool canSuspend READ canSuspend() CONSTANT)
24         Q_PROPERTY(bool canHibernate READ canHibernate() CONSTANT)
25         Q_PROPERTY(bool canShutdown READ canShutdown() CONSTANT)
26         Q_PROPERTY(bool canRestart READ canRestart() CONSTANT)
27
28         PowerInterface(QObject *parent=0);
29         virtual ~PowerInterface();
30
31         bool canSuspend();
32         bool canHibernate();
33         bool canShutdown();
34         bool canRestart();
35
36     public Q_SLOTS:
37         bool suspend();
38         bool hibernate();
39         bool shutdown();
40         bool restart();
41
42     private:
43         class PowerInterfacePrivate;
44         PowerInterfacePrivate * const d;
45
46     };
47 }
48
49 #endif // QLIGHTDM_POWER_H