1/*
2 SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_VPNPLUGIN_H
8#define NETWORKMANAGERQT_VPNPLUGIN_H
9
10#include "generictypes.h"
11#include "vpnconnection.h"
12#include <networkmanagerqt/networkmanagerqt_export.h>
13
14#include <QObject>
15
16namespace NetworkManager
17{
18class VpnPluginPrivate;
19
20class NETWORKMANAGERQT_EXPORT VpnPlugin : public QObject
21{
22 Q_OBJECT
23
24public:
25 enum FailureType {
26 LoginFailed,
27 ConnectFailed,
28 BadIpConfig,
29 };
30
31 explicit VpnPlugin(const QString &path, QObject *parent = nullptr);
32 ~VpnPlugin() override;
33
34Q_SIGNALS:
35 void configChanged(const QVariantMap &configuration);
36 void failureChanged(uint reason);
37 void ip4ConfigChanged(const QVariantMap &ip4config);
38 void ip6ConfigChanged(const QVariantMap &ip6config);
39 void loginBannerChanged(const QString &banner);
40 void stateChanged(VpnConnection::State state);
41
42protected Q_SLOTS:
43 void connect(const NMVariantMapMap &connection);
44 void disconnect();
45 QString needSecrets(const NMVariantMapMap &connection);
46 void setConfig(const QVariantMap &config);
47 void setFailure(const QString &reason);
48 void setIp4Config(const QVariantMap &config);
49 void setIp6Config(const QVariantMap &config);
50 void onStateChanged(uint state);
51
52protected:
53 VpnPluginPrivate *const d_ptr;
54
55private:
56 Q_DECLARE_PRIVATE(VpnPlugin)
57};
58
59} // namespace NetworkManager
60
61#endif // NETWORKMANAGERQT_VPNPLUGIN_H
62

source code of networkmanager-qt/src/vpnplugin.h