File indexing completed on 2024-12-01 08:10:03

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