Release 0.11.0: Add changelog
[lxde/liblxqt.git] / lxqtpowermanager.h
CommitLineData
4ef6cee9 1/* BEGIN_COMMON_COPYRIGHT_HEADER
c4af778e 2 * (c)LGPL2+
4ef6cee9 3 *
b9223fe7 4 * LXQt - a lightweight, Qt based, desktop toolset
4ef6cee9 5 * http://razor-qt.org
6 *
7 * Copyright: 2010-2011 Razor team
8 * Authors:
9 * Petr Vanek <petr@scribus.info>
10 *
11 * This program or library is free software; you can redistribute it
12 * and/or modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
c4af778e 14 * version 2.1 of the License, or (at your option) any later version.
4ef6cee9 15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20
21 * You should have received a copy of the GNU Lesser General
22 * Public License along with this library; if not, write to the
23 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301 USA
25 *
26 * END_COMMON_COPYRIGHT_HEADER */
27
b6483430
AS
28#ifndef LXQTPOWERMANAGER_H
29#define LXQTPOWERMANAGER_H
4ef6cee9 30
31#include <QObject>
32#include <QAction>
f9cba1ba 33#include "lxqtglobals.h"
4ef6cee9 34
f05ba5af 35namespace LXQt
8e6db58a
AS
36{
37class Power;
570d4cb9 38
db4aaddf 39/*! QAction centric menu aware wrapper around lxqtpower
4ef6cee9 40*/
f9cba1ba 41class LXQT_API PowerManager : public QObject
4ef6cee9 42{
43 Q_OBJECT
44
45public:
3ecf643a 46 PowerManager(QObject * parent, bool skipWarning = false);
4ef6cee9 47 ~PowerManager();
48 QList<QAction*> availableActions();
e6173915 49
4ef6cee9 50public slots:
c7351c0e 51 // power management
4ef6cee9 52 void suspend();
53 void hibernate();
54 void reboot();
c7351c0e 55 void shutdown();
db4aaddf 56 // lxqt session
4ef6cee9 57 void logout();
58
3ecf643a
CS
59public:
60 bool skipWarning() const { return m_skipWarning; }
61
4ef6cee9 62private:
f05ba5af 63 LXQt::Power * m_power;
3ecf643a 64 bool m_skipWarning;
4ef6cee9 65
66private slots:
67 void hibernateFailed();
68 void suspendFailed();
4ef6cee9 69};
70
f05ba5af 71} // namespace LXQt
570d4cb9 72
b6483430 73#endif // LXQTPOWERMANAGER_H