libsolidcontrol
bluetoothmanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2006 Will Stephenson <wstephenson@kde.org> 00003 Copyright (C) 2006 Kevin Ottens <ervin@kde.org> 00004 Copyright (C) 2007 Daniel Gollub <dgollub@suse.de> 00005 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License version 2 as published by the Free Software Foundation. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 00021 */ 00022 00023 #ifndef SOLID_CONTROL_BLUETOOTHMANAGER_H 00024 #define SOLID_CONTROL_BLUETOOTHMANAGER_H 00025 00026 #include <QtCore/QObject> 00027 00028 #include "singletondefs.h" 00029 #include "solid_control_export.h" 00030 00031 #include "bluetoothinterface.h" 00032 #include "bluetoothinputdevice.h" 00033 00034 class KJob; 00035 00036 namespace Solid 00037 { 00038 namespace Control 00039 { 00040 namespace Ifaces 00041 { 00042 class BluetoothManager; 00043 } 00044 00045 class BluetoothInterface; 00046 class BluetoothSecurity; 00047 00048 typedef QList<BluetoothInterface> BluetoothInterfaceList; 00049 typedef QList<BluetoothInputDevice> BluetoothInputDeviceList; 00050 class BluetoothManagerPrivate; 00051 00059 class SOLIDCONTROL_EXPORT BluetoothManager : public QObject 00060 { 00061 Q_OBJECT 00062 SOLID_SINGLETON(BluetoothManager) 00063 00064 public: 00071 BluetoothInterfaceList bluetoothInterfaces() const; 00072 00079 QString defaultInterface() const; 00080 00087 BluetoothInterface findBluetoothInterface(const QString & ubi) const; 00088 00089 00096 BluetoothInputDevice findBluetoothInputDevice(const QString & ubi) const; 00097 00104 BluetoothInputDeviceList bluetoothInputDevices() const; 00105 00112 BluetoothInputDevice *createBluetoothInputDevice(const QString &ubi); 00113 00120 KJob *setupInputDevice(const QString &ubi); 00121 00125 BluetoothSecurity *security(const QString &interface = QString()); 00126 00127 public Q_SLOTS: 00133 void removeInputDevice(const QString & ubi); 00134 00135 Q_SIGNALS: 00141 void interfaceAdded(const QString & ubi); 00142 00148 void interfaceRemoved(const QString & ubi); 00149 00155 void defaultInterfaceChanged(const QString & ubi); 00156 00162 void inputDeviceCreated(const QString & ubi); 00163 00169 void inputDeviceRemoved(const QString & ubi); 00170 00171 00172 private: 00173 BluetoothManager(); 00174 ~BluetoothManager(); 00175 00176 BluetoothInterfaceList buildDeviceList(const QStringList & ubiList) const; 00177 00178 Q_PRIVATE_SLOT(d, void _k_interfaceAdded(const QString &)) 00179 Q_PRIVATE_SLOT(d, void _k_interfaceRemoved(const QString &)) 00180 Q_PRIVATE_SLOT(d, void _k_interfaceDestroyed(QObject *)) 00181 00182 Q_PRIVATE_SLOT(d, void _k_inputDeviceCreated(const QString &)) 00183 Q_PRIVATE_SLOT(d, void _k_inputDeviceRemoved(const QString &)) 00184 Q_PRIVATE_SLOT(d, void _k_inputDeviceDestroyed(QObject *)) 00185 00186 BluetoothManagerPrivate * const d; 00187 friend class BluetoothManagerPrivate; 00188 }; 00189 } // Control 00190 } // Solid 00191 00192 #endif