2
* Copyright (C) 2013 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as published
6
* by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Pete Woods <pete.woods@canonical.com>
19
#ifndef SECRETAGENT_H_
20
#define SECRETAGENT_H_
22
#include <QScopedPointer>
23
#include <QDBusConnection>
27
#include <DBusTypes.h>
28
#include <SecretRequest.h>
29
#include <AgentManagerInterface.h>
31
class SecretAgentAdaptor;
33
class SecretAgent: public QObject, protected QDBusContext {
37
static const QString WIRELESS_SECURITY_SETTING_NAME;
39
static const QString WIRELESS_SECURITY_PSK;
40
static const QString WIRELESS_SECURITY_WEP_KEY0;
42
static const QString WIRELESS_SECURITY_KEY_MGMT;
44
static const QString KEY_MGMT_WPA_NONE;
45
static const QString KEY_MGMT_WPA_PSK;
46
static const QString KEY_MGMT_NONE;
48
explicit SecretAgent(const QDBusConnection &connection,
51
virtual ~SecretAgent();
54
QVariantDictMap GetSecrets(const QVariantDictMap &connection,
55
const QDBusObjectPath &connectionPath, const QString &settingName,
56
const QStringList &hints, uint flags);
58
void FinishGetSecrets(SecretRequest &request);
60
void CancelGetSecrets(const QDBusObjectPath &connectionPath,
61
const QString &settingName);
63
void DeleteSecrets(const QVariantDictMap &connection,
64
const QDBusObjectPath &connectionPath);
66
void SaveSecrets(const QVariantDictMap &connection,
67
const QDBusObjectPath &connectionPath);
70
QScopedPointer<SecretAgentAdaptor> m_adaptor;
72
QDBusConnection m_connection;
74
org::freedesktop::NetworkManager::AgentManager m_agentManager;
76
QMap<unsigned long long, SecretRequestPtr> m_requests;
78
unsigned long long m_requestCounter;
81
#endif /* SECRETAGENT_H_ */