libsolidcontrol
bluetoothinterface.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SOLID_CONTROL_BLUETOOTHINTERFACE_H
00023 #define SOLID_CONTROL_BLUETOOTHINTERFACE_H
00024
00025 #include <QtCore/QDateTime>
00026 #include <QtCore/QPair>
00027 #include <QtCore/QObject>
00028 #include <QtCore/QMap>
00029
00030 #include "bluetoothremotedevice.h"
00031 #include "bluetoothinputdevice.h"
00032 #include "ifaces/bluetoothremotedevice.h"
00033 #include "ifaces/bluetoothinputdevice.h"
00034
00035
00036
00037 namespace Solid
00038 {
00039 namespace Control
00040 {
00041 class BluetoothRemoteDevice;
00042 typedef QList<BluetoothRemoteDevice*> BluetoothRemoteDeviceList;
00043 class BluetoothInterfacePrivate;
00044
00048 class SOLIDCONTROL_EXPORT BluetoothInterface : public QObject
00049 {
00050 Q_OBJECT
00051
00052
00053 public:
00061
00062
00063
00067 BluetoothInterface();
00068
00069
00070
00076 explicit BluetoothInterface(const QString &ubi);
00077
00083 explicit BluetoothInterface(QObject *backendObject);
00084
00090 BluetoothInterface(const BluetoothInterface &device);
00091
00095 ~BluetoothInterface();
00096
00097
00104 BluetoothInterface &operator=(const BluetoothInterface &device);
00105
00112 QString ubi() const;
00113
00120
00121 void createBluetoothRemoteDevice(const QString &address);
00122
00129 const QString getBluetoothRemoteDeviceUBI(const QString &address) const;
00130
00131 Solid::Control::BluetoothRemoteDevice findBluetoothRemoteDeviceAddr(const QString &addr) const;
00132
00133 Solid::Control::BluetoothRemoteDevice* findBluetoothRemoteDeviceUBI(const QString &ubi) const;
00134
00135 Solid::Control::BluetoothInputDevice* findBluetoothInputDeviceUBI(const QString &ubi) const;
00136
00142 QString address() const;
00143
00150
00151
00158
00159
00166
00167
00175
00176
00183 int discoverableTimeout() const;
00184
00190 bool isDiscoverable() const;
00191
00197 bool isDiscovering() const;
00198
00199
00206
00207
00213
00214
00221
00222
00230
00231
00238
00239
00246 QString name() const;
00247
00253
00254
00261
00262
00268
00269
00276
00277
00286
00287
00298
00299
00305
00306
00307
00308 void createPairedDevice(const QString &, const QString &, const QString &) const;
00309
00310 QMap< QString, QVariant > getProperties() const;
00311
00312 BluetoothRemoteDeviceList listDevices() const;
00313
00314
00315
00316
00317 public Q_SLOTS:
00323 void setDiscoverable(bool status);
00324
00330 void setDiscoverableTimeout(int timeout);
00331
00337
00338
00344 void setName(const QString &name);
00345
00349
00353
00357
00358
00363
00364
00368
00369
00375
00376
00382
00383
00389
00390
00391 void registerAgent(const QString &,const QString &) const;
00392
00393 void releaseSession() const;
00394
00395 void removeDevice(const QString &) const;
00396
00397 void requestSession() const;
00398
00399 void setProperty(const QString &, const QVariant &) const;
00400
00401 void startDiscovery() const;
00402
00403 void stopDiscovery() const;
00404
00405 void unregisterAgent(const QString &) const;
00406
00407 void cancelDeviceCreation(const QString &) const;
00408
00409
00410 Q_SIGNALS:
00411
00418
00419
00426
00427
00433
00434
00440
00441
00445
00446
00450
00451
00461
00462
00469
00470
00478
00479
00485
00486
00492
00493
00499
00500
00506
00507
00513
00514
00520
00526 void deviceCreated(const QString &ubi);
00527
00534 void deviceDisappeared(const QString &address);
00535
00543 void deviceFound(const QString &address, const QMap< QString, QVariant > &properties);
00544
00550 void deviceRemoved(const QString &ubi);
00551
00558 void propertyChanged(const QString &property, const QVariant &value);
00559
00560
00561
00562
00563 private:
00564 Q_PRIVATE_SLOT(d, void _k_destroyed(QObject *))
00565
00566 QVariant getProperty(const QString&) const;
00567 BluetoothInterfacePrivate * const d;
00568
00569 private Q_SLOTS:
00570 void slotDeviceCreated(const QString& ubi);
00571
00572 };
00573
00574 }
00575 }
00576
00577
00578 #endif
00579