Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / workspace / solid / bluez / bluez-bluetoothsecurity.cpp
blob7fc09669d92589930a62bad856897f14462d1a73
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Juan González <jaguilera@opsiland.info>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
19 #include "bluez-bluetoothsecurity.h"
20 #include <kdebug.h>
22 /*********************** BluezBluetoothSecurity ***********************/
23 BluezBluetoothSecurity::BluezBluetoothSecurity(QObject * parent)
24 :Solid::Control::Ifaces::BluetoothSecurity(parent),passkeyAgent(0),authAgent(0)
26 kDebug() << k_funcinfo << endl;
29 BluezBluetoothSecurity::BluezBluetoothSecurity(const QString & interface, QObject * parent)
30 :Solid::Control::Ifaces::BluetoothSecurity(interface,parent)
32 kDebug() << k_funcinfo << " interface: " << interface << endl;
35 BluezBluetoothSecurity::~ BluezBluetoothSecurity()
37 kDebug() << k_funcinfo << endl;
40 /*********************** methods from Solid::Control::BluetoothSecurity ***********************/
41 void BluezBluetoothSecurity::setPasskeyAgent(Solid::Control::BluetoothPasskeyAgent * agent)
43 if (passkeyAgent) {
44 delete passkeyAgent;
46 passkeyAgent = agent;
48 void BluezBluetoothSecurity::setAuthorizationAgent(Solid::Control::BluetoothAuthorizationAgent * agent)
50 if (authAgent) {
51 delete authAgent;
53 authAgent = agent;
57 /**************************************************************************************/
58 QString BluezBluetoothSecurity::request(const QString & address, bool numeric)
60 QString out;
61 if (passkeyAgent) {
62 out = passkeyAgent->requestPasskey(address,numeric);
64 return out;
67 bool BluezBluetoothSecurity::confirm(const QString & address, const QString & value)
69 bool out = false;
70 if (passkeyAgent) {
71 out = passkeyAgent->confirmPasskey(address,value);
73 return out;
76 void BluezBluetoothSecurity::display(const QString & address, const QString & value)
78 if (passkeyAgent) {
79 passkeyAgent->displayPasskey(address,value);
83 void BluezBluetoothSecurity::complete(const QString & address)
85 if (passkeyAgent) {
86 passkeyAgent->completedAuthentication(address);
90 void BluezBluetoothSecurity::keypress(const QString & address)
92 if (passkeyAgent) {
93 passkeyAgent->keypress(address);
97 void BluezBluetoothSecurity::cancel(const QString & address)
99 if (passkeyAgent) {
100 passkeyAgent->cancelAuthentication( address);
104 bool BluezBluetoothSecurity::authorize(const QString & localUbi, const QString & remoteAddress, const QString & serviceUuid)
106 bool out = false;
107 if (authAgent) {
108 out = authAgent->authorize(localUbi,remoteAddress,serviceUuid);
110 return out;
113 void BluezBluetoothSecurity::cancel(const QString & localUbi, const QString & remoteAddress, const QString & serviceUuid)
115 if (authAgent) {
116 authAgent->cancel(localUbi,remoteAddress,serviceUuid);
120 #include "bluez-bluetoothsecurity.moc"