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
00029 #include "bluetoothremotedevice.h"
00030 #include "ifaces/bluetoothremotedevice.h"
00031
00032
00033
00034 namespace Solid
00035 {
00036 namespace Control
00037 {
00038 class BluetoothRemoteDevice;
00039 typedef QList<BluetoothRemoteDevice> BluetoothRemoteDeviceList;
00040 class BluetoothInterfacePrivate;
00041
00045 class SOLIDCONTROL_EXPORT BluetoothInterface : public QObject
00046 {
00047 Q_OBJECT
00048
00049 public:
00057 enum Mode { Off, Discoverable, Connectable };
00061 BluetoothInterface();
00062
00068 explicit BluetoothInterface(const QString &ubi);
00069
00075 explicit BluetoothInterface(QObject *backendObject);
00076
00082 BluetoothInterface(const BluetoothInterface &device);
00083
00087 ~BluetoothInterface();
00088
00089
00096 BluetoothInterface &operator=(const BluetoothInterface &device);
00097
00104 QString ubi() const;
00105
00112 BluetoothRemoteDevice *createBluetoothRemoteDevice(const QString &address);
00113
00120 BluetoothRemoteDevice findBluetoothRemoteDevice(const QString &ubi) const;
00121
00127 QString address() const;
00128
00135 QString version() const;
00136
00143 QString revision() const;
00144
00151 QString manufacturer() const;
00152
00160 QString company() const;
00161
00167 Mode mode() const;
00168
00175 int discoverableTimeout() const;
00176
00182 bool isDiscoverable() const;
00183
00190 BluetoothRemoteDeviceList listConnections() const;
00191
00197 QString majorClass() const;
00198
00205 QStringList listAvailableMinorClasses() const;
00206
00214 QString minorClass() const;
00215
00222 QStringList serviceClasses() const;
00223
00230 QString name() const;
00231
00237 QString getRemoteName(const QString & mac);
00238
00245 QStringList listBondings() const;
00246
00252 bool isPeriodicDiscoveryActive() const;
00253
00260 bool isPeriodicDiscoveryNameResolvingActive() const;
00261
00270 QStringList listRemoteDevices() const;
00271
00282 QStringList listRecentRemoteDevices(const QDateTime &date) const;
00283
00289 bool isTrusted(const QString &);
00290
00291
00292 public Q_SLOTS:
00299 void setMode(const Mode mode);
00300
00306 void setDiscoverableTimeout(int timeout);
00307
00313 void setMinorClass(const QString &minor);
00314
00320 void setName(const QString &name);
00321
00325 void discoverDevices();
00329 void discoverDevicesWithoutNameResolving();
00333 void cancelDiscovery();
00334
00339 void startPeriodicDiscovery();
00340
00344 void stopPeriodicDiscovery();
00345
00351 void setPeriodicDiscoveryNameResolving(bool resolveNames);
00352
00358 void setTrusted(const QString &);
00359
00365 void removeTrust(const QString &);
00366
00367
00368 Q_SIGNALS:
00369
00376 void modeChanged(Solid::Control::BluetoothInterface::Mode);
00377
00384 void discoverableTimeoutChanged(int timeout);
00385
00391 void minorClassChanged(const QString &minor);
00392
00398 void nameChanged(const QString &name);
00399
00403 void discoveryStarted();
00404
00408 void discoveryCompleted();
00409
00419 void remoteDeviceFound(const QString &ubi, int deviceClass, int rssi);
00420
00427 void remoteDeviceDisappeared(const QString &ubi);
00428
00436 void remoteNameUpdated(const QString &address, const QString &name);
00437
00443 void remoteDeviceConnected(const QString &address);
00444
00450 void remoteDeviceDisconnected(const QString &address);
00451
00457 void trustAdded(const QString &address);
00458
00464 void trustRemoved(const QString &address);
00465
00471 void bondingCreated(const QString &address);
00472
00478 void bondingRemoved(const QString &address);
00479
00480 private:
00481 Q_PRIVATE_SLOT(d, void _k_destroyed(QObject *))
00482
00483 BluetoothInterfacePrivate * const d;
00484 };
00485
00486 }
00487 }
00488
00489 #endif
00490