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_VPN_SETTING_H |
8 | #define NETWORKMANAGERQT_VPN_SETTING_H |
9 | |
10 | #include "setting.h" |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | #include <QString> |
14 | |
15 | namespace NetworkManager |
16 | { |
17 | class VpnSettingPrivate; |
18 | |
19 | /*! |
20 | * \class NetworkManager::VpnSetting |
21 | * \inheaderfile NetworkManagerQt/VpnSetting |
22 | * \inmodule NetworkManagerQt |
23 | * |
24 | * \brief Represents vpn setting. |
25 | */ |
26 | class NETWORKMANAGERQT_EXPORT VpnSetting : public Setting |
27 | { |
28 | public: |
29 | /*! |
30 | * \typedef NetworkManager::VpnSetting::Ptr |
31 | */ |
32 | typedef QSharedPointer<VpnSetting> Ptr; |
33 | /*! |
34 | * \typedef NetworkManager::VpnSetting::List |
35 | */ |
36 | typedef QList<Ptr> List; |
37 | /*! |
38 | */ |
39 | VpnSetting(); |
40 | /*! |
41 | */ |
42 | explicit VpnSetting(const Ptr &other); |
43 | ~VpnSetting() override; |
44 | |
45 | QString name() const override; |
46 | |
47 | /*! |
48 | */ |
49 | bool persistent() const; |
50 | /*! |
51 | */ |
52 | void setPersistent(bool persistent); |
53 | |
54 | /*! |
55 | */ |
56 | void setServiceType(const QString &type); |
57 | /*! |
58 | */ |
59 | QString serviceType() const; |
60 | |
61 | /*! |
62 | */ |
63 | uint timeout() const; |
64 | /*! |
65 | */ |
66 | void setTimeout(uint timeout); |
67 | |
68 | /*! |
69 | */ |
70 | void setUsername(const QString &username); |
71 | /*! |
72 | */ |
73 | QString username() const; |
74 | |
75 | /*! |
76 | */ |
77 | void setData(const NMStringMap &data); |
78 | /*! |
79 | */ |
80 | NMStringMap data() const; |
81 | |
82 | /*! |
83 | */ |
84 | void setSecrets(const NMStringMap &secrets); |
85 | /*! |
86 | */ |
87 | NMStringMap secrets() const; |
88 | |
89 | void secretsFromMap(const QVariantMap &secrets) override; |
90 | QVariantMap secretsToMap() const override; |
91 | |
92 | void secretsFromStringMap(const NMStringMap &map) override; |
93 | NMStringMap secretsToStringMap() const override; |
94 | |
95 | void fromMap(const QVariantMap &setting) override; |
96 | |
97 | QVariantMap toMap() const override; |
98 | |
99 | protected: |
100 | VpnSettingPrivate *d_ptr; |
101 | |
102 | private: |
103 | Q_DECLARE_PRIVATE(VpnSetting) |
104 | }; |
105 | |
106 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const VpnSetting &setting); |
107 | |
108 | } |
109 | |
110 | #endif // NETWORKMANAGERQT_VPN_SETTING_H |
111 | |