Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/fonts.h
Show All 25 Lines | |||||
26 | 26 | | |||
27 | #ifndef FONTS_H | 27 | #ifndef FONTS_H | ||
28 | #define FONTS_H | 28 | #define FONTS_H | ||
29 | 29 | | |||
30 | #include <config-X11.h> | 30 | #include <config-X11.h> | ||
31 | #include <QAbstractItemModel> | 31 | #include <QAbstractItemModel> | ||
32 | #include <QStandardItemModel> | 32 | #include <QStandardItemModel> | ||
33 | 33 | | |||
34 | #include <KQuickAddons/ConfigModule> | 34 | #include <KQuickAddons/ManagedConfigModule> | ||
35 | 35 | | |||
36 | #include "kxftconfig.h" | 36 | #include "kxftconfig.h" | ||
37 | 37 | | |||
38 | class FontsSettings; | 38 | class FontsSettings; | ||
39 | 39 | | |||
40 | class FontAASettings : public QObject | 40 | class FontAASettings : public QObject | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 126 | private: | |||
129 | QStandardItemModel *m_subPixelOptionsModel; | 129 | QStandardItemModel *m_subPixelOptionsModel; | ||
130 | QStandardItemModel *m_hintingOptionsModel; | 130 | QStandardItemModel *m_hintingOptionsModel; | ||
131 | #endif | 131 | #endif | ||
132 | }; | 132 | }; | ||
133 | 133 | | |||
134 | /** | 134 | /** | ||
135 | * The Desktop/fonts tab in kcontrol. | 135 | * The Desktop/fonts tab in kcontrol. | ||
136 | */ | 136 | */ | ||
137 | class KFonts : public KQuickAddons::ConfigModule | 137 | class KFonts : public KQuickAddons::ManagedConfigModule | ||
138 | { | 138 | { | ||
139 | Q_OBJECT | 139 | Q_OBJECT | ||
140 | Q_PROPERTY(FontsSettings *fontsSettings READ fontsSettings CONSTANT) | 140 | Q_PROPERTY(FontsSettings *fontsSettings READ fontsSettings CONSTANT) | ||
141 | Q_PROPERTY(QObject *fontAASettings READ fontAASettings CONSTANT) | 141 | Q_PROPERTY(QObject *fontAASettings READ fontAASettings CONSTANT) | ||
142 | 142 | | |||
143 | public: | 143 | public: | ||
144 | KFonts(QObject *parent, const QVariantList &); | 144 | KFonts(QObject *parent, const QVariantList &); | ||
145 | ~KFonts() override; | 145 | ~KFonts() override; | ||
146 | 146 | | |||
147 | FontsSettings *fontsSettings() const; | 147 | FontsSettings *fontsSettings() const; | ||
148 | 148 | | |||
149 | QObject* fontAASettings() { return m_fontAASettings; } | 149 | QObject* fontAASettings() { return m_fontAASettings; } | ||
150 | 150 | | |||
151 | public Q_SLOTS: | 151 | public Q_SLOTS: | ||
152 | void load() override; | 152 | void load() override; | ||
153 | void save() override; | 153 | void save() override; | ||
154 | void defaults() override; | 154 | void defaults() override; | ||
155 | Q_INVOKABLE void adjustAllFonts(); | 155 | Q_INVOKABLE void adjustAllFonts(); | ||
156 | 156 | | |||
157 | Q_SIGNALS: | 157 | Q_SIGNALS: | ||
158 | void fontsHaveChanged(); | 158 | void fontsHaveChanged(); | ||
159 | 159 | | |||
160 | private: | 160 | private: | ||
161 | void updateNeedsSave(); | 161 | bool isSaveNeeded() const override ; | ||
162 | QFont applyFontDiff(const QFont &fnt, const QFont &newFont, int fontDiffFlags); | 162 | QFont applyFontDiff(const QFont &fnt, const QFont &newFont, int fontDiffFlags); | ||
163 | void setNearestExistingFonts(); | 163 | void setNearestExistingFonts(); | ||
164 | 164 | | |||
165 | FontsSettings *m_settings; | 165 | FontsSettings *m_settings; | ||
166 | 166 | | |||
167 | FontAASettings *m_fontAASettings; | 167 | FontAASettings *m_fontAASettings; | ||
168 | }; | 168 | }; | ||
169 | 169 | | |||
170 | #endif | 170 | #endif | ||
171 | 171 | |