added support for input devices
[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(QStringList profiles READ profiles)
18         Q_PROPERTY(QString alias READ alias)
19         Q_PROPERTY(QString name READ name)
20         Q_PROPERTY(QString address READ address)
21         Q_PROPERTY(QString icon READ icon)
22         Q_PROPERTY(QString path READ path)
23
24 public:
25         explicit BluetoothDevice(QDBusObjectPath path = QDBusObjectPath(), QObject *parent = 0);
26
27 signals:
28         void connectedChanged(bool isConnected);
29         void audioConnectedChanged(bool isConnected);
30         void inputConnectedChanged(bool isConnected);
31         void propertyChanged(QString name, QVariant value);
32
33 public slots:
34         void unpair();
35         void connectAudio();
36         void connectAudioSrc();
37         QString connectSerial();
38         void connectInput();
39         void disconnect();
40         void disconnectAudio();
41
42         QStringList profiles();
43         bool isProfileSupported(QString profile);
44
45         ///properties:
46         bool connected();
47         bool audioConnected();
48         bool inputConnected();
49         QString alias();
50         QString name();
51         QString address();
52         QString icon();
53         QString path();
54
55 private slots:
56         void propertyChanged(QString name,QDBusVariant value);
57         void audioPropertiesChanged(QString name, QDBusVariant value);
58         void inputPropertiesChanged(QString name, QDBusVariant value);
59
60 private:
61         OrgBluezDeviceInterface *m_device;
62         OrgBluezAudioInterface *audio;
63         OrgBluezInputInterface *input;
64 };
65
66 #endif // BLUETOOTHDEVICE_H