Changeset View
Changeset View
Standalone View
Standalone View
screenlockerwatcher.h
Show All 19 Lines | |||||
20 | #ifndef KWIN_SCREENLOCKERWATCHER_H | 20 | #ifndef KWIN_SCREENLOCKERWATCHER_H | ||
21 | #define KWIN_SCREENLOCKERWATCHER_H | 21 | #define KWIN_SCREENLOCKERWATCHER_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | 24 | | |||
25 | #include <kwinglobals.h> | 25 | #include <kwinglobals.h> | ||
26 | 26 | | |||
27 | class OrgFreedesktopScreenSaverInterface; | 27 | class OrgFreedesktopScreenSaverInterface; | ||
28 | class OrgKdeScreensaverInterface; | ||||
28 | class QDBusServiceWatcher; | 29 | class QDBusServiceWatcher; | ||
29 | class QDBusPendingCallWatcher; | 30 | class QDBusPendingCallWatcher; | ||
30 | 31 | | |||
31 | namespace KWin | 32 | namespace KWin | ||
32 | { | 33 | { | ||
33 | 34 | | |||
34 | class KWIN_EXPORT ScreenLockerWatcher : public QObject | 35 | class KWIN_EXPORT ScreenLockerWatcher : public QObject | ||
35 | { | 36 | { | ||
36 | Q_OBJECT | 37 | Q_OBJECT | ||
37 | public: | 38 | public: | ||
38 | virtual ~ScreenLockerWatcher(); | 39 | virtual ~ScreenLockerWatcher(); | ||
39 | bool isLocked() const { | 40 | bool isLocked() const { | ||
40 | return m_locked; | 41 | return m_locked; | ||
41 | } | 42 | } | ||
42 | Q_SIGNALS: | 43 | Q_SIGNALS: | ||
43 | void locked(bool locked); | 44 | void locked(bool locked); | ||
45 | void aboutToLock(); | ||||
44 | private Q_SLOTS: | 46 | private Q_SLOTS: | ||
45 | void setLocked(bool activated); | 47 | void setLocked(bool activated); | ||
46 | void activeQueried(QDBusPendingCallWatcher *watcher); | 48 | void activeQueried(QDBusPendingCallWatcher *watcher); | ||
47 | void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner); | 49 | void serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner); | ||
48 | void serviceRegisteredQueried(); | 50 | void serviceRegisteredQueried(); | ||
49 | void serviceOwnerQueried(); | 51 | void serviceOwnerQueried(); | ||
50 | private: | 52 | private: | ||
51 | void initialize(); | 53 | void initialize(); | ||
52 | OrgFreedesktopScreenSaverInterface *m_interface; | 54 | OrgFreedesktopScreenSaverInterface *m_interface = nullptr; | ||
55 | OrgKdeScreensaverInterface *m_kdeInterface = nullptr; | ||||
53 | QDBusServiceWatcher *m_serviceWatcher; | 56 | QDBusServiceWatcher *m_serviceWatcher; | ||
54 | bool m_locked; | 57 | bool m_locked; | ||
55 | 58 | | |||
56 | KWIN_SINGLETON(ScreenLockerWatcher) | 59 | KWIN_SINGLETON(ScreenLockerWatcher) | ||
57 | }; | 60 | }; | ||
58 | } | 61 | } | ||
59 | 62 | | |||
60 | #endif | 63 | #endif |