summaryrefslogtreecommitdiff
path: root/daemon/manager.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-12-03 00:00:42 +0100
committerJavier <dev.git@javispedro.com>2014-12-03 00:06:13 +0100
commit843e8c2550f69de3b9dfc3ec5f13d2c3a5710896 (patch)
tree80f8edf321fed7d1790b609c2dab51c9d22fdd8b /daemon/manager.h
parentc35a3a9bea759cadf1e975a2a62e50789cad096c (diff)
implement more parts of the new D-Bus API
Diffstat (limited to 'daemon/manager.h')
-rw-r--r--daemon/manager.h37
1 files changed, 11 insertions, 26 deletions
diff --git a/daemon/manager.h b/daemon/manager.h
index c12d3dc..f099aac 100644
--- a/daemon/manager.h
+++ b/daemon/manager.h
@@ -62,6 +62,8 @@ class Manager : public QObject, protected QDBusContext
QString lastSeenMpris;
QVariantMap mprisMetadata;
+ QUuid currentAppUuid;
+
QScopedPointer<icu::Transliterator> transliterator;
public:
@@ -84,8 +86,6 @@ public slots:
void applyProfile();
private slots:
- void test();
- void onWebviewClosed(const QString &result);
void onSettingChanged(const QString &key);
void onSettingsChanged();
void onPebbleChanged();
@@ -103,6 +103,8 @@ private slots:
void setMprisMetadata(QVariantMap metadata);
void onAppMessage(const QUuid &uuid, const QVariantMap &data);
+ void onAppOpened(const QUuid &uuid);
+ void onAppClosed(const QUuid &uuid);
};
/** This class is what's actually exported over D-Bus,
@@ -132,32 +134,13 @@ public slots:
inline void Ping(uint val) { manager()->watch->ping(val); }
inline void SyncTime() { manager()->watch->time(); }
- inline void LaunchApp(const QString &uuid) { /* TODO */ }
- inline void CloseApp(const QString &uuid) { /* TODO */ }
-
- bool SendAppMessage(const QString &uuid, const QVariantMap &data) {
- Q_ASSERT(calledFromDBus());
- const QDBusMessage msg = message();
- setDelayedReply(true);
- manager()->appmsg->send(uuid, data, [this, msg]() {
- QDBusMessage reply = msg.createReply(QVariant::fromValue(true));
- this->connection().send(reply);
- }, [this, msg]() {
- QDBusMessage reply = msg.createReply(QVariant::fromValue(false));
- this->connection().send(reply);
- });
- return false; // D-Bus clients should never see this reply.
- }
-
- QString StartAppConfiguration(const QString &uuid) {
- Q_ASSERT(calledFromDBus());
- const QDBusMessage msg = message();
- setDelayedReply(true);
+ inline void LaunchApp(const QString &uuid) { manager()->appmsg->launchApp(uuid); }
+ inline void CloseApp(const QString &uuid) { manager()->appmsg->closeApp(uuid); }
- // TODO
- }
+ bool SendAppMessage(const QString &uuid, const QVariantMap &data);
+ QString StartAppConfiguration(const QString &uuid);
- inline void SendAppConfiguration(const QString &uuid, const QString &data) {
+ void SendAppConfiguration(const QString &uuid, const QString &data) {
// TODO
}
@@ -166,6 +149,8 @@ signals:
void AddressChanged();
void ConnectedChanged();
void AppMessage(const QString &uuid, const QVariantMap &data);
+ void AppOpened(const QString &uuid);
+ void AppClosed(const QString &uuid);
};
#endif // MANAGER_H