Changeset View
Changeset View
Standalone View
Standalone View
common/control.h
Show All 19 Lines | |||||
20 | #include <kscreen/types.h> | 20 | #include <kscreen/types.h> | ||
21 | 21 | | |||
22 | #include <QVariantMap> | 22 | #include <QVariantMap> | ||
23 | 23 | | |||
24 | class Control | 24 | class Control | ||
25 | { | 25 | { | ||
26 | public: | 26 | public: | ||
27 | enum class OutputRetention { | 27 | enum class OutputRetention { | ||
28 | Undefined = -1, | ||||
28 | Global = 0, | 29 | Global = 0, | ||
29 | Individual | 30 | Individual = 1, | ||
30 | }; | 31 | }; | ||
31 | 32 | | |||
32 | virtual ~Control() = default; | 33 | virtual ~Control() = default; | ||
33 | | ||||
34 | virtual QString filePath() = 0; | 34 | virtual QString filePath() = 0; | ||
35 | 35 | | |||
36 | static OutputRetention convertVariantToOutputRetention(QVariant variant); | ||||
37 | | ||||
36 | protected: | 38 | protected: | ||
37 | static QString dirPath(); | 39 | static QString dirPath(); | ||
38 | 40 | | |||
39 | private: | 41 | private: | ||
40 | static QString s_dirName; | 42 | static QString s_dirName; | ||
41 | }; | 43 | }; | ||
42 | 44 | | |||
43 | class ControlConfig : public Control | 45 | class ControlConfig : public Control | ||
44 | { | 46 | { | ||
45 | public: | 47 | public: | ||
46 | ControlConfig(KScreen::ConfigPtr config); | 48 | ControlConfig(KScreen::ConfigPtr config); | ||
47 | 49 | | |||
50 | OutputRetention getOutputRetention(const KScreen::OutputPtr &output) const; | ||||
48 | OutputRetention getOutputRetention(const QString &outputId, const QString &outputName) const; | 51 | OutputRetention getOutputRetention(const QString &outputId, const QString &outputName) const; | ||
52 | void setOutputRetention(const KScreen::OutputPtr &output, OutputRetention value); | ||||
49 | void setOutputRetention(const QString &outputId, const QString &outputName, OutputRetention value); | 53 | void setOutputRetention(const QString &outputId, const QString &outputName, OutputRetention value); | ||
50 | 54 | | |||
51 | bool writeFile(); | 55 | bool writeFile(); | ||
52 | 56 | | |||
53 | QString filePath() override; | 57 | QString filePath() override; | ||
54 | static QString filePath(const QString &hash); | 58 | static QString filePath(const QString &hash); | ||
55 | 59 | | |||
56 | private: | 60 | private: | ||
Show All 22 Lines |