| 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 | * \class NetworkManager::WirelessSetting |
| 22 | * \inheaderfile NetworkManagerQt/WirelessSetting |
| 23 | * \inmodule NetworkManagerQt |
| 24 | * |
| 25 | * \brief Represents wireless setting. |
| 26 | */ |
| 27 | class NETWORKMANAGERQT_EXPORT WirelessSetting : public Setting |
| 28 | { |
| 29 | public: |
| 30 | /*! |
| 31 | * \typedef NetworkManager::WirelessSetting::Ptr |
| 32 | */ |
| 33 | typedef QSharedPointer<WirelessSetting> Ptr; |
| 34 | /*! |
| 35 | * \typedef NetworkManager::WirelessSetting::List |
| 36 | */ |
| 37 | typedef QList<Ptr> List; |
| 38 | |
| 39 | /*! |
| 40 | * |
| 41 | * \value Infrastructure |
| 42 | * \value Adhoc |
| 43 | * \value Ap |
| 44 | */ |
| 45 | enum NetworkMode { |
| 46 | Infrastructure, |
| 47 | Adhoc, |
| 48 | Ap, |
| 49 | }; |
| 50 | |
| 51 | /*! |
| 52 | * |
| 53 | * \value Automatic |
| 54 | * \value A |
| 55 | * \value Bg |
| 56 | */ |
| 57 | enum FrequencyBand { |
| 58 | Automatic, |
| 59 | A, |
| 60 | Bg, |
| 61 | }; |
| 62 | |
| 63 | /*! |
| 64 | * |
| 65 | * \value PowerSaveDefault |
| 66 | * \value PowerSaveIgnore |
| 67 | * \value PowerSaveDisable |
| 68 | * \value PowerSaveEnable |
| 69 | */ |
| 70 | enum PowerSave { |
| 71 | PowerSaveDefault = 0, |
| 72 | PowerSaveIgnore = 1, |
| 73 | PowerSaveDisable = 2, |
| 74 | PowerSaveEnable = 3, |
| 75 | }; |
| 76 | |
| 77 | /*! |
| 78 | */ |
| 79 | WirelessSetting(); |
| 80 | /*! |
| 81 | */ |
| 82 | explicit WirelessSetting(const Ptr &setting); |
| 83 | ~WirelessSetting() override; |
| 84 | |
| 85 | QString name() const override; |
| 86 | |
| 87 | /*! |
| 88 | */ |
| 89 | void setSsid(const QByteArray &ssid); |
| 90 | /*! |
| 91 | */ |
| 92 | QByteArray ssid() const; |
| 93 | |
| 94 | /*! |
| 95 | */ |
| 96 | void setMode(NetworkMode mode); |
| 97 | /*! |
| 98 | */ |
| 99 | NetworkMode mode() const; |
| 100 | |
| 101 | /*! |
| 102 | */ |
| 103 | void setBand(FrequencyBand band); |
| 104 | /*! |
| 105 | */ |
| 106 | FrequencyBand band() const; |
| 107 | |
| 108 | /*! |
| 109 | */ |
| 110 | void setChannel(quint32 channel); |
| 111 | /*! |
| 112 | */ |
| 113 | quint32 channel() const; |
| 114 | |
| 115 | /*! |
| 116 | */ |
| 117 | void setBssid(const QByteArray &bssid); |
| 118 | /*! |
| 119 | */ |
| 120 | QByteArray bssid() const; |
| 121 | |
| 122 | /*! |
| 123 | */ |
| 124 | void setRate(quint32 rate); |
| 125 | /*! |
| 126 | */ |
| 127 | quint32 rate() const; |
| 128 | |
| 129 | /*! |
| 130 | */ |
| 131 | void setTxPower(quint32 power); |
| 132 | /*! |
| 133 | */ |
| 134 | quint32 txPower() const; |
| 135 | |
| 136 | /*! |
| 137 | */ |
| 138 | void setAssignedMacAddress(const QString &assignedMacAddress); |
| 139 | /*! |
| 140 | */ |
| 141 | QString assignedMacAddress() const; |
| 142 | |
| 143 | /*! |
| 144 | */ |
| 145 | void setMacAddress(const QByteArray &address); |
| 146 | /*! |
| 147 | */ |
| 148 | QByteArray macAddress() const; |
| 149 | |
| 150 | /*! \deprecated [NM 1.4.0], will internally use assigned-mac-address property */ |
| 151 | void setClonedMacAddress(const QByteArray &address); |
| 152 | /*! |
| 153 | */ |
| 154 | QByteArray clonedMacAddress() const; |
| 155 | |
| 156 | /*! |
| 157 | */ |
| 158 | void setGenerateMacAddressMask(const QString &macAddressMask); |
| 159 | /*! |
| 160 | */ |
| 161 | QString generateMacAddressMask() const; |
| 162 | |
| 163 | /*! |
| 164 | */ |
| 165 | void setMacAddressBlacklist(const QStringList &list); |
| 166 | /*! |
| 167 | */ |
| 168 | QStringList macAddressBlacklist() const; |
| 169 | |
| 170 | /*! |
| 171 | */ |
| 172 | void setMacAddressRandomization(MacAddressRandomization randomization); |
| 173 | /*! |
| 174 | */ |
| 175 | MacAddressRandomization macAddressRandomization() const; |
| 176 | |
| 177 | /*! |
| 178 | */ |
| 179 | void setMtu(quint32 mtu); |
| 180 | /*! |
| 181 | */ |
| 182 | quint32 mtu() const; |
| 183 | |
| 184 | /*! |
| 185 | */ |
| 186 | void setSeenBssids(const QStringList &list); |
| 187 | /*! |
| 188 | */ |
| 189 | QStringList seenBssids() const; |
| 190 | |
| 191 | /*! |
| 192 | */ |
| 193 | void setPowerSave(PowerSave powersave); |
| 194 | /*! |
| 195 | */ |
| 196 | PowerSave powerSave() const; |
| 197 | |
| 198 | /*! \deprecated [NM 1.0.0] */ |
| 199 | void setSecurity(const QString &security); |
| 200 | /*! |
| 201 | */ |
| 202 | QString security() const; |
| 203 | |
| 204 | /*! |
| 205 | */ |
| 206 | void setHidden(bool hidden); |
| 207 | /*! |
| 208 | */ |
| 209 | bool hidden() const; |
| 210 | |
| 211 | void fromMap(const QVariantMap &setting) override; |
| 212 | |
| 213 | QVariantMap toMap() const override; |
| 214 | |
| 215 | protected: |
| 216 | WirelessSettingPrivate *d_ptr; |
| 217 | |
| 218 | private: |
| 219 | Q_DECLARE_PRIVATE(WirelessSetting) |
| 220 | }; |
| 221 | |
| 222 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const WirelessSetting &setting); |
| 223 | |
| 224 | } |
| 225 | |
| 226 | #endif // NETWORKMANAGERQT_WIRELESS_SETTING_H |
| 227 | |