Changeset View
Changeset View
Standalone View
Standalone View
core/kdeconnectplugin.h
Show All 20 Lines | |||||
21 | #ifndef KDECONNECTPLUGIN_H | 21 | #ifndef KDECONNECTPLUGIN_H | ||
22 | #define KDECONNECTPLUGIN_H | 22 | #define KDECONNECTPLUGIN_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QVariantList> | 25 | #include <QVariantList> | ||
26 | 26 | | |||
27 | #include "kdeconnectcore_export.h" | 27 | #include "kdeconnectcore_export.h" | ||
28 | #include "kdeconnectpluginconfig.h" | 28 | #include "kdeconnectpluginconfig.h" | ||
29 | #include "networkpackage.h" | 29 | #include "networkpacket.h" | ||
30 | #include "device.h" | 30 | #include "device.h" | ||
31 | 31 | | |||
32 | struct KdeConnectPluginPrivate; | 32 | struct KdeConnectPluginPrivate; | ||
33 | 33 | | |||
34 | class KDECONNECTCORE_EXPORT KdeConnectPlugin | 34 | class KDECONNECTCORE_EXPORT KdeConnectPlugin | ||
35 | : public QObject | 35 | : public QObject | ||
36 | { | 36 | { | ||
37 | Q_OBJECT | 37 | Q_OBJECT | ||
38 | 38 | | |||
39 | public: | 39 | public: | ||
40 | KdeConnectPlugin(QObject* parent, const QVariantList& args); | 40 | KdeConnectPlugin(QObject* parent, const QVariantList& args); | ||
41 | ~KdeConnectPlugin() override; | 41 | ~KdeConnectPlugin() override; | ||
42 | 42 | | |||
43 | const Device* device(); | 43 | const Device* device(); | ||
44 | Device const* device() const; | 44 | Device const* device() const; | ||
45 | 45 | | |||
46 | bool sendPackage(NetworkPackage& np) const; | 46 | bool sendPacket(NetworkPacket& np) const; | ||
47 | 47 | | |||
48 | KdeConnectPluginConfig* config() const; | 48 | KdeConnectPluginConfig* config() const; | ||
49 | 49 | | |||
50 | virtual QString dbusPath() const; | 50 | virtual QString dbusPath() const; | ||
51 | 51 | | |||
52 | public Q_SLOTS: | 52 | public Q_SLOTS: | ||
53 | /** | 53 | /** | ||
54 | * Returns true if it has handled the package in some way | 54 | * Returns true if it has handled the packet in some way | ||
55 | * device.sendPackage can be used to send an answer back to the device | 55 | * device.sendPacket can be used to send an answer back to the device | ||
56 | */ | 56 | */ | ||
57 | virtual bool receivePackage(const NetworkPackage& np) = 0; | 57 | virtual bool receivePacket(const NetworkPacket& np) = 0; | ||
58 | 58 | | |||
59 | /** | 59 | /** | ||
60 | * This method will be called when a device is connected to this computer. | 60 | * This method will be called when a device is connected to this computer. | ||
61 | * The plugin could be loaded already, but there is no guarantee we will be able to reach the device until this is called. | 61 | * The plugin could be loaded already, but there is no guarantee we will be able to reach the device until this is called. | ||
62 | */ | 62 | */ | ||
63 | virtual void connected() = 0; | 63 | virtual void connected() = 0; | ||
64 | 64 | | |||
65 | private: | 65 | private: | ||
66 | QScopedPointer<KdeConnectPluginPrivate> d; | 66 | QScopedPointer<KdeConnectPluginPrivate> d; | ||
67 | 67 | | |||
68 | }; | 68 | }; | ||
69 | 69 | | |||
70 | #endif | 70 | #endif |