Changeset View
Changeset View
Standalone View
Standalone View
plugins/battery/batteryplugin.h
Show All 18 Lines | |||||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef BATTERYPLUGIN_H | 21 | #ifndef BATTERYPLUGIN_H | ||
22 | #define BATTERYPLUGIN_H | 22 | #define BATTERYPLUGIN_H | ||
23 | 23 | | |||
24 | #include <QLoggingCategory> | 24 | #include <QLoggingCategory> | ||
25 | #include <core/kdeconnectplugin.h> | 25 | #include <core/kdeconnectplugin.h> | ||
26 | 26 | | |||
27 | #define PACKAGE_TYPE_BATTERY_REQUEST QStringLiteral("kdeconnect.battery.request") | 27 | #define PACKET_TYPE_BATTERY_REQUEST QStringLiteral("kdeconnect.battery.request") | ||
28 | 28 | | |||
29 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BATTERY) | 29 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BATTERY) | ||
30 | class BatteryDbusInterface; | 30 | class BatteryDbusInterface; | ||
31 | 31 | | |||
32 | class BatteryPlugin | 32 | class BatteryPlugin | ||
33 | : public KdeConnectPlugin | 33 | : public KdeConnectPlugin | ||
34 | { | 34 | { | ||
35 | Q_OBJECT | 35 | Q_OBJECT | ||
36 | 36 | | |||
37 | public: | 37 | public: | ||
38 | explicit BatteryPlugin(QObject* parent, const QVariantList& args); | 38 | explicit BatteryPlugin(QObject* parent, const QVariantList& args); | ||
39 | ~BatteryPlugin() override; | 39 | ~BatteryPlugin() override; | ||
40 | 40 | | |||
41 | bool receivePackage(const NetworkPackage& np) override; | 41 | bool receivePacket(const NetworkPacket& np) override; | ||
42 | void connected() override; | 42 | void connected() override; | ||
43 | 43 | | |||
44 | private: | 44 | private: | ||
45 | // Keep these values in sync with THRESHOLD* constants in | 45 | // Keep these values in sync with THRESHOLD* constants in | ||
46 | // kdeconnect-android:BatteryPlugin.java | 46 | // kdeconnect-android:BatteryPlugin.java | ||
47 | // see README for their meaning | 47 | // see README for their meaning | ||
48 | enum ThresholdBatteryEvent { | 48 | enum ThresholdBatteryEvent { | ||
49 | ThresholdNone = 0, | 49 | ThresholdNone = 0, | ||
50 | ThresholdBatteryLow = 1 | 50 | ThresholdBatteryLow = 1 | ||
51 | }; | 51 | }; | ||
52 | 52 | | |||
53 | BatteryDbusInterface* batteryDbusInterface; | 53 | BatteryDbusInterface* batteryDbusInterface; | ||
54 | }; | 54 | }; | ||
55 | 55 | | |||
56 | #endif | 56 | #endif |