#include <QObject>
#include <QStringList>
#include <bluedevice.h>
-/*
-#include <audiosource.h>
-#include <audiosink.h>
-#include <headset.h>
-*/
+
+class OrgBluezAudioInterface;
+class OrgBluezInputInterface;
+
class BluetoothDevice : public QObject
{
Q_OBJECT
- /*Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged)
+ Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged);
+ Q_PROPERTY(bool audioConnected READ audioConnected NOTIFY audioConnectedChanged)
+ Q_PROPERTY(bool inputConnected READ inputConnected NOTIFY inputConnectedChanged)
+ Q_PROPERTY(QStringList profiles READ profiles)
Q_PROPERTY(QString alias READ alias)
Q_PROPERTY(QString name READ name)
Q_PROPERTY(QString address READ address)
Q_PROPERTY(QString icon READ icon)
Q_PROPERTY(QString path READ path)
- Q_PROPERTY(QString connectedProfile READ connectedProfile)*/
public:
- explicit BluetoothDevice(QDBusObjectPath path, QObject *parent = 0);
+ explicit BluetoothDevice(QDBusObjectPath path = QDBusObjectPath(), QObject *parent = 0);
signals:
- void connetedChanged();
+ void connectedChanged(bool isConnected);
+ void audioConnectedChanged(bool isConnected);
+ void inputConnectedChanged(bool isConnected);
+ void propertyChanged(QString name, QVariant value);
public slots:
void unpair();
- void connect(QString profile);
+ void connectAudio();
+ void connectAudioSrc();
+ QString connectSerial();
+ void connectInput();
void disconnect();
+ void disconnectAudio();
QStringList profiles();
bool isProfileSupported(QString profile);
- QString connectedProfile();
///properties:
bool connected();
+ bool audioConnected();
+ bool inputConnected();
QString alias();
QString name();
QString address();
private slots:
void propertyChanged(QString name,QDBusVariant value);
+ void audioPropertiesChanged(QString name, QDBusVariant value);
+ void inputPropertiesChanged(QString name, QDBusVariant value);
private:
OrgBluezDeviceInterface *m_device;
+ OrgBluezAudioInterface *audio;
+ OrgBluezInputInterface *input;
};
#endif // BLUETOOTHDEVICE_H