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_GSM_SETTING_H |
8 | #define NETWORKMANAGERQT_GSM_SETTING_H |
9 | |
10 | #include "setting.h" |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | #include <QString> |
14 | |
15 | namespace NetworkManager |
16 | { |
17 | class GsmSettingPrivate; |
18 | |
19 | /*! |
20 | * \class NetworkManager::GsmSetting |
21 | * \inheaderfile NetworkManagerQt/GsmSetting |
22 | * \inmodule NetworkManagerQt |
23 | * |
24 | * \brief Represents gsm setting. |
25 | */ |
26 | class NETWORKMANAGERQT_EXPORT GsmSetting : public Setting |
27 | { |
28 | public: |
29 | /*! |
30 | * \typedef NetworkManager::GsmSetting::Ptr |
31 | */ |
32 | typedef QSharedPointer<GsmSetting> Ptr; |
33 | /*! |
34 | * \typedef NetworkManager::GsmSetting::List |
35 | */ |
36 | typedef QList<Ptr> List; |
37 | /*! |
38 | * \value Any |
39 | * \value Only3G |
40 | * \value GprsEdgeOnly |
41 | * \value Prefer3G |
42 | * \value Prefer2G |
43 | * \value Prefer4GLte |
44 | * \value Only4GLte |
45 | */ |
46 | enum NetworkType { |
47 | Any = -1, |
48 | Only3G, |
49 | GprsEdgeOnly, |
50 | Prefer3G, |
51 | Prefer2G, |
52 | Prefer4GLte, |
53 | Only4GLte, |
54 | }; |
55 | |
56 | /*! |
57 | */ |
58 | GsmSetting(); |
59 | /*! |
60 | */ |
61 | explicit GsmSetting(const Ptr &other); |
62 | ~GsmSetting() override; |
63 | |
64 | QString name() const override; |
65 | |
66 | /*! |
67 | */ |
68 | void setNumber(const QString &number); |
69 | /*! |
70 | */ |
71 | QString number() const; |
72 | |
73 | /*! |
74 | */ |
75 | void setUsername(const QString &username); |
76 | /*! |
77 | */ |
78 | QString username() const; |
79 | |
80 | /*! |
81 | */ |
82 | void setPassword(const QString &password); |
83 | /*! |
84 | */ |
85 | QString password() const; |
86 | |
87 | /*! |
88 | */ |
89 | void setPasswordFlags(SecretFlags flags); |
90 | /*! |
91 | */ |
92 | SecretFlags passwordFlags() const; |
93 | |
94 | /*! |
95 | */ |
96 | void setApn(const QString &apn); |
97 | /*! |
98 | */ |
99 | QString apn() const; |
100 | |
101 | /*! |
102 | */ |
103 | void setNetworkId(const QString &id); |
104 | /*! |
105 | */ |
106 | QString networkId() const; |
107 | |
108 | /*! \deprecated NM 1.0.0 */ |
109 | void setNetworkType(NetworkType type); |
110 | /*! |
111 | */ |
112 | NetworkType networkType() const; |
113 | |
114 | /*! |
115 | */ |
116 | void setPin(const QString &pin); |
117 | /*! |
118 | */ |
119 | QString pin() const; |
120 | |
121 | /*! |
122 | */ |
123 | void setPinFlags(SecretFlags flags); |
124 | /*! |
125 | */ |
126 | SecretFlags pinFlags() const; |
127 | |
128 | /*! \deprecated NM 1.0.0 */ |
129 | void setAllowedBand(quint32 band); |
130 | /*! |
131 | */ |
132 | quint32 allowedBand() const; |
133 | |
134 | /*! |
135 | */ |
136 | void setHomeOnly(bool homeOnly); |
137 | /*! |
138 | */ |
139 | bool homeOnly() const; |
140 | |
141 | /*! |
142 | */ |
143 | void setDeviceId(const QString &id); |
144 | /*! |
145 | */ |
146 | QString deviceId() const; |
147 | |
148 | /*! |
149 | */ |
150 | void setSimId(const QString &id); |
151 | /*! |
152 | */ |
153 | QString simId() const; |
154 | |
155 | /*! |
156 | */ |
157 | void setSimOperatorId(const QString &id); |
158 | /*! |
159 | */ |
160 | QString simOperatorId() const; |
161 | |
162 | void secretsFromMap(const QVariantMap &secrets) override; |
163 | |
164 | QVariantMap secretsToMap() const override; |
165 | |
166 | QStringList needSecrets(bool requestNew = false) const override; |
167 | |
168 | void fromMap(const QVariantMap &setting) override; |
169 | |
170 | QVariantMap toMap() const override; |
171 | |
172 | protected: |
173 | GsmSettingPrivate *d_ptr; |
174 | |
175 | private: |
176 | Q_DECLARE_PRIVATE(GsmSetting) |
177 | }; |
178 | |
179 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const GsmSetting &setting); |
180 | |
181 | } |
182 | |
183 | #endif // NETWORKMANAGERQT_GSM_SETTING_H |
184 | |