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