Changeset View
Changeset View
Standalone View
Standalone View
daemon/powerdevilpowermanagement.h
Show All 25 Lines | |||||
26 | namespace PowerDevil { | 26 | namespace PowerDevil { | ||
27 | 27 | | |||
28 | class Q_DECL_EXPORT PowerManagement : public QObject | 28 | class Q_DECL_EXPORT PowerManagement : public QObject | ||
29 | { | 29 | { | ||
30 | Q_OBJECT | 30 | Q_OBJECT | ||
31 | Q_PROPERTY(bool canSuspend READ canSuspend NOTIFY canSuspendChanged) | 31 | Q_PROPERTY(bool canSuspend READ canSuspend NOTIFY canSuspendChanged) | ||
32 | Q_PROPERTY(bool canHibernate READ canHibernate NOTIFY canHibernateChanged) | 32 | Q_PROPERTY(bool canHibernate READ canHibernate NOTIFY canHibernateChanged) | ||
33 | Q_PROPERTY(bool canHybridSuspend READ canHybridSuspend NOTIFY canHybridSuspendChanged) | 33 | Q_PROPERTY(bool canHybridSuspend READ canHybridSuspend NOTIFY canHybridSuspendChanged) | ||
34 | Q_PROPERTY(bool canSuspendThenHibernate READ canSuspendThenHibernate NOTIFY canSuspendThenHibernateChanged) | ||||
34 | public: | 35 | public: | ||
35 | virtual ~PowerManagement(); | 36 | virtual ~PowerManagement(); | ||
36 | 37 | | |||
37 | bool canSuspend() const; | 38 | bool canSuspend() const; | ||
38 | bool canHibernate() const; | 39 | bool canHibernate() const; | ||
39 | bool canHybridSuspend() const; | 40 | bool canHybridSuspend() const; | ||
41 | bool canSuspendThenHibernate() const; | ||||
40 | 42 | | |||
41 | static PowerManagement *instance(); | 43 | static PowerManagement *instance(); | ||
42 | 44 | | |||
43 | public Q_SLOTS: | 45 | public Q_SLOTS: | ||
44 | void suspend(); | 46 | void suspend(); | ||
45 | void hibernate(); | 47 | void hibernate(); | ||
46 | void hybridSuspend(); | 48 | void hybridSuspend(); | ||
49 | void suspendThenHibernate(); | ||||
47 | 50 | | |||
48 | Q_SIGNALS: | 51 | Q_SIGNALS: | ||
49 | void canSuspendChanged(); | 52 | void canSuspendChanged(); | ||
53 | void canSuspendThenHibernateChanged(); | ||||
50 | void canHibernateChanged(); | 54 | void canHibernateChanged(); | ||
51 | void canHybridSuspendChanged(); | 55 | void canHybridSuspendChanged(); | ||
52 | 56 | | |||
53 | protected: | 57 | protected: | ||
54 | explicit PowerManagement(); | 58 | explicit PowerManagement(); | ||
55 | 59 | | |||
56 | private: | 60 | private: | ||
57 | class Private; | 61 | class Private; | ||
58 | QScopedPointer<Private> d; | 62 | QScopedPointer<Private> d; | ||
59 | }; | 63 | }; | ||
60 | 64 | | |||
61 | } // namespace PowerDevil | 65 | } // namespace PowerDevil | ||
62 | 66 | | |||
63 | #endif // POWERDEVIL_POWERMANAGEMENT_H | 67 | #endif // POWERDEVIL_POWERMANAGEMENT_H |