Changeset View
Changeset View
Standalone View
Standalone View
kcm/config_handler.h
Show All 26 Lines | |||||
27 | class ConfigHandler : public QObject | 27 | class ConfigHandler : public QObject | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | public: | 30 | public: | ||
31 | explicit ConfigHandler (QObject *parent = nullptr); | 31 | explicit ConfigHandler (QObject *parent = nullptr); | ||
32 | ~ConfigHandler() override = default; | 32 | ~ConfigHandler() override = default; | ||
33 | 33 | | |||
34 | void setConfig(KScreen::ConfigPtr config); | 34 | void setConfig(KScreen::ConfigPtr config); | ||
35 | void updateInitialConfig(); | 35 | void updateInitialData(); | ||
36 | 36 | | |||
37 | OutputModel* outputModel() const { | 37 | OutputModel* outputModel() const { | ||
38 | return m_outputs; | 38 | return m_outputs; | ||
39 | } | 39 | } | ||
40 | 40 | | |||
41 | QSize normalizeScreen(); | 41 | QSize normalizeScreen(); | ||
42 | 42 | | |||
43 | KScreen::ConfigPtr config() const { | 43 | KScreen::ConfigPtr config() const { | ||
44 | return m_config; | 44 | return m_config; | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | int retention() const; | 47 | int retention() const; | ||
48 | void setRetention(int retention); | 48 | void setRetention(int retention); | ||
49 | 49 | | |||
50 | qreal scale(const KScreen::OutputPtr &output) const; | 50 | qreal scale(const KScreen::OutputPtr &output) const; | ||
51 | void setScale(KScreen::OutputPtr &output, qreal scale); | 51 | void setScale(KScreen::OutputPtr &output, qreal scale); | ||
52 | 52 | | |||
53 | KScreen::OutputPtr replicationSource(const KScreen::OutputPtr &output) const; | 53 | KScreen::OutputPtr replicationSource(const KScreen::OutputPtr &output) const; | ||
54 | void setReplicationSource(KScreen::OutputPtr &output, const KScreen::OutputPtr &source); | 54 | void setReplicationSource(KScreen::OutputPtr &output, const KScreen::OutputPtr &source); | ||
55 | 55 | | |||
56 | bool autoRotate(const KScreen::OutputPtr &output) const; | ||||
57 | void setAutoRotate(KScreen::OutputPtr &output, bool autoRotate); | ||||
58 | bool autoRotateOnlyInTabletMode(const KScreen::OutputPtr &output) const; | ||||
59 | void setAutoRotateOnlyInTabletMode(KScreen::OutputPtr &output, bool value); | ||||
60 | | ||||
56 | void writeControl(); | 61 | void writeControl(); | ||
57 | 62 | | |||
58 | void checkNeedsSave(); | 63 | void checkNeedsSave(); | ||
59 | 64 | | |||
60 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
61 | void outputModelChanged(); | 66 | void outputModelChanged(); | ||
62 | void changed(); | 67 | void changed(); | ||
63 | void screenNormalizationUpdate(bool normalized); | 68 | void screenNormalizationUpdate(bool normalized); | ||
Show All 10 Lines | 73 | private: | |||
74 | void initOutput(const KScreen::OutputPtr &output); | 79 | void initOutput(const KScreen::OutputPtr &output); | ||
75 | void resetScale(const KScreen::OutputPtr &output); | 80 | void resetScale(const KScreen::OutputPtr &output); | ||
76 | 81 | | |||
77 | KScreen::ConfigPtr m_config = nullptr; | 82 | KScreen::ConfigPtr m_config = nullptr; | ||
78 | KScreen::ConfigPtr m_initialConfig; | 83 | KScreen::ConfigPtr m_initialConfig; | ||
79 | OutputModel *m_outputs = nullptr; | 84 | OutputModel *m_outputs = nullptr; | ||
80 | 85 | | |||
81 | std::unique_ptr<ControlConfig> m_control; | 86 | std::unique_ptr<ControlConfig> m_control; | ||
87 | std::unique_ptr<ControlConfig> m_initialControl; | ||||
82 | Control::OutputRetention m_initialRetention = Control::OutputRetention:: | 88 | Control::OutputRetention m_initialRetention = Control::OutputRetention:: | ||
83 | Undefined; | 89 | Undefined; | ||
84 | QSize m_lastNormalizedScreenSize; | 90 | QSize m_lastNormalizedScreenSize; | ||
85 | }; | 91 | }; |