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_BLUETOOTHREMOTEDEVICE
23 #define SOLID_IFACES_BLUETOOTHREMOTEDEVICE
25 #include <QtCore/QObject>
26 #include <QtCore/QStringList>
27 #include <solid/control/solid_control_export.h>
38 * This interface represents a remote bluetooth device which we may be connected to.
40 class SOLIDCONTROLIFACES_EXPORT BluetoothRemoteDevice
: public QObject
45 * Create a BluetoothRemoteDevice.
47 * @param parent the parent object
49 BluetoothRemoteDevice(QObject
*parent
= 0);
52 * Destructs a BluetoothRemoteDevice object.
54 virtual ~BluetoothRemoteDevice();
57 * Retrieves the Universal Bluetooth Identifier (UBI) of the remote device.
58 * This identifier is unique for each remote device and bluetooth interface in the system.
60 * @returns the Universal Bluetooth Identifier of the current remote device.
62 virtual QString
ubi() const = 0;
65 * Retrieves MAC address of the bluetooth remote device.
67 * @returns MAC address of remote device.
69 virtual QString
address() const = 0;
73 * Retrieves true if remote device is connected.
75 * @returns true if remote bluetooth device is connected otherwise false.
77 virtual bool isConnected() const = 0;
80 * Retrieves the bluetooth version of the remote device.
81 * LMP version (+ EDR support)
83 * @returns version of bluetooth chip.
85 virtual QString
version() const = 0;
88 * Retrieves the revision of the bluetooth chip of the remote device.
90 * @returns revision of bluetooth chip.
92 virtual QString
revision() const = 0;
95 * Retrieves company name based on the device address.
97 * @returns manufacturer string of bluetooth chip.
99 virtual QString
manufacturer() const = 0;
102 * Retrieves the manufacturer of the bluetooth chip of the remote device.
104 * @returns company string of the bluetooth chip.
106 virtual QString
company() const = 0;
109 * Retrieves the major class of the remote device.
110 * Example: "computer"
112 * @returns major class of remote device.
114 virtual QString
majorClass() const = 0;
117 * Retrieves the minor class of the remote device.
120 * @returns minor class of the remote device.
122 virtual QString
minorClass() const = 0;
125 * Retrieves a list of service classes of the remote device.
126 * Example: ["networking", "object transfer"]
128 * @returns list of service classes of the remote device.
130 virtual QStringList
serviceClasses() const = 0;
132 * Retrieves the real name of the remote device. See also alias().
133 * Example: "Daniel's mobile"
135 * @returns name of remote device.
137 virtual QString
name() const = 0;
140 * Retrieves alias of remote device. This is a local alias name for the remote device.
141 * If this string is empty the frontend should should use name(). This is handy if
142 * someone is using several bluetooth remote device with the same name. alias() should
143 * be preferred used by the frontend.
144 * Example: "Company mobile"
146 * @retuns local alias of remote device.
148 virtual QString
alias() const = 0;
151 * Retrieves the date and time when the remote device has been seen.
152 * Example: "2007-03-20 22:14:00 GMT"
154 * @returns date and time when the remote device has been seen.
156 virtual QString
lastSeen() const = 0;
159 * Retrieves the date and time when the remote device has been used.
160 * Example: "2007-03-20 22:14:00 GMT"
162 * @returns date and time when the remote device has been used.
164 virtual QString
lastUsed() const = 0;
167 * Retrieves true if remote device has bonding.
169 * @returns true if remote device has bonding.
171 virtual bool hasBonding() const = 0;
174 * Retrieves PIN code length that was used in the pairing process of remote device.
176 * @returns PIN code length of pairing.
178 virtual int pinCodeLength() const = 0;
181 * Retrieves currently used encryption key size of remote device.
183 * @returns encryption key size.
185 virtual int encryptionKeySize() const = 0;
188 * Create bonding ("pairing") with remote device.
190 * @returns the job handling of the operation.
192 virtual KJob
*createBonding() = 0;
197 * Set alias for remote device.
199 * @param alias new alias name
201 virtual void setAlias(const QString
&alias
) = 0;
204 * Clear alias for remote device.
206 virtual void clearAlias() = 0;
209 * Disconnect remote device.
211 virtual void disconnect() = 0;
214 * Cancel bonding process of remote device.
216 virtual void cancelBondingProcess() = 0;
219 * Remove bonding bonding of remote device.
221 virtual void removeBonding() = 0;
223 * Obtains a list of unique identifiers to each service provided by this remote device.
224 * As this is a slow operation, this method only queues the message
225 * in the dbus and returns the list of handles using the serviceHandlesAvailable signal
227 * NOTE: Most local adapters won't support more than one search at a time, so serialize your requests
229 * @param filter A filter to apply to the search (look at http://wiki.bluez.org/wiki/HOWTO/DiscoveringServices#Searchpatterns)
231 virtual void serviceHandles(const QString
&filter
) const = 0;
233 * Requests the service record associated with the given handle.
234 * As this is a slow operation, this method only queues the message
235 * in the dbus and returns the XML record using the serviceRecordXmlAvailable signal.
237 * NOTE: Most local adapters won't support more than one search at a time, so serialize your requests
239 * @param handle The handle that uniquely identifies the service record requested.
241 virtual void serviceRecordAsXml(uint handle
) const = 0;
244 * Class has been changed of remote device.
246 * @params deviceClass the device class of the remote device
248 virtual void classChanged(uint deviceClass
) = 0;
251 * Name has beend changed of remote device.
253 * @params name the name of the remote device
255 virtual void nameChanged(const QString
&name
) = 0;
258 * Resolving of remote device name failed.
260 virtual void nameResolvingFailed() = 0;
263 * Alias has been changed of remote device.
265 * @params alias the alias of the remote device
267 virtual void aliasChanged(const QString
&alias
) = 0;
270 * Alias got cleared of remote device.
272 virtual void aliasCleared() = 0;
275 * Remote device has been connected.
277 virtual void connected() = 0;
280 * Disconnection has been requested for remote device.
282 virtual void requestDisconnection() = 0;
285 * Remote device has been disconnected.
287 virtual void disconnected() = 0;
290 * Bonding with remote device has been created.
292 virtual void bondingCreated() = 0;
295 * Bonding has been removed of remote device.
297 virtual void bondingRemoved() = 0;
299 * A new service record is available
301 virtual void serviceRecordXmlAvailable(const QString
&ubi
, const QString
&record
) = 0;
303 * Search for service handles is done
305 virtual void serviceHandlesAvailable(const QString
&ubi
, const QList
<uint
> &handles
) = 0;
314 Q_DECLARE_INTERFACE(Solid::Control::Ifaces::BluetoothRemoteDevice
, "org.kde.Solid.Control.Ifaces.BluetoothRemoteDevice/0.1")