Changeset View
Changeset View
Standalone View
Standalone View
common/control.h
Show All 26 Lines | 26 | public: | |||
---|---|---|---|---|---|
27 | enum class OutputRetention { | 27 | enum class OutputRetention { | ||
28 | Undefined = -1, | 28 | Undefined = -1, | ||
29 | Global = 0, | 29 | Global = 0, | ||
30 | Individual = 1, | 30 | Individual = 1, | ||
31 | }; | 31 | }; | ||
32 | 32 | | |||
33 | virtual ~Control() = default; | 33 | virtual ~Control() = default; | ||
34 | 34 | | |||
35 | static OutputRetention getOutputRetention(const QString &outputId, const QMap<QString, OutputRetention> &retentions); | | |||
36 | | ||||
37 | virtual QString filePath() = 0; | 35 | virtual QString filePath() = 0; | ||
38 | 36 | | |||
39 | protected: | 37 | protected: | ||
40 | static QString dirPath(); | 38 | static QString dirPath(); | ||
41 | static OutputRetention convertVariantToOutputRetention(QVariant variant); | 39 | static OutputRetention convertVariantToOutputRetention(QVariant variant); | ||
42 | 40 | | |||
43 | private: | 41 | private: | ||
44 | static QString s_dirName; | 42 | static QString s_dirName; | ||
45 | }; | 43 | }; | ||
46 | 44 | | |||
47 | class ControlConfig : public Control | 45 | class ControlConfig : public Control | ||
48 | { | 46 | { | ||
49 | public: | 47 | public: | ||
50 | ControlConfig(KScreen::ConfigPtr config); | 48 | ControlConfig(KScreen::ConfigPtr config); | ||
51 | 49 | | |||
52 | QMap<QString, OutputRetention> readInOutputRetentionValues(); | 50 | OutputRetention getOutputRetention(const KScreen::OutputPtr &output) const; | ||
51 | OutputRetention getOutputRetention(const QString &outputId, const QString &outputName) const; | ||||
53 | 52 | | |||
54 | QString filePath() override; | 53 | QString filePath() override; | ||
55 | static QString filePath(const QString &hash); | 54 | static QString filePath(const QString &hash); | ||
56 | 55 | | |||
57 | private: | 56 | private: | ||
58 | KScreen::ConfigPtr m_config; | 57 | KScreen::ConfigPtr m_config; | ||
58 | QVariantList m_info; | ||||
59 | QStringList m_duplicateOutputIds; | ||||
59 | }; | 60 | }; | ||
60 | 61 | | |||
61 | class ControlOutput : public Control | 62 | class ControlOutput : public Control | ||
62 | { | 63 | { | ||
63 | public: | 64 | public: | ||
64 | ControlOutput(KScreen::OutputPtr output); | 65 | ControlOutput(KScreen::OutputPtr output); | ||
65 | 66 | | |||
66 | // TODO: scale auto value | 67 | // TODO: scale auto value | ||
Show All 9 Lines |