Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/controlpanel.h
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef CONTROLPANEL_H | 22 | #ifndef CONTROLPANEL_H | ||
23 | #define CONTROLPANEL_H | 23 | #define CONTROLPANEL_H | ||
24 | 24 | | |||
25 | #include "../../common/control.h" | ||||
26 | | ||||
25 | #include <QFrame> | 27 | #include <QFrame> | ||
26 | 28 | | |||
27 | #include <kscreen/output.h> | 29 | #include <kscreen/output.h> | ||
28 | 30 | | |||
29 | class QVBoxLayout; | 31 | class QVBoxLayout; | ||
30 | class OutputConfig; | 32 | class OutputConfig; | ||
31 | class UnifiedOutputConfig; | 33 | class UnifiedOutputConfig; | ||
32 | 34 | | |||
33 | 35 | | |||
36 | #include <memory> | ||||
37 | | ||||
34 | class ControlPanel : public QFrame | 38 | class ControlPanel : public QFrame | ||
35 | { | 39 | { | ||
36 | Q_OBJECT | 40 | Q_OBJECT | ||
37 | 41 | | |||
38 | public: | 42 | public: | ||
39 | explicit ControlPanel(QWidget *parent = nullptr); | 43 | explicit ControlPanel(QWidget *parent = nullptr); | ||
40 | ~ControlPanel() override; | 44 | ~ControlPanel() override; | ||
41 | 45 | | |||
42 | void setConfig(const KScreen::ConfigPtr &config); | 46 | void setConfig(const KScreen::ConfigPtr &config); | ||
43 | 47 | | |||
44 | void setUnifiedOutput(const KScreen::OutputPtr &output); | 48 | void setUnifiedOutput(const KScreen::OutputPtr &output); | ||
45 | 49 | | |||
50 | void save(); | ||||
51 | | ||||
46 | public Q_SLOTS: | 52 | public Q_SLOTS: | ||
47 | void activateOutput(const KScreen::OutputPtr &output); | 53 | void activateOutput(const KScreen::OutputPtr &output); | ||
48 | 54 | | |||
49 | Q_SIGNALS: | 55 | Q_SIGNALS: | ||
50 | void changed(); | 56 | void changed(); | ||
51 | 57 | | |||
52 | private Q_SLOTS: | 58 | private Q_SLOTS: | ||
53 | void addOutput(const KScreen::OutputPtr &output); | 59 | void addOutput(const KScreen::OutputPtr &output); | ||
54 | void removeOutput(int outputId); | 60 | void removeOutput(int outputId); | ||
55 | 61 | | |||
56 | private: | 62 | private: | ||
57 | KScreen::ConfigPtr mConfig; | 63 | KScreen::ConfigPtr mConfig; | ||
58 | QList<OutputConfig*> mOutputConfigs; | 64 | QList<OutputConfig*> mOutputConfigs; | ||
59 | 65 | | |||
60 | QVBoxLayout *mLayout; | 66 | QVBoxLayout *mLayout; | ||
61 | UnifiedOutputConfig *mUnifiedOutputCfg; | 67 | UnifiedOutputConfig *mUnifiedOutputCfg; | ||
68 | | ||||
69 | std::unique_ptr<ControlConfig> mControlConfig = nullptr; | ||||
62 | }; | 70 | }; | ||
63 | 71 | | |||
64 | #endif // CONTROLPANEL_H | 72 | #endif // CONTROLPANEL_H |