File indexing completed on 2024-12-01 11:13:08

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_SECURITY8021X_H
0008 #define PLASMA_NM_SECURITY8021X_H
0009 
0010 #include <QRegularExpressionValidator>
0011 #include <QWidget>
0012 
0013 #include <NetworkManagerQt/Security8021xSetting>
0014 
0015 #include "passwordfield.h"
0016 #include "settingwidget.h"
0017 
0018 namespace Ui
0019 {
0020 class Security8021x;
0021 }
0022 
0023 class Q_DECL_EXPORT Security8021x : public SettingWidget
0024 {
0025     Q_OBJECT
0026 public:
0027     enum Type { Ethernet = 0, WirelessWpaEap, WirelessWpaEapSuiteB192 };
0028 
0029     explicit Security8021x(const NetworkManager::Setting::Ptr &setting = NetworkManager::Setting::Ptr(),
0030                            Type type = WirelessWpaEap,
0031                            QWidget *parent = nullptr,
0032                            Qt::WindowFlags f = {});
0033     ~Security8021x() override;
0034 
0035     void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
0036     void loadSecrets(const NetworkManager::Setting::Ptr &setting) override;
0037 
0038     QVariantMap setting() const override;
0039 
0040     bool isValid() const override;
0041 
0042     void setPasswordOption(PasswordField::PasswordOption option);
0043 
0044 private Q_SLOTS:
0045     void altSubjectMatchesButtonClicked();
0046     void connectToServersButtonClicked();
0047     void currentAuthChanged(int index);
0048 
0049 private:
0050     NetworkManager::Security8021xSetting::Ptr m_setting;
0051     Ui::Security8021x *const m_ui;
0052     QRegularExpressionValidator *altSubjectValidator = nullptr;
0053     QRegularExpressionValidator *serversValidator = nullptr;
0054 };
0055 
0056 #endif // SECURITY8021X_H