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>
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"
42 class BluetoothSecurityPrivate
: public FrontendObjectPrivate
45 BluetoothSecurityPrivate(QObject
*parent
)
46 :FrontendObjectPrivate(parent
){};
47 QList
<BluetoothPasskeyAgent
*> registeredAgents
;
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
)
70 d
->setBackendObject(dev
.d
->backendObject());
72 //FIXME We are loosing the reference to the agents here...
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
)
89 //TODO Auto register all subclasses on BluetoothSecurity?
92 QString
Solid::Control::BluetoothPasskeyAgent::remote()
97 QString
Solid::Control::BluetoothPasskeyAgent::requestPasskey(const QString
& ubi
, bool isNumeric
)
104 bool Solid::Control::BluetoothPasskeyAgent::confirmPasskey(const QString
& ubi
, const QString
& passkey
)
111 void Solid::Control::BluetoothPasskeyAgent::displayPasskey(const QString
& ubi
, const QString
& passkey
)
117 void Solid::Control::BluetoothPasskeyAgent::keypress(const QString
& ubi
)
122 void Solid::Control::BluetoothPasskeyAgent::completedAuthentication(const QString
& ubi
)
127 void Solid::Control::BluetoothPasskeyAgent::cancelAuthentication(const QString
& ubi
)
131 /****************************** BluetoothAuthorizationAgent implementation ******************************/
133 Solid::Control::BluetoothAuthorizationAgent::BluetoothAuthorizationAgent(QObject
* parent
)
139 #include "bluetoothsecurity.moc"