Changeset View
Changeset View
Standalone View
Standalone View
plugins/lockdevice/lockdeviceplugin.h
Show All 21 Lines | |||||
22 | #define LOCKDEVICEPLUGIN_H | 22 | #define LOCKDEVICEPLUGIN_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | 25 | | |||
26 | #include <core/kdeconnectplugin.h> | 26 | #include <core/kdeconnectplugin.h> | ||
27 | 27 | | |||
28 | class OrgFreedesktopScreenSaverInterface; | 28 | class OrgFreedesktopScreenSaverInterface; | ||
29 | 29 | | |||
30 | #define PACKAGE_TYPE_LOCK QStringLiteral("kdeconnect.lock") | 30 | #define PACKET_TYPE_LOCK QStringLiteral("kdeconnect.lock") | ||
31 | #define PACKAGE_TYPE_LOCK_REQUEST QStringLiteral("kdeconnect.lock.request") | 31 | #define PACKET_TYPE_LOCK_REQUEST QStringLiteral("kdeconnect.lock.request") | ||
32 | 32 | | |||
33 | class Q_DECL_EXPORT LockDevicePlugin | 33 | class Q_DECL_EXPORT LockDevicePlugin | ||
34 | : public KdeConnectPlugin | 34 | : public KdeConnectPlugin | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.lockdevice") | 37 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.lockdevice") | ||
38 | Q_PROPERTY(bool isLocked READ isLocked WRITE setLocked NOTIFY lockedChanged) | 38 | Q_PROPERTY(bool isLocked READ isLocked WRITE setLocked NOTIFY lockedChanged) | ||
39 | 39 | | |||
40 | public: | 40 | public: | ||
41 | explicit LockDevicePlugin(QObject* parent, const QVariantList &args); | 41 | explicit LockDevicePlugin(QObject* parent, const QVariantList &args); | ||
42 | ~LockDevicePlugin() override; | 42 | ~LockDevicePlugin() override; | ||
43 | 43 | | |||
44 | bool isLocked() const; | 44 | bool isLocked() const; | ||
45 | void setLocked(bool b); | 45 | void setLocked(bool b); | ||
46 | 46 | | |||
47 | QString dbusPath() const override; | 47 | QString dbusPath() const override; | ||
48 | void connected() override; | 48 | void connected() override; | ||
49 | bool receivePackage(const NetworkPackage & np) override; | 49 | bool receivePacket(const NetworkPacket & np) override; | ||
50 | 50 | | |||
51 | Q_SIGNALS: | 51 | Q_SIGNALS: | ||
52 | void lockedChanged(bool locked); | 52 | void lockedChanged(bool locked); | ||
53 | 53 | | |||
54 | private: | 54 | private: | ||
55 | bool m_remoteLocked; | 55 | bool m_remoteLocked; | ||
56 | 56 | | |||
57 | OrgFreedesktopScreenSaverInterface* iface(); | 57 | OrgFreedesktopScreenSaverInterface* iface(); | ||
58 | 58 | | |||
59 | OrgFreedesktopScreenSaverInterface* m_iface; | 59 | OrgFreedesktopScreenSaverInterface* m_iface; | ||
60 | }; | 60 | }; | ||
61 | 61 | | |||
62 | #endif | 62 | #endif |