Changeset View
Changeset View
Standalone View
Standalone View
plugins/remotecommands/remotecommandsplugin.h
Show All 35 Lines | 35 | { | |||
---|---|---|---|---|---|
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotecommands") | 37 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.remotecommands") | ||
38 | Q_PROPERTY(QByteArray commands READ commands NOTIFY commandsChanged) | 38 | Q_PROPERTY(QByteArray commands READ commands NOTIFY commandsChanged) | ||
39 | 39 | | |||
40 | public: | 40 | public: | ||
41 | explicit RemoteCommandsPlugin(QObject *parent, const QVariantList &args); | 41 | explicit RemoteCommandsPlugin(QObject *parent, const QVariantList &args); | ||
42 | ~RemoteCommandsPlugin() override; | 42 | ~RemoteCommandsPlugin() override; | ||
43 | 43 | | |||
44 | Q_INVOKABLE void triggerCommand(const QString &key); | 44 | Q_SCRIPTABLE void triggerCommand(const QString &key); | ||
45 | QByteArray commands() const { return m_commands; } | 45 | QByteArray commands() const { return m_commands; } | ||
46 | 46 | | |||
47 | bool receivePackage(const NetworkPackage& np) override; | ||||
48 | void connected() override; | ||||
49 | | ||||
47 | Q_SIGNALS: | 50 | Q_SIGNALS: | ||
48 | void commandsChanged(const QByteArray& commands); | 51 | void commandsChanged(const QByteArray& commands); | ||
49 | 52 | | |||
50 | private: | 53 | private: | ||
51 | bool receivePackage(const NetworkPackage& np) override; | | |||
52 | void connected() override; | | |||
53 | | ||||
54 | QString dbusPath() const; | 54 | QString dbusPath() const; | ||
55 | void setCommands(const QByteArray &commands); | 55 | void setCommands(const QByteArray &commands); | ||
56 | 56 | | |||
57 | QByteArray m_commands; | 57 | QByteArray m_commands; | ||
58 | }; | 58 | }; | ||
59 | 59 | | |||
60 | #endif | 60 | #endif |