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
15namespace NetworkManager
16{
17class GsmSettingPrivate;
18
19/**
20 * Represents gsm setting
21 */
22class NETWORKMANAGERQT_EXPORT GsmSetting : public Setting
23{
24public:
25 typedef QSharedPointer<GsmSetting> Ptr;
26 typedef QList<Ptr> List;
27 enum NetworkType {
28 Any = -1,
29 Only3G,
30 GprsEdgeOnly,
31 Prefer3G,
32 Prefer2G,
33 Prefer4GLte,
34 Only4GLte,
35 };
36
37 GsmSetting();
38 explicit GsmSetting(const Ptr &other);
39 ~GsmSetting() override;
40
41 QString name() const override;
42
43 void setNumber(const QString &number);
44 QString number() const;
45
46 void setUsername(const QString &username);
47 QString username() const;
48
49 void setPassword(const QString &password);
50 QString password() const;
51
52 void setPasswordFlags(SecretFlags flags);
53 SecretFlags passwordFlags() const;
54
55 void setApn(const QString &apn);
56 QString apn() const;
57
58 void setNetworkId(const QString &id);
59 QString networkId() const;
60
61 /// @deprecated since NM 1.0.0
62 void setNetworkType(NetworkType type);
63 NetworkType networkType() const;
64
65 void setPin(const QString &pin);
66 QString pin() const;
67
68 void setPinFlags(SecretFlags flags);
69 SecretFlags pinFlags() const;
70
71 /// @deprecated since NM 1.0.0
72 void setAllowedBand(quint32 band);
73 quint32 allowedBand() const;
74
75 void setHomeOnly(bool homeOnly);
76 bool homeOnly() const;
77
78 void setDeviceId(const QString &id);
79 QString deviceId() const;
80
81 void setSimId(const QString &id);
82 QString simId() const;
83
84 void setSimOperatorId(const QString &id);
85 QString simOperatorId() const;
86
87 void secretsFromMap(const QVariantMap &secrets) override;
88
89 QVariantMap secretsToMap() const override;
90
91 QStringList needSecrets(bool requestNew = false) const override;
92
93 void fromMap(const QVariantMap &setting) override;
94
95 QVariantMap toMap() const override;
96
97protected:
98 GsmSettingPrivate *d_ptr;
99
100private:
101 Q_DECLARE_PRIVATE(GsmSetting)
102};
103
104NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const GsmSetting &setting);
105
106}
107
108#endif // NETWORKMANAGERQT_GSM_SETTING_H
109

source code of networkmanager-qt/src/settings/gsmsetting.h