File indexing completed on 2024-09-15 13:01:30
0001 /* 0002 SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef PLASMA_NM_WIFI_SECURITY_H 0008 #define PLASMA_NM_WIFI_SECURITY_H 0009 0010 #include <QWidget> 0011 0012 #include <NetworkManagerQt/Security8021xSetting> 0013 #include <NetworkManagerQt/WirelessSecuritySetting> 0014 0015 #include "security802-1x.h" 0016 #include "settingwidget.h" 0017 0018 namespace Ui 0019 { 0020 class WifiSecurity; 0021 } 0022 0023 class Q_DECL_EXPORT WifiSecurity : public SettingWidget 0024 { 0025 Q_OBJECT 0026 public: 0027 // Keep this in sync with NetworkManager::WirelessSecurityType from 0028 // NetworkManagerQt. 0029 enum SecurityTypeIndex { None = 0, WepHex, WepPassphrase, Leap, DynamicWep, WpaPsk, WpaEap, SAE, Wpa3SuiteB192 }; 0030 0031 explicit WifiSecurity(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(), 0032 const NetworkManager::Security8021xSetting::Ptr &setting8021x = NetworkManager::Security8021xSetting::Ptr(), 0033 QWidget *parent = nullptr, 0034 Qt::WindowFlags f = {}); 0035 ~WifiSecurity() override; 0036 void loadConfig(const NetworkManager::Setting::Ptr &setting) override; 0037 void loadSecrets(const NetworkManager::Setting::Ptr &setting) override; 0038 0039 QVariantMap setting() const override; 0040 QVariantMap setting8021x() const; 0041 0042 bool enabled() const; 0043 bool enabled8021x() const; 0044 0045 bool isValid() const override; 0046 0047 void setStoreSecretsSystemWide(bool system); 0048 0049 public Q_SLOTS: 0050 void onSsidChanged(const QString &ssid); 0051 0052 private Q_SLOTS: 0053 void securityChanged(int index); 0054 void setWepKey(int keyIndex); 0055 0056 private: 0057 Ui::WifiSecurity *const m_ui; 0058 Security8021x *m_8021xWidget = nullptr; 0059 Security8021x *m_WPA2Widget = nullptr; 0060 Security8021x *m_WPA3SuiteB192Widget = nullptr; 0061 NetworkManager::WirelessSecuritySetting::Ptr m_wifiSecurity; 0062 bool m_systemWideDefault = false; 0063 }; 0064 0065 #endif // PLASMA_NM_WIFI_SECURITY_H