Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / solid / control / ifaces / bluetoothinterface.h
blob87d23dfd33f908d7a127f4dc3ca6b7cee481815d
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Will Stephenson <wstephenson@kde.org>
3 Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 #ifndef SOLID_IFACES_BLUETOOTHINTERFACE_H
23 #define SOLID_IFACES_BLUETOOTHINTERFACE_H
25 #include <QtCore/QList>
26 #include <solid/control/solid_control_export.h>
28 #include <solid/control/bluetoothinterface.h>
29 #include <solid/control/ifaces/bluetoothremotedevice.h>
31 #include <QtCore/QObject>
33 namespace Solid
35 namespace Control
37 namespace Ifaces
39 /**
40 * Represents a bluetooth interface as seen by the bluetooth subsystem.
42 class SOLIDCONTROLIFACES_EXPORT BluetoothInterface : public QObject
44 Q_OBJECT
45 public:
46 /**
47 * Create a BluetoothInterface.
49 * @param parent the parent object
51 BluetoothInterface(QObject *parent = 0);
53 /**
54 * Destructs a BluetoothInterface object.
56 virtual ~BluetoothInterface();
58 /**
59 * Retrieves the Universal Bluetooth Identifier (UBI) of the BluetoothInterface.
60 * This identifier is unique for each bluetooth remote device and bluetooth interface in the system.
62 * @returns the Universal Bluetooth Identifier of the current bluetooth interface
64 virtual QString ubi() const = 0;
66 /**
67 * Retrieves the MAC address of the bluetooth interface/adapter.
69 * @returns MAC address of bluetooth interface
71 virtual QString address() const = 0;
73 /**
74 * Retrieves the version of the chip of the bluetooth interface/adapter.
75 * Example: "Bluetooth 2.0 + EDR"
77 * @returns bluetooth chip version
79 virtual QString version() const = 0;
81 /**
82 * Retrieves the revision of the chip of the bluetooth interface/adapter.
83 * Example: "HCI 19.2"
85 * @returns bluetooth chip revision
87 virtual QString revision() const = 0;
89 /**
90 * Retrieves the name of the bluetooth chip manufacturer.
91 * Example: "Cambdirge Silicon Radio"
93 * @returns manufacturer string of bluetooth interface/adapter
95 virtual QString manufacturer() const = 0;
97 /**
98 * Retrieves the name of the bluetooth chip company.
99 * Based on device address.
101 * @returns company string of bluetooth interface/adapter
103 virtual QString company() const = 0;
107 * Retrieves the current mode of the bluetooth interface/adapter.
108 * Valid modes: "off", "connectable", "discoverable"
110 * @todo determine unify type for valid modes.. enum?! what about other bluetooth APIs?
111 * three modes?
113 * @returns current mode of bluetooth interface/adaoter
115 virtual Solid::Control::BluetoothInterface::Mode mode() const = 0;
118 * Retrieves the discoverable timeout of the bluetooth interface/adapter.
119 * Discoverable timeout of 0 means never disappear.
121 * @returns current discoverable timeout in seconds
123 virtual int discoverableTimeout() const = 0;
126 * Retrieves the current discoverable staut of the bluetooth interface/adapter.
128 * @returns current discoverable status of bluetooth interface/adapter
130 virtual bool isDiscoverable() const = 0;
134 * List all UBIs of connected remote bluetooth devices of this handled bluetooth
135 * interface/adapter.
137 * @returns list UBIs of connected bluetooth remote devices
139 virtual QStringList listConnections() const = 0;
143 * Retrieves major class of the bluetooth interface/adapter.
145 * @returns current major class of the bluetooth interface/adapter
147 virtual QString majorClass() const = 0;
150 * List supported minor classes of the bluetooth interface/adapter.
152 * @returns list of supported minor classes by bluetooth interface/adapter
154 virtual QStringList listAvailableMinorClasses() const = 0;
157 * Retrievies minor class of the bluetooth interface/adapter.
158 * Valid classes, see listAvailableMinorClasses()
160 * @returns minor class of the bluetooth interface/adapter.
162 virtual QString minorClass() const = 0;
165 * List services class of the bluetooth interface/adapter.
167 * @returns list of service classes or empty list if no services registered
169 virtual QStringList serviceClasses() const = 0;
171 * Retrieves name of bluetooth interface/adapter.
173 * @returns name of bluetooth interface/adapter
175 virtual QString name() const = 0;
178 * List UBIs of bonded/paired remote bluetooth devices with this bluetooth
179 * interface/adapter.
181 * @returns UBIs of bonded/paired bluetooth remote devices
183 virtual QStringList listBondings() const = 0;
186 * Periodic discovery status of this bluetooth interface/adapter.
188 * @returns true if periodic discovery is already active otherwise false
190 virtual bool isPeriodicDiscoveryActive() const = 0;
193 * Name resolving status of periodic discovery routing.
195 * @returns true if name got resolved while periodic discovery of this bluetooth
196 * interface/adapter
198 virtual bool isPeriodicDiscoveryNameResolvingActive() const = 0;
201 * List the Universal Bluetooth Identifier (UBI) of all known remote devices, which are
202 * seen, used or paired/bonded.
204 * See listConnections()
206 * @returns a QStringList of UBIs of all known remote bluetooth devices
208 virtual QStringList listRemoteDevices() const = 0;
211 * List the Universal Bluetooth Identifier (UBI) of all known remote devices since a specific
212 * datestamp. Known remote devices means remote bluetooth which are seen, used or
213 * paired/bonded.
215 * See listConnections(), listRemoteDevices()
217 * @param date the datestamp of the beginning of recent used devices
218 * @returns a QStringList of UBIs of all known remote bluetooth devices
220 virtual QStringList listRecentRemoteDevices(const QDateTime &date) const = 0;
222 public Q_SLOTS:
224 * Set mode of bluetooth interface/adapter.
225 * Valid modes, see mode()
227 * @param mode the mode of the bluetooth interface/adapter
229 virtual void setMode(const Solid::Control::BluetoothInterface::Mode mode) = 0;
232 * Set discoverable timeout of bluetooth interface/adapter.
234 * @param timeout timeout in seconds
236 virtual void setDiscoverableTimeout(int timeout) = 0;
239 * Set minor class of bluetooth interface/adapter.
241 * @param minor set minor class. Valid mode see listAvaliableMinorClasses()
243 virtual void setMinorClass(const QString &minor) = 0;
246 * Set name of bluetooth interface/adapter.
248 * @param name the name of bluetooth interface/adapter
250 virtual void setName(const QString &name) = 0;
254 * Start discovery of remote bluetooth devices with device name resolving.
256 virtual void discoverDevices() = 0;
258 * Start discovery of remote bluetooth devices without device name resolving.
260 virtual void discoverDevicesWithoutNameResolving() = 0;
262 * Cancel discovery of remote bluetooth devices.
264 virtual void cancelDiscovery() = 0;
267 * Start periodic discovery of remote bluetooth devices.
268 * See stopPeriodicDiscovery()
270 virtual void startPeriodicDiscovery() = 0;
273 * Stop periodic discovery of remote bluetooth devices.
275 virtual void stopPeriodicDiscovery() = 0;
278 * Enable/Disable name resolving of remote bluetooth devices in periodic discovery.
280 * @param resolveName true to enable name resolving otherwise false
282 virtual void setPeriodicDiscoveryNameResolving(bool resolveNames) = 0;
285 * Instantiates a new BluetoothRemoteDevice object from this backend given its UBI.
287 * @param ubi the identifier of the bluetooth remote device instantiated
288 * @returns a new BluetoothRemoteDevice object if there's a device having the given UBI, 0 otherwise
290 virtual QObject *createBluetoothRemoteDevice(const QString &ubi) = 0;
292 Q_SIGNALS:
295 * This signal is emitted if the mode of the bluetooth interface/adapter has changed.
296 * See mode() for valid modes.
298 * @param mode the changed mode
300 void modeChanged(Solid::Control::BluetoothInterface::Mode);
303 * The signal is emitted if the discoverable timeout of the bluetooth interface/adapter
304 * has changed.
306 * @param timeout the changed timeout in seconds
308 void discoverableTimeoutChanged(int timeout);
311 * The signal is emitted if the minor class of the bluetooth interface/adapter has changed.
313 * @param minor the new minor class
315 void minorClassChanged(const QString &minor);
318 * The signal is emitted if the name of the bluetooth interface/adapter has changed.
320 * @param name the new name of the device
322 void nameChanged(const QString &name);
325 * This signal is emitted if a discovery has started.
327 void discoveryStarted();
330 * This signal is emitted if a discovery has completed.
332 void discoveryCompleted();
335 * This signal is emitted if the bluetooth interface/adapter detects a new remote bluetooth device.
337 * @todo change arguments types of deviceClass (uint32) and rssi (int16)
339 * @param ubi the new bluetooth identifier
340 * @param deviceClass the device Class of the remote device
341 * @param rssi the RSSI link of the remote device
343 void remoteDeviceFound(const QString &ubi, int deviceClass, int rssi);
346 * This signal is emitted if the bluetooth interface/adapter detectes a bluetooth device
347 * disappeared.
349 * @param ubi the ubi of the disappering bluetooth remote device
351 void remoteDeviceDisappeared(const QString &ubi);
354 } //Ifaces
355 } //Control
356 } //Solid
358 Q_DECLARE_INTERFACE(Solid::Control::Ifaces::BluetoothInterface, "org.kde.Solid.Control.Ifaces.BluetoothInterface/0.1")
360 #endif