Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / solid / control / ifaces / bluetoothmanager.h
blob4f7c788a5c388f437b9ccd0e6e57c24d50be69ad
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/solid_control_export.h>
28 class KJob;
30 namespace Solid
32 namespace Control
34 namespace Ifaces
36 class BluetoothSecurity;
37 /**
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
46 Q_OBJECT
47 public:
48 /**
49 * Constructs a BluetoothManager.
51 * @param parent the parent object
53 BluetoothManager(QObject * parent = 0);
54 /**
55 * Destructs a BluetoothManager object.
57 virtual ~BluetoothManager();
59 /**
60 * Retrieves the list of all the bluetooth interfaces Universal Bluetooth Identifiers (UBIs)
61 * in the system.
63 * @return the list of bluetooth interfaces available in this system
65 virtual QStringList bluetoothInterfaces() const = 0;
67 /**
68 * Retrieves the default bluetooth interface Universal Bluetooth Identifiers (UBIs)
69 * of the system.
71 * @return the UBI of the default bluetooth interface
73 virtual QString defaultInterface() const = 0;
75 /**
76 * Instantiates a new BluetoothInterface object from this backend given its UBI.
78 * @param ubi the identifier of the bluetooth interface instantiated
79 * @returns a new BluetoothInterface object if there's a device having the given UBI, 0 otherwise
81 virtual QObject *createInterface(const QString &ubi) = 0;
83 /**
84 * Retrieves the list of Universal Bluetooth Identifiers (UBIs) of bluetooth input devices
85 * which are configured in the system. Configured means also not connected devices.
87 * @return the list of bluetooth input devices configured in this system
89 virtual QStringList bluetoothInputDevices() const = 0;
91 /**
92 * Instantiates a new BluetoothInputDevice object from this backend given its UBI.
94 * @param ubi the identifier of the bluetooth input device instantiated
95 * @returns a new BluetoothInputDevice object if there's a device having the given UBI, 0 otherwise
97 virtual QObject *createBluetoothInputDevice(const QString &ubi) = 0;
99 /**
100 * Setup a new bluetooth input device.
102 * @param ubi the ubi of the bluetooth input device
103 * @returns job handling of the operation.
105 virtual KJob *setupInputDevice(const QString &ubi) = 0;
108 * Gets an instance of BluetoothSecurity to handle pairing/authorization requests
110 virtual Solid::Control::Ifaces::BluetoothSecurity* security(const QString &interface) = 0;
112 public Q_SLOTS:
114 * Remove the configuraiton of a bluetooth input device.
116 * @param ubi the bluetooth input device identifier
118 virtual void removeInputDevice(const QString & ubi) = 0;
120 Q_SIGNALS:
122 * This signal is emitted when a new bluetooth interface is available.
124 * @param ubi the bluetooth interface identifier
126 void interfaceAdded(const QString & ubi);
129 * This signal is emitted when a bluetooth interface is not available anymore.
131 * @param ubi the bluetooth interface identifier
133 void interfaceRemoved(const QString & ubi);
136 * This signal is emitted when the default bluetooth interface changed.
138 * @param ubi the bluetooth interface identifier
140 void defaultInterfaceChanged(const QString & ubi);
143 * This signal is emitted when a new bluetooth input device got configured/created.
145 * @param ubi the bluetooth input device identifier
147 void inputDeviceCreated(const QString & ubi);
150 * This signal is emitted when a bluetooth input device configuration is not available anymore.
152 * @param ubi the bluetooth input device identifier
154 void inputDeviceRemoved(const QString & ubi);
158 } // Ifaces
160 } // Control
162 } // Solid
164 #endif