~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to liblightdm-qt/QLightDM/power.h

  • Committer: David Edmundson
  • Date: 2011-11-15 19:51:42 UTC
  • mto: (1297.1.18 qt-fixes)
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: david@davidedmundson.co.uk-20111115195142-ktno6ezyt17slvij
Turn power interface into a proper class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#ifndef QLIGHTDM_POWER_H
14
14
#define QLIGHTDM_POWER_H
15
15
 
 
16
#include <QObject>
 
17
 
16
18
namespace QLightDM
17
19
{
18
 
    bool canSuspend();
19
 
    bool canHibernate();
20
 
    bool canShutdown();
21
 
    bool canRestart();
22
 
    void suspend();
23
 
    void hibernate();
24
 
    void shutdown();
25
 
    void restart();
 
20
    class PowerInterface : public QObject
 
21
    {
 
22
        Q_OBJECT
 
23
    public:
 
24
        Q_PROPERTY(bool canSuspend READ canSuspend() CONSTANT)
 
25
        Q_PROPERTY(bool canHibernate READ canHibernate() CONSTANT)
 
26
        Q_PROPERTY(bool canShutdown READ canShutdown() CONSTANT)
 
27
        Q_PROPERTY(bool canRestart READ canRestart() CONSTANT)
 
28
 
 
29
        PowerInterface(QObject *parent);
 
30
        virtual ~PowerInterface();
 
31
 
 
32
        bool canSuspend();
 
33
        bool canHibernate();
 
34
        bool canShutdown();
 
35
        bool canRestart();
 
36
 
 
37
    public Q_SLOTS:
 
38
        void suspend();
 
39
        void hibernate();
 
40
        void shutdown();
 
41
        void restart();
 
42
 
 
43
    private:
 
44
        class PowerInterfacePrivate;
 
45
        PowerInterfacePrivate * const d;
 
46
 
 
47
    };
26
48
};
27
49
 
28
50
#endif // QLIGHTDM_POWER_H