Changeset View
Changeset View
Standalone View
Standalone View
plugins/telephony/telephonyplugin.h
Show All 25 Lines | |||||
26 | 26 | | |||
27 | #include <KNotification> | 27 | #include <KNotification> | ||
28 | 28 | | |||
29 | #include <core/kdeconnectplugin.h> | 29 | #include <core/kdeconnectplugin.h> | ||
30 | 30 | | |||
31 | #define PACKET_TYPE_TELEPHONY_REQUEST QStringLiteral("kdeconnect.telephony.request") | 31 | #define PACKET_TYPE_TELEPHONY_REQUEST QStringLiteral("kdeconnect.telephony.request") | ||
32 | #define PACKET_TYPE_SMS_REQUEST QStringLiteral("kdeconnect.sms.request") | 32 | #define PACKET_TYPE_SMS_REQUEST QStringLiteral("kdeconnect.sms.request") | ||
33 | 33 | | |||
34 | #define PACKET_TYPE_TELEPHONY_REQUEST_CONVERSATIONS QStringLiteral("kdeconnect.telephony.request_conversations") | ||||
35 | | ||||
34 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY) | 36 | Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY) | ||
35 | 37 | | |||
36 | class TelephonyPlugin | 38 | class TelephonyPlugin | ||
37 | : public KdeConnectPlugin | 39 | : public KdeConnectPlugin | ||
38 | { | 40 | { | ||
39 | Q_OBJECT | 41 | Q_OBJECT | ||
40 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.telephony") | 42 | Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.telephony") | ||
41 | 43 | | |||
42 | public: | 44 | public: | ||
43 | explicit TelephonyPlugin(QObject* parent, const QVariantList& args); | 45 | explicit TelephonyPlugin(QObject* parent, const QVariantList& args); | ||
44 | 46 | | |||
45 | bool receivePacket(const NetworkPacket& np) override; | 47 | bool receivePacket(const NetworkPacket& np) override; | ||
46 | void connected() override {} | 48 | void connected() override {} | ||
47 | QString dbusPath() const override; | 49 | QString dbusPath() const override; | ||
48 | 50 | | |||
49 | public Q_SLOTS: | 51 | public Q_SLOTS: | ||
50 | Q_SCRIPTABLE void sendSms(const QString& phoneNumber, const QString& messageBody); | 52 | Q_SCRIPTABLE void sendSms(const QString& phoneNumber, const QString& messageBody); | ||
53 | /** | ||||
54 | * Send a request to the remote for all of its conversations | ||||
55 | */ | ||||
56 | Q_SCRIPTABLE void sendAllConversationsRequest(); | ||||
apol: requestAllConversations()? | |||||
51 | 57 | | |||
52 | private Q_SLOTS: | 58 | private Q_SLOTS: | ||
53 | void sendMutePacket(); | 59 | void sendMutePacket(); | ||
54 | void showSendSmsDialog(); | 60 | void showSendSmsDialog(); | ||
55 | 61 | | |||
56 | private: | 62 | private: | ||
57 | KNotification* createNotification(const NetworkPacket& np); | 63 | KNotification* createNotification(const NetworkPacket& np); | ||
58 | 64 | | |||
59 | QDBusInterface m_telepathyInterface; | 65 | QDBusInterface m_telepathyInterface; | ||
60 | }; | 66 | }; | ||
61 | 67 | | |||
62 | #endif | 68 | #endif |
requestAllConversations()?