SolidModules
solid-bluetooth.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MAIN_H
00021 #define MAIN_H
00022
00023 #include <QCoreApplication>
00024 #include <QEventLoop>
00025
00026 #include <solid/storageaccess.h>
00027 #include <solid/opticaldrive.h>
00028
00029 class KJob;
00030
00031 namespace Solid {
00032 namespace Control {
00033 class Authentication;
00034 }
00035 }
00036
00037 class SolidBluetooth : public QCoreApplication
00038 {
00039 Q_OBJECT
00040 public:
00041 SolidBluetooth(int &argc, char **argv) : QCoreApplication(argc, argv), m_error(0) {}
00042
00043 static bool doIt();
00044
00045 bool bluetoothListAdapters();
00046 bool bluetoothDefaultAdapter();
00047 bool bluetoothGetRemoteName(const QString &adapterUbi, const QString &mac);
00048 bool bluetoothAdapterAddress(const QString &ubi);
00049 bool bluetoothAdapterName(const QString &ubi);
00050 bool bluetoothAdapterSetName(const QString &ubi, const QString &name);
00051 bool bluetoothAdapterMode(const QString &ubi);
00052 bool bluetoothAdapterSetMode(const QString &ubi, const QString &mode);
00053 bool bluetoothAdapterListConnections(const QString &ubi);
00054 bool bluetoothAdapterListBondings(const QString &ubi);
00055 bool bluetoothAdapterScan(const QString &ubi);
00056
00057 bool bluetoothInputListDevices();
00058 bool bluetoothInputSetup(const QString &deviceUbi);
00059 bool bluetoothInputRemoveSetup(const QString &deviceUbi);
00060 bool bluetoothInputConnect(const QString &deviceUbi);
00061 bool bluetoothInputDisconnect(const QString &deviceUbi);
00062
00063 bool bluetoothRemoteCreateBonding(const QString &adapterUbi, const QString &deviceUbi);
00064 bool bluetoothRemoteRemoveBonding(const QString &adapterUbi, const QString &deviceUbi);
00065 bool bluetoothRemoteHasBonding(const QString &adapterUbi, const QString &deviceUbi);
00066
00067 private:
00068 void connectJob(KJob *job);
00069
00070 QEventLoop m_loop;
00071 int m_error;
00072 QString m_errorString;
00073 private slots:
00074 void slotStorageResult(Solid::ErrorType error, const QVariant &errorData);
00075 void slotResult(KJob *job);
00076 void slotPercent(KJob *job, unsigned long percent);
00077 void slotInfoMessage(KJob *job, const QString &message);
00078 void slotBluetoothDeviceFound(const QString &ubi, int deviceClass, int rssi);
00079 void slotBluetoothDiscoveryCompleted();
00080 };
00081
00082
00083 #endif