1 /* BEGIN_COMMON_COPYRIGHT_HEADER
2  * (c)LGPL2+
3  *
4  * LXQt - a lightweight, Qt based, desktop toolset
5  * https://lxqt.org
6  *
7  * Copyright: 2012 Razor team
8  * Authors:
9  *   Christian Surlykke <christian@surlykke.dk>
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 COMMON_H
29 #define COMMON_H
30 
31 #include <QComboBox>
32 #include <QString>
33 #include <QTime>
34 
35 #include <LXQt/Settings>
36 
37 class PowerManagementSettings : public LXQt::Settings
38 {
39     Q_OBJECT
40 
41 public:
42     PowerManagementSettings(QObject* parent = nullptr);
43     ~PowerManagementSettings() override;
44 
45     int getRunCheckLevel();
46     void setRunCheckLevel(int newLevel);
47 
48     bool isBatteryWatcherEnabled();
49     void setBatteryWatcherEnabled(bool batteryWatcherEnabled);
50 
51     int getPowerLowAction();
52     void setPowerLowAction(int powerLowAction);
53 
54     int getPowerLowLevel();
55     void setPowerLowLevel(int powerLowLevel);
56 
57     int getPowerLowWarningTime();
58     void setPowerLowWarningTime(int powerLowWarningTime);
59 
60     bool isShowIcon();
61     void setShowIcon(bool showIcon);
62 
63     bool isUseThemeIcons();
64     void setUseThemeIcons(bool useThemeIcons);
65 
66 
67     bool isLidWatcherEnabled();
68     void setLidWatcherEnabled(bool lidWatcherEnabled);
69 
70     int getLidClosedAcAction();
71     void setLidClosedAcAction(int lidClosedAcAction);
72 
73     int getLidClosedAction();
74     void setLidClosedAction(int lidClosedAction);
75 
76     int getLidClosedExtMonAcAction();
77     void setLidClosedExtMonAcAction(int lidClosedExtMonAcAction);
78 
79     int getLidClosedExtMonAction();
80     void setLidClosedExtMonAction(int lidClosedExtMonAction);
81 
82     bool isEnableExtMonLidClosedActions();
83     void setEnableExtMonLidClosedActions(bool enableExtMonLidClosedActions);
84 
85 
86     bool isIdlenessWatcherEnabled();
87     void setIdlenessWatcherEnabled(bool idlenessWatcherEnabled);
88 
89     int getIdlenessACAction();
90     void setIdlenessACAction(int idlenessAction);
91 
92     QTime getIdlenessACTime();
93     void setIdlenessACTime(QTime idlenessTime);
94 
95     int getIdlenessBatteryAction();
96     void setIdlenessBatteryAction(int idlenessAction);
97 
98     QTime getIdlenessBatteryTime();
99     void setIdlenessBatteryTime(QTime idlenessTime);
100 
101     bool isIdlenessBacklightWatcherEnabled();
102     void setIdlenessBacklightWatcherEnabled(bool idlenessBacklightWatcherEnabled);
103 
104     QTime getIdlenessBacklightTime();
105     void setIdlenessBacklightTime(QTime idlenessBacklightTime);
106 
107     int getBacklight();
108     void setBacklight(int backlight);
109 
110     bool isIdlenessBacklightOnBatteryDischargingEnabled();
111     void setIdlenessBacklightOnBatteryDischargingEnabled(bool enabled);
112 
113     bool isDisableIdlenessWhenFullscreenEnabled();
114     void setDisableIdlenessWhenFullscreen(bool enabled);
115 
116     int getPowerKeyAction();
117     void setPowerKeyAction(int action);
118 
119     int getSuspendKeyAction();
120     void setSuspendKeyAction(int action);
121 
122     int getHibernateKeyAction();
123     void setHibernateKeyAction(int action);
124 
125     bool isIdlenessWatcherPaused() const;
126     void setIdlenessWatcherPaused(bool idlenessWatcherPaused);
127 
128 private:
129     static bool mIdlenessWatcherPaused;
130 };
131 
132 
133 #endif // COMMON_H
134