summaryrefslogtreecommitdiff
path: root/app/pebbledinterface.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-12-02 23:33:19 +0100
committerJavier <dev.git@javispedro.com>2014-12-02 23:33:19 +0100
commitc35a3a9bea759cadf1e975a2a62e50789cad096c (patch)
tree0e8b48fdb8bf07226b18a87f312631debbf41383 /app/pebbledinterface.h
parent81f91639969de0f3852a3fe73db13b4cb0ecf3b4 (diff)
define new D-Bus interface, use qmake to generate adaptors/interfaces
also slightly clean up the way d-bus is handled both in daemon and UI
Diffstat (limited to 'app/pebbledinterface.h')
-rw-r--r--app/pebbledinterface.h45
1 files changed, 15 insertions, 30 deletions
diff --git a/app/pebbledinterface.h b/app/pebbledinterface.h
index 7d00110..78724ad 100644
--- a/app/pebbledinterface.h
+++ b/app/pebbledinterface.h
@@ -2,51 +2,36 @@
#define PEBBLEDINTERFACE_H
#include <QObject>
-#include <QtDBus/QtDBus>
-#include <QDBusArgument>
+#include <QUrl>
+#include <QDBusInterface>
+
+class OrgPebbledWatchInterface;
class PebbledInterface : public QObject
{
Q_OBJECT
-
- static QString PEBBLED_SYSTEMD_UNIT;
- static QString PEBBLED_DBUS_SERVICE;
- static QString PEBBLED_DBUS_PATH;
- static QString PEBBLED_DBUS_IFACE;
-
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
- bool enabled() const;
-
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
- bool active() const;
-
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
- bool connected() const;
-
- Q_PROPERTY(QVariantMap pebble READ pebble NOTIFY pebbleChanged)
- QVariantMap pebble() const;
-
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
- QString name() const;
-
Q_PROPERTY(QString address READ address NOTIFY addressChanged)
- QString address() const;
-
public:
explicit PebbledInterface(QObject *parent = 0);
+ bool enabled() const;
+ bool active() const;
+ bool connected() const;
+ QString name() const;
+ QString address() const;
+
signals:
void enabledChanged();
void activeChanged();
-
void connectedChanged();
- void pebbleChanged();
void nameChanged();
void addressChanged();
- void openUrl(const QString &url);
-
public slots:
void setEnabled(bool);
void setActive(bool);
@@ -54,19 +39,19 @@ public slots:
void time();
void disconnect();
void reconnect();
- void test();
- void webviewClosed(const QString &result);
+
+ QUrl configureApp(const QUuid &uuid);
+ void setAppConfiguration(const QUuid &uuid, const QString &data);
private slots:
void getUnitProperties();
void onPropertiesChanged(QString interface, QMap<QString, QVariant> changed, QStringList invalidated);
- void onPebbleChanged();
private:
QDBusInterface *systemd;
+ OrgPebbledWatchInterface *watch;
QDBusObjectPath unitPath;
-
- QVariantMap properties;
+ QVariantMap unitProperties;
};
#endif // PEBBLEDINTERFACE_H