Changeset View
Changeset View
Standalone View
Standalone View
kcm/kcm.h
Show All 21 Lines | |||||
22 | #include <KCModule> | 22 | #include <KCModule> | ||
23 | #include <KPackage/Package> | 23 | #include <KPackage/Package> | ||
24 | 24 | | |||
25 | class QQuickView; | 25 | class QQuickView; | ||
26 | class QStandardItemModel; | 26 | class QStandardItemModel; | ||
27 | class KActionCollection; | 27 | class KActionCollection; | ||
28 | class ScreenLockerKcmForm; | 28 | class ScreenLockerKcmForm; | ||
29 | 29 | | |||
30 | namespace ScreenLocker | ||||
31 | { | ||||
32 | class WallpaperIntegration; | ||||
33 | } | ||||
34 | | ||||
35 | namespace KDeclarative | ||||
36 | { | ||||
37 | class ConfigPropertyMap; | ||||
38 | } | ||||
39 | | ||||
30 | class ScreenLockerKcm : public KCModule | 40 | class ScreenLockerKcm : public KCModule | ||
31 | { | 41 | { | ||
32 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | Q_PROPERTY(KDeclarative::ConfigPropertyMap *wallpaperConfiguration READ wallpaperConfiguration NOTIFY wallpaperConfigurationChanged) | ||||
44 | Q_PROPERTY(QString currentWallpaper READ currentWallpaper NOTIFY currentWallpaperChanged) | ||||
33 | 45 | | |||
34 | public: | 46 | public: | ||
35 | enum Roles { | 47 | enum Roles { | ||
36 | PluginNameRole = Qt::UserRole +1, | 48 | PluginNameRole = Qt::UserRole +1, | ||
37 | ScreenhotRole | 49 | ScreenhotRole | ||
38 | }; | 50 | }; | ||
39 | explicit ScreenLockerKcm(QWidget *parent = nullptr, const QVariantList& args = QVariantList()); | 51 | explicit ScreenLockerKcm(QWidget *parent = nullptr, const QVariantList& args = QVariantList()); | ||
40 | 52 | | |||
53 | KDeclarative::ConfigPropertyMap *wallpaperConfiguration() const; | ||||
54 | QString currentWallpaper() const; | ||||
55 | | ||||
56 | bool eventFilter(QObject *watched, QEvent *event) override; | ||||
57 | | ||||
41 | public Q_SLOTS: | 58 | public Q_SLOTS: | ||
42 | void load() Q_DECL_OVERRIDE; | 59 | void load() Q_DECL_OVERRIDE; | ||
43 | void save() Q_DECL_OVERRIDE; | 60 | void save() Q_DECL_OVERRIDE; | ||
44 | void defaults() Q_DECL_OVERRIDE; | 61 | void defaults() Q_DECL_OVERRIDE; | ||
45 | void test(const QString &plugin); | 62 | void test(const QString &plugin); | ||
46 | 63 | | |||
64 | Q_SIGNALS: | ||||
65 | void wallpaperConfigurationChanged(); | ||||
66 | void currentWallpaperChanged(); | ||||
67 | | ||||
47 | private: | 68 | private: | ||
48 | void shortcutChanged(const QKeySequence &key); | 69 | void shortcutChanged(const QKeySequence &key); | ||
49 | bool shouldSaveShortcut(); | 70 | bool shouldSaveShortcut(); | ||
71 | void loadWallpapers(); | ||||
72 | void selectWallpaper(const QString &pluginId); | ||||
73 | void loadWallpaperConfig(); | ||||
50 | KPackage::Package m_package; | 74 | KPackage::Package m_package; | ||
51 | KActionCollection *m_actionCollection; | 75 | KActionCollection *m_actionCollection; | ||
52 | ScreenLockerKcmForm *m_ui; | 76 | ScreenLockerKcmForm *m_ui; | ||
77 | ScreenLocker::WallpaperIntegration *m_wallpaperIntegration = nullptr; | ||||
53 | }; | 78 | }; |