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 | |
16 | namespace NetworkManager |
17 | { |
18 | class VpnPluginPrivate; |
19 | |
20 | /*! |
21 | * \class NetworkManager::VpnPlugin |
22 | * \inheaderfile NetworkManagerQt/VpnPlugin |
23 | * \inmodule NetworkManagerQt |
24 | */ |
25 | class NETWORKMANAGERQT_EXPORT VpnPlugin : public QObject |
26 | { |
27 | Q_OBJECT |
28 | |
29 | public: |
30 | /*! |
31 | * \value LoginFailed |
32 | * \value ConnectFailed |
33 | * \value BadIpConfig |
34 | */ |
35 | enum FailureType { |
36 | LoginFailed, |
37 | ConnectFailed, |
38 | BadIpConfig, |
39 | }; |
40 | |
41 | /*! |
42 | */ |
43 | explicit VpnPlugin(const QString &path, QObject *parent = nullptr); |
44 | ~VpnPlugin() override; |
45 | |
46 | Q_SIGNALS: |
47 | /*! |
48 | */ |
49 | void configChanged(const QVariantMap &configuration); |
50 | /*! |
51 | */ |
52 | void failureChanged(uint reason); |
53 | /*! |
54 | */ |
55 | void ip4ConfigChanged(const QVariantMap &ip4config); |
56 | /*! |
57 | */ |
58 | void ip6ConfigChanged(const QVariantMap &ip6config); |
59 | /*! |
60 | */ |
61 | void loginBannerChanged(const QString &banner); |
62 | /*! |
63 | */ |
64 | void stateChanged(VpnConnection::State state); |
65 | |
66 | protected Q_SLOTS: |
67 | /*! |
68 | */ |
69 | void connect(const NMVariantMapMap &connection); |
70 | /*! |
71 | */ |
72 | void disconnect(); |
73 | /*! |
74 | */ |
75 | QString needSecrets(const NMVariantMapMap &connection); |
76 | /*! |
77 | */ |
78 | void setConfig(const QVariantMap &config); |
79 | /*! |
80 | */ |
81 | void setFailure(const QString &reason); |
82 | /*! |
83 | */ |
84 | void setIp4Config(const QVariantMap &config); |
85 | /*! |
86 | */ |
87 | void setIp6Config(const QVariantMap &config); |
88 | /*! |
89 | */ |
90 | void onStateChanged(uint state); |
91 | |
92 | protected: |
93 | VpnPluginPrivate *const d_ptr; |
94 | |
95 | private: |
96 | Q_DECLARE_PRIVATE(VpnPlugin) |
97 | }; |
98 | |
99 | } // namespace NetworkManager |
100 | |
101 | #endif // NETWORKMANAGERQT_VPNPLUGIN_H |
102 | |