1 /*
2     Copyright (C) 2016  P.L. Lucas <selairi@gmail.com>
3 
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Lesser General Public
6     License as published by the Free Software Foundation; either
7     version 2.1 of the License, or (at your option) any later version.
8 
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Lesser General Public License for more details.
13 
14     You should have received a copy of the GNU Lesser General Public
15     License along with this library; if not, write to the Free Software
16     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18 
19 #ifndef __BRIGHTNESS_SETTINGS_H__
20 #define __BRIGHTNESS_SETTINGS_H__
21 
22 #include <QDialog>
23 #include <QTimer>
24 #include "xrandrbrightness.h"
25 #include "ui_brightnesssettings.h"
26 
27 #include <LXQt/lxqtbacklight.h>
28 
29 class BrightnessSettings: public QDialog
30 {
31 Q_OBJECT
32 
33 public:
34     BrightnessSettings(QWidget *parent =nullptr);
35     ~BrightnessSettings();
36 
37     void revertValues();
38 
39 signals:
40     void monitorReverted(const MonitorInfo & monitor);
41 
42 public slots:
43     void monitorSettingsChanged(MonitorInfo monitor);
44     void requestConfirmation();
45     void setBacklight();
46 
47 private:
48     void setBacklightSliderValue(int value);
49 
50     XRandrBrightness *mBrightness;
51     QList<MonitorInfo> mMonitors;
52     QList<MonitorInfo> mMonitorsInitial;
53     QTimer mConfirmRequestTimer;
54     Ui::BrightnessSettings *ui;
55     LXQt::Backlight *mBacklight;
56     int mLastBacklightValue;
57     int mInitialBacklightValue;
58 
59 };
60 
61 
62 #endif
63 
64