RazorAutostartEntry => LxQt::AutostartEntry
[lxde/liblxqt.git] / powermanager.h
1 /* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
4 * Razor - a lightweight, Qt based, desktop toolset
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
14 * version 2.1 of the License, or (at your option) any later version.
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
28 #ifndef POWERMANAGER_H
29 #define POWERMANAGER_H
30
31 #include <QObject>
32 #include <QAction>
33
34 namespace LxQt
35 {
36 class Power;
37 }
38 /*! QAction centric menu aware wrapper around razorpower
39 */
40 class PowerManager : public QObject
41 {
42 Q_OBJECT
43
44 public:
45 PowerManager(QObject * parent, bool skipWarning = false);
46 ~PowerManager();
47 QList<QAction*> availableActions();
48
49 public slots:
50 // power management
51 void suspend();
52 void hibernate();
53 void reboot();
54 void shutdown();
55 // razor session
56 void logout();
57
58 public:
59 bool skipWarning() const { return m_skipWarning; }
60
61 private:
62 LxQt::Power * m_power;
63 bool m_skipWarning;
64
65 private slots:
66 void hibernateFailed();
67 void suspendFailed();
68 };
69
70 #endif