9855eb9b06e56521f5c5debc7d1c0d376e63221b
[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
10 class BluetoothDevice : public QObject
11 {
12     Q_OBJECT    
13         Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged);
14         Q_PROPERTY(bool audioConnected READ audioConnected NOTIFY audioConnectedChanged)
15         Q_PROPERTY(QStringList profiles READ profiles)
16         Q_PROPERTY(QString alias READ alias)
17         Q_PROPERTY(QString name READ name)
18         Q_PROPERTY(QString address READ address)
19         Q_PROPERTY(QString icon READ icon)
20         Q_PROPERTY(QString path READ path)
21
22 public:
23         explicit BluetoothDevice(QDBusObjectPath path = QDBusObjectPath(), QObject *parent = 0);
24
25 signals:
26         void connectedChanged(bool isConnected);
27         void audioConnectedChanged(bool isConnected);
28         void propertyChanged(QString name, QVariant value);
29
30 public slots:
31         void unpair();
32         void connectAudio();
33         void connectAudioSrc();
34         QString connectSerial();
35         void disconnect();
36
37         QStringList profiles();
38         bool isProfileSupported(QString profile);
39
40         ///properties:
41         bool connected();
42         bool audioConnected();
43         QString alias();
44         QString name();
45         QString address();
46         QString icon();
47         QString path();
48
49 private slots:
50         void propertyChanged(QString name,QDBusVariant value);
51         void audioPropertiesChanged(QString name, QDBusVariant value);
52
53 private:
54         OrgBluezDeviceInterface *m_device;
55         OrgBluezAudioInterface *audio;
56 };
57
58 #endif // BLUETOOTHDEVICE_H