SolidModules
bluez-bluetoothsecurity.cpp
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 #include "bluez-bluetoothsecurity.h"
00020 #include <kdebug.h>
00021
00022
00023 BluezBluetoothSecurity::BluezBluetoothSecurity(QObject * parent)
00024 :Solid::Control::Ifaces::BluetoothSecurity(parent),passkeyAgent(0),authAgent(0)
00025 {
00026 kDebug() << k_funcinfo << endl;
00027 }
00028
00029 BluezBluetoothSecurity::BluezBluetoothSecurity(const QString & interface, QObject * parent)
00030 :Solid::Control::Ifaces::BluetoothSecurity(interface,parent)
00031 {
00032 kDebug() << k_funcinfo << " interface: " << interface << endl;
00033 }
00034
00035 BluezBluetoothSecurity::~ BluezBluetoothSecurity()
00036 {
00037 kDebug() << k_funcinfo << endl;
00038 }
00039
00040
00041 void BluezBluetoothSecurity::setPasskeyAgent(Solid::Control::BluetoothPasskeyAgent * agent)
00042 {
00043 if (passkeyAgent) {
00044 delete passkeyAgent;
00045 }
00046 passkeyAgent = agent;
00047 }
00048 void BluezBluetoothSecurity::setAuthorizationAgent(Solid::Control::BluetoothAuthorizationAgent * agent)
00049 {
00050 if (authAgent) {
00051 delete authAgent;
00052 }
00053 authAgent = agent;
00054 }
00055
00056
00057
00058 QString BluezBluetoothSecurity::request(const QString & address, bool numeric)
00059 {
00060 QString out;
00061 if (passkeyAgent) {
00062 out = passkeyAgent->requestPasskey(address,numeric);
00063 }
00064 return out;
00065 }
00066
00067 bool BluezBluetoothSecurity::confirm(const QString & address, const QString & value)
00068 {
00069 bool out = false;
00070 if (passkeyAgent) {
00071 out = passkeyAgent->confirmPasskey(address,value);
00072 }
00073 return out;
00074 }
00075
00076 void BluezBluetoothSecurity::display(const QString & address, const QString & value)
00077 {
00078 if (passkeyAgent) {
00079 passkeyAgent->displayPasskey(address,value);
00080 }
00081 }
00082
00083 void BluezBluetoothSecurity::complete(const QString & address)
00084 {
00085 if (passkeyAgent) {
00086 passkeyAgent->completedAuthentication(address);
00087 }
00088 }
00089
00090 void BluezBluetoothSecurity::keypress(const QString & address)
00091 {
00092 if (passkeyAgent) {
00093 passkeyAgent->keypress(address);
00094 }
00095 }
00096
00097 void BluezBluetoothSecurity::cancel(const QString & address)
00098 {
00099 if (passkeyAgent) {
00100 passkeyAgent->cancelAuthentication( address);
00101 }
00102 }
00103
00104 bool BluezBluetoothSecurity::authorize(const QString & localUbi, const QString & remoteAddress, const QString & serviceUuid)
00105 {
00106 bool out = false;
00107 if (authAgent) {
00108 out = authAgent->authorize(localUbi,remoteAddress,serviceUuid);
00109 }
00110 return out;
00111 }
00112
00113 void BluezBluetoothSecurity::cancel(const QString & localUbi, const QString & remoteAddress, const QString & serviceUuid)
00114 {
00115 if (authAgent) {
00116 authAgent->cancel(localUbi,remoteAddress,serviceUuid);
00117 }
00118 }
00119
00120 #include "bluez-bluetoothsecurity.moc"