~ted/indicator-network/xdg-hook

« back to all changes in this revision

Viewing changes to secret-agent/SecretAgent.h

  • Committer: Tarmac
  • Author(s): Pete Woods
  • Date: 2013-08-27 19:52:14 UTC
  • mfrom: (274.1.5 secret-agent)
  • Revision ID: tarmac-20130827195214-y2my0d0bibchvq6v
Move the secret agent code over into this package.

Approved by Charles Kerr, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Author: Pete Woods <pete.woods@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef SECRETAGENT_H_
 
20
#define SECRETAGENT_H_
 
21
 
 
22
#include <QScopedPointer>
 
23
#include <QDBusConnection>
 
24
#include <QtDBus>
 
25
#include <QMap>
 
26
 
 
27
#include <DBusTypes.h>
 
28
#include <SecretRequest.h>
 
29
#include <AgentManagerInterface.h>
 
30
 
 
31
class SecretAgentAdaptor;
 
32
 
 
33
class SecretAgent: public QObject, protected QDBusContext {
 
34
Q_OBJECT
 
35
 
 
36
public:
 
37
        static const QString WIRELESS_SECURITY_SETTING_NAME;
 
38
 
 
39
        static const QString WIRELESS_SECURITY_PSK;
 
40
        static const QString WIRELESS_SECURITY_WEP_KEY0;
 
41
 
 
42
        static const QString WIRELESS_SECURITY_KEY_MGMT;
 
43
 
 
44
        static const QString KEY_MGMT_WPA_NONE;
 
45
        static const QString KEY_MGMT_WPA_PSK;
 
46
        static const QString KEY_MGMT_NONE;
 
47
 
 
48
        explicit SecretAgent(const QDBusConnection &connection,
 
49
                        QObject *parent = 0);
 
50
 
 
51
        virtual ~SecretAgent();
 
52
 
 
53
public Q_SLOTS:
 
54
        QVariantDictMap GetSecrets(const QVariantDictMap &connection,
 
55
                        const QDBusObjectPath &connectionPath, const QString &settingName,
 
56
                        const QStringList &hints, uint flags);
 
57
 
 
58
        void FinishGetSecrets(SecretRequest &request);
 
59
 
 
60
        void CancelGetSecrets(const QDBusObjectPath &connectionPath,
 
61
                        const QString &settingName);
 
62
 
 
63
        void DeleteSecrets(const QVariantDictMap &connection,
 
64
                        const QDBusObjectPath &connectionPath);
 
65
 
 
66
        void SaveSecrets(const QVariantDictMap &connection,
 
67
                        const QDBusObjectPath &connectionPath);
 
68
 
 
69
protected:
 
70
        QScopedPointer<SecretAgentAdaptor> m_adaptor;
 
71
 
 
72
        QDBusConnection m_connection;
 
73
 
 
74
        org::freedesktop::NetworkManager::AgentManager m_agentManager;
 
75
 
 
76
        QMap<unsigned long long, SecretRequestPtr> m_requests;
 
77
 
 
78
        unsigned long long m_requestCounter;
 
79
};
 
80
 
 
81
#endif /* SECRETAGENT_H_ */