Changeset View
Changeset View
Standalone View
Standalone View
plugins/remotekeyboard/remotekeyboardplugin.h
Show All 24 Lines | |||||
25 | #include <QDBusInterface> | 25 | #include <QDBusInterface> | ||
26 | #include <QLoggingCategory> | 26 | #include <QLoggingCategory> | ||
27 | #include <QVariantMap> | 27 | #include <QVariantMap> | ||
28 | 28 | | |||
29 | struct FakeKey; | 29 | struct FakeKey; | ||
30 | 30 | | |||
31 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTEKEYBOARD); | 31 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTEKEYBOARD); | ||
32 | 32 | | |||
33 | #define PACKAGE_TYPE_MOUSEPAD_REQUEST QLatin1String("kdeconnect.mousepad.request") | 33 | #define PACKET_TYPE_MOUSEPAD_REQUEST QLatin1String("kdeconnect.mousepad.request") | ||
34 | #define PACKAGE_TYPE_MOUSEPAD_ECHO QLatin1String("kdeconnect.mousepad.echo") | 34 | #define PACKET_TYPE_MOUSEPAD_ECHO QLatin1String("kdeconnect.mousepad.echo") | ||
35 | #define PACKAGE_TYPE_MOUSEPAD_KEYBOARDSTATE QLatin1String("kdeconnect.mousepad.keyboardstate") | 35 | #define PACKET_TYPE_MOUSEPAD_KEYBOARDSTATE QLatin1String("kdeconnect.mousepad.keyboardstate") | ||
36 | 36 | | |||
37 | class RemoteKeyboardPlugin | 37 | class RemoteKeyboardPlugin | ||
38 | : public KdeConnectPlugin | 38 | : public KdeConnectPlugin | ||
39 | { | 39 | { | ||
40 | Q_OBJECT | 40 | Q_OBJECT | ||
41 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotekeyboard") | 41 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotekeyboard") | ||
42 | Q_PROPERTY(bool remoteState READ remoteState NOTIFY remoteStateChanged) | 42 | Q_PROPERTY(bool remoteState READ remoteState NOTIFY remoteStateChanged) | ||
43 | 43 | | |||
44 | private: | 44 | private: | ||
45 | bool m_remoteState; | 45 | bool m_remoteState; | ||
46 | 46 | | |||
47 | public: | 47 | public: | ||
48 | explicit RemoteKeyboardPlugin(QObject* parent, const QVariantList& args); | 48 | explicit RemoteKeyboardPlugin(QObject* parent, const QVariantList& args); | ||
49 | ~RemoteKeyboardPlugin() override; | 49 | ~RemoteKeyboardPlugin() override; | ||
50 | 50 | | |||
51 | bool receivePackage(const NetworkPackage& np) override; | 51 | bool receivePacket(const NetworkPacket& np) override; | ||
52 | QString dbusPath() const override; | 52 | QString dbusPath() const override; | ||
53 | void connected() override; | 53 | void connected() override; | ||
54 | 54 | | |||
55 | bool remoteState() const { | 55 | bool remoteState() const { | ||
56 | return m_remoteState; | 56 | return m_remoteState; | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | Q_SCRIPTABLE void sendKeyPress(const QString& key, int specialKey = 0, | 59 | Q_SCRIPTABLE void sendKeyPress(const QString& key, int specialKey = 0, | ||
Show All 14 Lines |