Back to index

lightdm  1.3.2
power.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 David Edmundson.
00003  * Copyright (C) 2010-2011 Robert Ancell
00004  * Author: David Edmundson <kde@davidedmundson.co.uk>
00005  *
00006  * This library is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU Lesser General Public License as published by the Free
00008  * Software Foundation; either version 3 of the License, or (at your option) any
00009  * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
00010  * license.
00011  */
00012 
00013 #ifndef QLIGHTDM_POWER_H
00014 #define QLIGHTDM_POWER_H
00015 
00016 #include <QObject>
00017 
00018 namespace QLightDM
00019 {
00020     class PowerInterface : public QObject
00021     {
00022         Q_OBJECT
00023     public:
00024         Q_PROPERTY(bool canSuspend READ canSuspend() CONSTANT)
00025         Q_PROPERTY(bool canHibernate READ canHibernate() CONSTANT)
00026         Q_PROPERTY(bool canShutdown READ canShutdown() CONSTANT)
00027         Q_PROPERTY(bool canRestart READ canRestart() CONSTANT)
00028 
00029         PowerInterface(QObject *parent);
00030         virtual ~PowerInterface();
00031 
00032         bool canSuspend();
00033         bool canHibernate();
00034         bool canShutdown();
00035         bool canRestart();
00036 
00037     public Q_SLOTS:
00038         void suspend();
00039         void hibernate();
00040         void shutdown();
00041         void restart();
00042 
00043     private:
00044         class PowerInterfacePrivate;
00045         PowerInterfacePrivate * const d;
00046 
00047     };
00048 };
00049 
00050 #endif // QLIGHTDM_POWER_H