not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / solid / control / bluetoothsecurity.cpp
blob61c414e42063fe9c739b4b5a4e845e66fd5fcf0d
1 /* This file is part of the KDE project
2 Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
3 Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
4 Copyright (C) 2007 Juan González <jaguilera@opsiland.info>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #include <QMetaMethod>
23 #include <QMap>
24 #include <QPair>
25 #include <QStringList>
27 #include "ifaces/bluetoothsecurity.h"
29 #include "soliddefs_p.h"
31 #include "bluetoothmanager.h"
32 #include "bluetoothsecurity.h"
33 #include "bluetoothremotedevice.h"
35 #include "frontendobject_p.h"
36 #include "managerbase_p.h"
38 namespace Solid
40 namespace Control
42 class BluetoothSecurityPrivate: public FrontendObjectPrivate
44 public:
45 BluetoothSecurityPrivate(QObject *parent)
46 :FrontendObjectPrivate(parent){};
47 QList<BluetoothPasskeyAgent *> registeredAgents;
49 } //Control
50 } //Solid
52 Solid::Control::BluetoothSecurity::BluetoothSecurity()
53 :QObject(0),d(new BluetoothSecurityPrivate(this))
57 Solid::Control::BluetoothSecurity::BluetoothSecurity(QObject *backendObject)
58 :QObject(backendObject),d(new BluetoothSecurityPrivate(this))
60 d->setBackendObject(backendObject);
63 Solid::Control::BluetoothSecurity::~BluetoothSecurity()
67 Solid::Control::BluetoothSecurity &Solid::Control::BluetoothSecurity::operator=(const Solid::Control::BluetoothSecurity & dev)
69 if (dev.d) {
70 d->setBackendObject(dev.d->backendObject());
72 //FIXME We are loosing the reference to the agents here...
73 return *this;
76 void Solid::Control::BluetoothSecurity::setPasskeyAgent(Solid::Control::BluetoothPasskeyAgent * agent)
78 SOLID_CALL(Solid::Control::Ifaces::BluetoothSecurity *,d->backendObject(),setPasskeyAgent(agent))
81 void Solid::Control::BluetoothSecurity::setAuthorizationAgent(Solid::Control::BluetoothAuthorizationAgent * agent)
83 SOLID_CALL(Solid::Control::Ifaces::BluetoothSecurity *,d->backendObject(),setAuthorizationAgent(agent))
85 /****************************** BluetoothPasskeyAgent implementation ******************************/
86 Solid::Control::BluetoothPasskeyAgent::BluetoothPasskeyAgent(QObject * parent,const QString &interface)
87 :QObject(parent)
89 //TODO Auto register all subclasses on BluetoothSecurity?
92 QString Solid::Control::BluetoothPasskeyAgent::remote()
94 return m_remote;
97 QString Solid::Control::BluetoothPasskeyAgent::requestPasskey(const QString & ubi, bool isNumeric)
99 Q_UNUSED(ubi)
100 Q_UNUSED(isNumeric)
101 return "";
104 bool Solid::Control::BluetoothPasskeyAgent::confirmPasskey(const QString & ubi, const QString & passkey)
106 Q_UNUSED(ubi)
107 Q_UNUSED(passkey)
108 return false;
111 void Solid::Control::BluetoothPasskeyAgent::displayPasskey(const QString & ubi, const QString & passkey)
113 Q_UNUSED(ubi)
114 Q_UNUSED(passkey)
117 void Solid::Control::BluetoothPasskeyAgent::keypress(const QString & ubi)
119 Q_UNUSED(ubi)
122 void Solid::Control::BluetoothPasskeyAgent::completedAuthentication(const QString & ubi)
124 Q_UNUSED(ubi)
127 void Solid::Control::BluetoothPasskeyAgent::cancelAuthentication(const QString & ubi)
129 Q_UNUSED(ubi)
131 /****************************** BluetoothAuthorizationAgent implementation ******************************/
133 Solid::Control::BluetoothAuthorizationAgent::BluetoothAuthorizationAgent(QObject * parent)
134 :QObject(parent)
139 #include "bluetoothsecurity.moc"