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_WIRELESS_SETTING_H |
8 | #define NETWORKMANAGERQT_WIRELESS_SETTING_H |
9 | |
10 | #include "setting.h" |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | #include <QSharedPointer> |
14 | #include <QStringList> |
15 | |
16 | namespace NetworkManager |
17 | { |
18 | class WirelessSettingPrivate; |
19 | |
20 | /** |
21 | * Represents wireless setting |
22 | */ |
23 | class NETWORKMANAGERQT_EXPORT WirelessSetting : public Setting |
24 | { |
25 | public: |
26 | typedef QSharedPointer<WirelessSetting> Ptr; |
27 | typedef QList<Ptr> List; |
28 | |
29 | enum NetworkMode { |
30 | Infrastructure, |
31 | Adhoc, |
32 | Ap, |
33 | }; |
34 | |
35 | enum FrequencyBand { |
36 | Automatic, |
37 | A, |
38 | Bg, |
39 | }; |
40 | |
41 | enum PowerSave { |
42 | PowerSaveDefault = 0, |
43 | PowerSaveIgnore = 1, |
44 | PowerSaveDisable = 2, |
45 | PowerSaveEnable = 3, |
46 | }; |
47 | |
48 | WirelessSetting(); |
49 | explicit WirelessSetting(const Ptr &setting); |
50 | ~WirelessSetting() override; |
51 | |
52 | QString name() const override; |
53 | |
54 | void setSsid(const QByteArray &ssid); |
55 | QByteArray ssid() const; |
56 | |
57 | void setMode(NetworkMode mode); |
58 | NetworkMode mode() const; |
59 | |
60 | void setBand(FrequencyBand band); |
61 | FrequencyBand band() const; |
62 | |
63 | void setChannel(quint32 channel); |
64 | quint32 channel() const; |
65 | |
66 | void setBssid(const QByteArray &bssid); |
67 | QByteArray bssid() const; |
68 | |
69 | void setRate(quint32 rate); |
70 | quint32 rate() const; |
71 | |
72 | void setTxPower(quint32 power); |
73 | quint32 txPower() const; |
74 | |
75 | void setAssignedMacAddress(const QString &assignedMacAddress); |
76 | QString assignedMacAddress() const; |
77 | |
78 | void setMacAddress(const QByteArray &address); |
79 | QByteArray macAddress() const; |
80 | |
81 | /// @deprecated since NM 1.4.0, will internally use assigned-mac-address property |
82 | void setClonedMacAddress(const QByteArray &address); |
83 | QByteArray clonedMacAddress() const; |
84 | |
85 | void setGenerateMacAddressMask(const QString &macAddressMask); |
86 | QString generateMacAddressMask() const; |
87 | |
88 | void setMacAddressBlacklist(const QStringList &list); |
89 | QStringList macAddressBlacklist() const; |
90 | |
91 | void setMacAddressRandomization(MacAddressRandomization randomization); |
92 | MacAddressRandomization macAddressRandomization() const; |
93 | |
94 | void setMtu(quint32 mtu); |
95 | quint32 mtu() const; |
96 | |
97 | void setSeenBssids(const QStringList &list); |
98 | QStringList seenBssids() const; |
99 | |
100 | void setPowerSave(PowerSave powersave); |
101 | PowerSave powerSave() const; |
102 | |
103 | /// @deprecated since NM 1.0.0 |
104 | void setSecurity(const QString &security); |
105 | QString security() const; |
106 | |
107 | void setHidden(bool hidden); |
108 | bool hidden() const; |
109 | |
110 | void fromMap(const QVariantMap &setting) override; |
111 | |
112 | QVariantMap toMap() const override; |
113 | |
114 | protected: |
115 | WirelessSettingPrivate *d_ptr; |
116 | |
117 | private: |
118 | Q_DECLARE_PRIVATE(WirelessSetting) |
119 | }; |
120 | |
121 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const WirelessSetting &setting); |
122 | |
123 | } |
124 | |
125 | #endif // NETWORKMANAGERQT_WIRELESS_SETTING_H |
126 | |