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_BLUETOOTHMANAGER
23 #define SOLID_IFACES_BLUETOOTHMANAGER
25 #include <QtCore/QObject>
26 #include "../solid_control_export.h"
36 class BluetoothSecurity
;
38 * This class specifies the interface a backend will have to implement in
39 * order to be used in the system.
41 * A bluetooth manager allow to query the underlying platform to discover the
42 * available bluetooth interfaces.
44 class SOLIDCONTROLIFACES_EXPORT BluetoothManager
: public QObject
49 * Constructs a BluetoothManager.
51 * @param parent the parent object
53 BluetoothManager(QObject
* parent
= 0);
55 * Destructs a BluetoothManager object.
57 virtual ~BluetoothManager();
60 * Retrieves the list of all the bluetooth interfaces Universal Bluetooth Identifiers (UBIs)
63 * @return the list of bluetooth interfaces available in this system
65 virtual QStringList
bluetoothInterfaces() const = 0;
68 * Retrieves the default bluetooth interface Universal Bluetooth Identifiers (UBIs)
71 * @return the UBI of the default bluetooth interface
73 virtual QString
defaultInterface() const = 0;
76 * Returns the UBI of the Bluetooth Interface given its name (e.g. 'hci0'),
77 * if found on the system.
79 * @return the found UBI of the named bluetooth interface
81 virtual QString
findInterface(const QString
&name
) const = 0;
84 * Instantiates a new BluetoothInterface object from this backend given its UBI.
86 * @param ubi the identifier of the bluetooth interface instantiated
87 * @returns a new BluetoothInterface object if there's a device having the given UBI, 0 otherwise
89 virtual QObject
*createInterface(const QString
&ubi
) = 0;
92 * Removes a BluetoothInterface object from this backend given its UBI.
94 * @param ubi the identifier of the bluetooth interface instantiated
96 virtual void removeInterface(const QString
&ubi
) = 0;
99 * Retrieves the list of Universal Bluetooth Identifiers (UBIs) of bluetooth input devices
100 * which are configured in the system. Configured means also not connected devices.
102 * @return the list of bluetooth input devices configured in this system
104 // virtual QStringList bluetoothInputDevices() const = 0;
107 * Instantiates a new BluetoothInputDevice object from this backend given its UBI.
109 * @param ubi the identifier of the bluetooth input device instantiated
110 * @returns a new BluetoothInputDevice object if there's a device having the given UBI, 0 otherwise
112 // virtual QObject *createBluetoothInputDevice(const QString &ubi) = 0;
115 * Setup a new bluetooth input device.
117 * @param ubi the ubi of the bluetooth input device
118 * @returns job handling of the operation.
120 // virtual KJob *setupInputDevice(const QString &ubi) = 0;
123 * Gets an instance of BluetoothSecurity to handle pairing/authorization requests
125 // virtual Solid::Control::Ifaces::BluetoothSecurity* security(const QString &interface) = 0;
129 * Remove the configuraiton of a bluetooth input device.
131 * @param ubi the bluetooth input device identifier
133 // virtual void removeInputDevice(const QString & ubi) = 0;
137 * This signal is emitted when a new bluetooth interface is available.
139 * @param ubi the bluetooth interface identifier
141 void interfaceAdded(const QString
& ubi
);
144 * This signal is emitted when a bluetooth interface is not available anymore.
146 * @param ubi the bluetooth interface identifier
148 void interfaceRemoved(const QString
& ubi
);
151 * This signal is emitted when the default bluetooth interface changed.
153 * @param ubi the bluetooth interface identifier
155 void defaultInterfaceChanged(const QString
& ubi
);
158 * This signal is emitted when a new bluetooth input device got configured/created.
160 * @param ubi the bluetooth input device identifier
162 // void inputDeviceCreated(const QString & ubi);
165 * This signal is emitted when a bluetooth input device configuration is not available anymore.
167 * @param ubi the bluetooth input device identifier
169 // void inputDeviceRemoved(const QString & ubi);