version bump
[profile/ivi/bluetooth-qt.git] / bluetoothdevice.h
1 #ifndef BLUETOOTHDEVICE_H
2 #define BLUETOOTHDEVICE_H
3
4 #include <QObject>
5 #include <QStringList>
6 #include <bluedevice.h>
7
8 class OrgBluezAudioInterface;
9 class OrgBluezInputInterface;
10
11 class BluetoothDevice : public QObject
12 {
13     Q_OBJECT    
14         Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged);
15         Q_PROPERTY(bool audioConnected READ audioConnected NOTIFY audioConnectedChanged)
16         Q_PROPERTY(bool inputConnected READ inputConnected NOTIFY inputConnectedChanged)
17         Q_PROPERTY(bool trusted READ trusted WRITE setTrusted NOTIFY trustedChanged)
18         Q_PROPERTY(QStringList profiles READ profiles NOTIFY profilesChanged)
19         Q_PROPERTY(QString alias READ alias)
20         Q_PROPERTY(QString name READ name)
21         Q_PROPERTY(QString address READ address)
22         Q_PROPERTY(QString icon READ icon)
23         Q_PROPERTY(QString path READ path)
24
25 public:
26         explicit BluetoothDevice(QDBusObjectPath path = QDBusObjectPath(), QObject *parent = 0);
27
28 signals:
29         void connectedChanged(bool isConnected);
30         void audioConnectedChanged(bool isConnected);
31         void inputConnectedChanged(bool isConnected);
32         void propertyChanged(QString name, QVariant value);
33         void profilesChanged(QStringList uuids);
34         void trustedChanged(bool trust);
35
36 public slots:
37         void unpair();
38         void connectAudio();
39         void connectAudioSrc();
40         QString connectSerial();
41         void connectInput();
42         void disconnect();
43         void disconnectAudio();
44         bool trusted();
45         void setTrusted(bool trust);
46
47         QStringList profiles();
48         bool isProfileSupported(QString profile);
49
50         ///properties:
51         bool connected();
52         bool audioConnected();
53         bool inputConnected();
54         QString alias();
55         QString name();
56         QString address();
57         QString icon();
58         QString path();
59
60 private slots:
61         void propertyChanged(QString name,QDBusVariant value);
62         void audioPropertiesChanged(QString name, QDBusVariant value);
63         void inputPropertiesChanged(QString name, QDBusVariant value);
64
65 private:
66         OrgBluezDeviceInterface *m_device;
67         OrgBluezAudioInterface *audio;
68         OrgBluezInputInterface *input;
69 };
70
71 #endif // BLUETOOTHDEVICE_H