Changeset View
Changeset View
Standalone View
Standalone View
kscreensaversettings.h
Show All 22 Lines | |||||
23 | 23 | | |||
24 | class QAction; | 24 | class QAction; | ||
25 | class KActionCollection; | 25 | class KActionCollection; | ||
26 | 26 | | |||
27 | class KScreenSaverSettings : public KScreenSaverSettingsBase | 27 | class KScreenSaverSettings : public KScreenSaverSettingsBase | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) | 30 | Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) | ||
31 | Q_PROPERTY(int wallpaperPluginIndex READ wallpaperPluginIndex WRITE setWallpaperPluginIndex) | ||||
31 | public: | 32 | public: | ||
33 | struct WallpaperInfo { | ||||
34 | QString name; | ||||
35 | QString id; | ||||
36 | }; | ||||
37 | | ||||
32 | static QList<QKeySequence> defaultShortcuts(); | 38 | static QList<QKeySequence> defaultShortcuts(); | ||
39 | static QString defaultWallpaperPlugin(); | ||||
33 | 40 | | |||
34 | KScreenSaverSettings(QObject *parent = nullptr); | 41 | KScreenSaverSettings(QObject *parent = nullptr); | ||
35 | ~KScreenSaverSettings() override; | 42 | ~KScreenSaverSettings() override; | ||
36 | 43 | | |||
44 | QVector<WallpaperInfo> availableWallpaperPlugins() const; | ||||
45 | int wallpaperPluginIndex() const; | ||||
46 | void setWallpaperPluginIndex(int index); | ||||
47 | | ||||
37 | QKeySequence shortcut() const; | 48 | QKeySequence shortcut() const; | ||
38 | void setShortcut(const QKeySequence &sequence); | 49 | void setShortcut(const QKeySequence &sequence); | ||
39 | 50 | | |||
40 | private: | 51 | private: | ||
52 | int indexFromWallpaperPluginId(const QString &id) const; | ||||
53 | | ||||
54 | QVector<WallpaperInfo> m_availableWallpaperPlugins; | ||||
41 | KActionCollection *m_actionCollection; | 55 | KActionCollection *m_actionCollection; | ||
42 | QAction *m_lockAction; | 56 | QAction *m_lockAction; | ||
43 | }; | 57 | }; | ||
44 | 58 | | |||
45 | #endif // KSCREENSAVERSETTINGS_H | 59 | #endif // KSCREENSAVERSETTINGS_H |