blob: 78724ad89076e9fdaf5a70e8229f5333bcb82f28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#ifndef PEBBLEDINTERFACE_H
#define PEBBLEDINTERFACE_H
#include <QObject>
#include <QUrl>
#include <QDBusInterface>
class OrgPebbledWatchInterface;
class PebbledInterface : public QObject
{
Q_OBJECT
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(QString address READ address NOTIFY addressChanged)
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 nameChanged();
void addressChanged();
public slots:
void setEnabled(bool);
void setActive(bool);
void ping();
void time();
void disconnect();
void reconnect();
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);
private:
QDBusInterface *systemd;
OrgPebbledWatchInterface *watch;
QDBusObjectPath unitPath;
QVariantMap unitProperties;
};
#endif // PEBBLEDINTERFACE_H
|