Changeset View
Changeset View
Standalone View
Standalone View
interfaces/dbusinterfaces.h
Show All 29 Lines | |||||
30 | #include "interfaces/devicefindmyphoneinterface.h" | 30 | #include "interfaces/devicefindmyphoneinterface.h" | ||
31 | #include "interfaces/devicenotificationsinterface.h" | 31 | #include "interfaces/devicenotificationsinterface.h" | ||
32 | #include "interfaces/notificationinterface.h" | 32 | #include "interfaces/notificationinterface.h" | ||
33 | #include "interfaces/mprisremoteinterface.h" | 33 | #include "interfaces/mprisremoteinterface.h" | ||
34 | #include "interfaces/remotecontrolinterface.h" | 34 | #include "interfaces/remotecontrolinterface.h" | ||
35 | #include "interfaces/lockdeviceinterface.h" | 35 | #include "interfaces/lockdeviceinterface.h" | ||
36 | #include "interfaces/remotecommandsinterface.h" | 36 | #include "interfaces/remotecommandsinterface.h" | ||
37 | #include "interfaces/remotekeyboardinterface.h" | 37 | #include "interfaces/remotekeyboardinterface.h" | ||
38 | #include "interfaces/telephonyinterface.h" | 38 | #include "interfaces/smsinterface.h" | ||
39 | #include "interfaces/conversationsinterface.h" | 39 | #include "interfaces/conversationsinterface.h" | ||
40 | 40 | | |||
41 | /** | 41 | /** | ||
42 | * Using these "proxy" classes just in case we need to rename the | 42 | * Using these "proxy" classes just in case we need to rename the | ||
43 | * interface, so we can change the class name in a single place. | 43 | * interface, so we can change the class name in a single place. | ||
44 | */ | 44 | */ | ||
45 | class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface | 45 | class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface | ||
46 | : public OrgKdeKdeconnectDaemonInterface | 46 | : public OrgKdeKdeconnectDaemonInterface | ||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 203 | { | |||
205 | Q_PROPERTY(bool remoteState READ remoteState NOTIFY remoteStateChanged) | 205 | Q_PROPERTY(bool remoteState READ remoteState NOTIFY remoteStateChanged) | ||
206 | public: | 206 | public: | ||
207 | explicit RemoteKeyboardDbusInterface(const QString& deviceId, QObject* parent = nullptr); | 207 | explicit RemoteKeyboardDbusInterface(const QString& deviceId, QObject* parent = nullptr); | ||
208 | ~RemoteKeyboardDbusInterface() override; | 208 | ~RemoteKeyboardDbusInterface() override; | ||
209 | Q_SIGNALS: | 209 | Q_SIGNALS: | ||
210 | void remoteStateChanged(bool state); | 210 | void remoteStateChanged(bool state); | ||
211 | }; | 211 | }; | ||
212 | 212 | | |||
213 | class KDECONNECTINTERFACES_EXPORT TelephonyDbusInterface | 213 | class KDECONNECTINTERFACES_EXPORT SmsDbusInterface | ||
214 | : public OrgKdeKdeconnectDeviceTelephonyInterface | 214 | : public OrgKdeKdeconnectDeviceSmsInterface | ||
215 | { | 215 | { | ||
216 | Q_OBJECT | 216 | Q_OBJECT | ||
217 | public: | 217 | public: | ||
218 | explicit TelephonyDbusInterface(const QString& deviceId, QObject* parent = nullptr); | 218 | explicit SmsDbusInterface(const QString& deviceId, QObject* parent = nullptr); | ||
219 | ~TelephonyDbusInterface() override; | 219 | ~SmsDbusInterface() override; | ||
220 | }; | 220 | }; | ||
221 | 221 | | |||
222 | template <typename T, typename W> | 222 | template <typename T, typename W> | ||
223 | static void setWhenAvailable(const QDBusPendingReply<T>& pending, W func, QObject* parent) | 223 | static void setWhenAvailable(const QDBusPendingReply<T>& pending, W func, QObject* parent) | ||
224 | { | 224 | { | ||
225 | QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pending, parent); | 225 | QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(pending, parent); | ||
226 | QObject::connect(watcher, &QDBusPendingCallWatcher::finished, | 226 | QObject::connect(watcher, &QDBusPendingCallWatcher::finished, | ||
227 | parent, [func](QDBusPendingCallWatcher* watcher) { | 227 | parent, [func](QDBusPendingCallWatcher* watcher) { | ||
228 | watcher->deleteLater(); | 228 | watcher->deleteLater(); | ||
229 | QDBusPendingReply<T> reply = *watcher; | 229 | QDBusPendingReply<T> reply = *watcher; | ||
230 | func(reply.value()); | 230 | func(reply.value()); | ||
231 | }); | 231 | }); | ||
232 | } | 232 | } | ||
233 | 233 | | |||
234 | #endif | 234 | #endif |