Changeset View
Changeset View
Standalone View
Standalone View
common/control.h
Show All 23 Lines | |||||
24 | class Control | 24 | class Control | ||
25 | { | 25 | { | ||
26 | public: | 26 | public: | ||
27 | enum class OutputRetention { | 27 | enum class OutputRetention { | ||
28 | Global = 0, | 28 | Global = 0, | ||
29 | Individual | 29 | Individual | ||
30 | }; | 30 | }; | ||
31 | 31 | | |||
32 | static QMap<QString, OutputRetention> readInOutputRetentionValues(const QString &configId); | 32 | virtual ~Control() = default; | ||
33 | | ||||
33 | static OutputRetention getOutputRetention(const QString &outputId, const QMap<QString, OutputRetention> &retentions); | 34 | static OutputRetention getOutputRetention(const QString &outputId, const QMap<QString, OutputRetention> &retentions); | ||
34 | 35 | | |||
35 | static QString configFilePath(const QString &hash); | 36 | virtual QString filePath() = 0; | ||
36 | static QString outputFilePath(const QString &hash); | | |||
37 | 37 | | |||
38 | private: | 38 | protected: | ||
39 | static QString dirPath(); | 39 | static QString dirPath(); | ||
40 | | ||||
41 | private: | ||||
40 | static QString s_dirName; | 42 | static QString s_dirName; | ||
41 | }; | 43 | }; | ||
42 | 44 | | |||
45 | class ControlConfig : public Control | ||||
46 | { | ||||
47 | public: | ||||
48 | ControlConfig(KScreen::ConfigPtr config); | ||||
49 | | ||||
50 | QMap<QString, OutputRetention> readInOutputRetentionValues(); | ||||
51 | | ||||
52 | QString filePath() override; | ||||
53 | static QString filePath(const QString &hash); | ||||
54 | | ||||
55 | private: | ||||
56 | KScreen::ConfigPtr m_config; | ||||
57 | }; | ||||
58 | | ||||
59 | class ControlOutput : public Control | ||||
60 | { | ||||
61 | public: | ||||
62 | ControlOutput(KScreen::OutputPtr output); | ||||
63 | | ||||
64 | // TODO: scale auto value | ||||
65 | | ||||
66 | QString filePath() override; | ||||
67 | static QString filePath(const QString &hash); | ||||
68 | | ||||
69 | private: | ||||
70 | KScreen::OutputPtr m_output; | ||||
71 | }; | ||||
72 | | ||||
43 | #endif | 73 | #endif |