1 /* This file is part of the KDE project
2 Copyright (C) 2006 Kevin Ottens <ervin@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
23 #include <QCoreApplication>
26 #include <solid/storageaccess.h>
27 #include <solid/opticaldrive.h>
37 class SolidBluetooth
: public QCoreApplication
41 SolidBluetooth(int &argc
, char **argv
) : QCoreApplication(argc
, argv
), m_error(0) {}
45 bool bluetoothListAdapters();
46 bool bluetoothDefaultAdapter();
47 bool bluetoothCreateDevice(const QString
&adapterUbi
, const QString
&mac
);
48 bool bluetoothRemoveDevice(const QString
&adapterUbi
, const QString
&mac
);
49 bool bluetoothGetProperties(const QString
&adapterUbi
);
51 bool bluetoothGetRemoteName(const QString
&adapterUbi
, const QString
&mac
);
52 bool bluetoothAdapterAddress(const QString
&ubi
);
53 bool bluetoothAdapterName(const QString
&ubi
);
54 bool bluetoothAdapterSetName(const QString
&ubi
, const QString
&name
);
55 bool bluetoothAdapterMode(const QString
&ubi
);
56 bool bluetoothAdapterSetMode(const QString
&ubi
, const QString
&mode
);
57 bool bluetoothAdapterListConnections(const QString
&ubi
);
58 bool bluetoothAdapterListBondings(const QString
&ubi
);
59 bool bluetoothAdapterScan(const QString
&ubi
);
61 bool bluetoothInputListDevices();
62 bool bluetoothInputSetup(const QString
&deviceUbi
);
63 bool bluetoothInputRemoveSetup(const QString
&deviceUbi
);
64 bool bluetoothInputConnect(const QString
&deviceUbi
);
65 bool bluetoothInputDisconnect(const QString
&deviceUbi
);
67 bool bluetoothRemoteCreateBonding(const QString
&adapterUbi
, const QString
&deviceUbi
);
68 bool bluetoothRemoteRemoveBonding(const QString
&adapterUbi
, const QString
&deviceUbi
);
69 bool bluetoothRemoteHasBonding(const QString
&adapterUbi
, const QString
&deviceUbi
);
73 void connectJob(KJob
*job
);
77 QString m_errorString
;
80 void slotStorageResult(Solid::ErrorType error
, const QVariant
&errorData
);
81 void slotResult(KJob
*job
);
82 void slotPercent(KJob
*job
, unsigned long percent
);
83 void slotInfoMessage(KJob
*job
, const QString
&message
);
84 void slotBluetoothDeviceFound(const QString
&ubi
, int deviceClass
, int rssi
);
85 void slotBluetoothDiscoveryCompleted();