Changeset View
Changeset View
Standalone View
Standalone View
lib/mpris2/lockscreenwatcher.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Gwenview: an image viewer | ||||
3 | Copyright 2018 Friedrich W. H. Kossebau <kossebau@kde.org> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public License | ||||
7 | as published by the Free Software Foundation; either version 2 | ||||
8 | of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This program is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
13 | GNU General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU General Public License | ||||
16 | along with this program; if not, write to the Free Software | ||||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #ifndef LOCKSCREENWATCHER_H | ||||
21 | #define LOCKSCREENWATCHER_H | ||||
22 | | ||||
23 | // Qt | ||||
24 | #include <QObject> | ||||
25 | | ||||
26 | class OrgFreedesktopScreenSaverInterface; | ||||
27 | class QDBusPendingCallWatcher; | ||||
28 | | ||||
29 | namespace Gwenview | ||||
30 | { | ||||
31 | | ||||
32 | class LockScreenWatcher : public QObject | ||||
33 | { | ||||
34 | Q_OBJECT | ||||
35 | | ||||
36 | public: | ||||
37 | explicit LockScreenWatcher(QObject *parent); | ||||
38 | ~LockScreenWatcher() override; | ||||
39 | | ||||
40 | public: | ||||
41 | bool isLocked() const; | ||||
42 | | ||||
43 | Q_SIGNALS: | ||||
44 | void isLockedChanged(bool locked); | ||||
45 | | ||||
46 | private: | ||||
47 | void onScreenSaverActiveChanged(bool isActive); | ||||
48 | void onActiveQueried(QDBusPendingCallWatcher *watcher); | ||||
49 | void onScreenSaverServiceOwnerChanged(const QString &serviceName, | ||||
50 | const QString &oldOwner, const QString &newOwner); | ||||
51 | void onServiceRegisteredQueried(); | ||||
52 | void onServiceOwnerQueried(); | ||||
53 | | ||||
54 | private: | ||||
55 | OrgFreedesktopScreenSaverInterface *mScreenSaverInterface; | ||||
56 | bool mLocked; | ||||
57 | }; | ||||
58 | | ||||
59 | } | ||||
60 | | ||||
61 | #endif |