-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdevice.h
64 lines (47 loc) · 1.32 KB
/
device.h
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
58
59
60
61
62
63
/*
* File: device.h
* Author: christian
*
* Created on 15. august 2015, 09:56
*/
#ifndef DEVICE_H
#define DEVICE_H
#include <QObject>
#include <QFrame>
#include "org.bluez.Device1.h"
#include "org.freedesktop.DBus.Properties.h"
#include "ui_device.h"
class Device : public QFrame
{
Q_OBJECT
public:
static QString serviceName(QString uuid);
static QMap<QString, Device*> devices;
Device(QString path, QWidget* parent = 0);
virtual ~Device();
void showDetails(bool show);
inline bool shown() { return frame.detailsFrame->isVisible(); }
OrgBluezDevice1Interface* deviceInterface;
signals:
void clicked();
void paired(QString path);
protected:
virtual void paintEvent(QPaintEvent* event);
private slots:
void onPropertiesChanged(const QString &interface,
const QVariantMap &changed_properties,
const QStringList &invalidated_properties);
void pair();
void pairingFinished(QDBusPendingCallWatcher* watcher);
void forget();
void trustedClicked(int newState);
void connectedClicked(int newState);
private:
static const QMap<QString, QString> uuid2ServiceName;
void update();
OrgFreedesktopDBusPropertiesInterface* propertiesInterface;
Ui::device frame;
QList<QLabel*> services;
bool pairing;
};
#endif /* DEVICE_H */