File indexing completed on 2024-11-03 13:45:34

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003     SPDX-FileCopyrightText: 2013 Lukáš Tinkl <ltinkl@redhat.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef OPENCONNECTAUTH_H
0009 #define OPENCONNECTAUTH_H
0010 
0011 #include "settingwidget.h"
0012 
0013 #include <NetworkManagerQt/VpnSetting>
0014 
0015 #include <QString>
0016 
0017 class QLayout;
0018 struct openconnect_info;
0019 struct oc_auth_form;
0020 
0021 class OpenconnectAuthWidgetPrivate;
0022 
0023 class OpenconnectAuthWidget : public SettingWidget
0024 {
0025     Q_OBJECT
0026     Q_DECLARE_PRIVATE(OpenconnectAuthWidget)
0027 public:
0028     explicit OpenconnectAuthWidget(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent = nullptr);
0029     ~OpenconnectAuthWidget() override;
0030     virtual void readSecrets();
0031     void readConfig();
0032     QVariantMap setting() const override;
0033 
0034 private:
0035     OpenconnectAuthWidgetPrivate *const d_ptr;
0036     void acceptDialog();
0037     void addFormInfo(const QString &, const QString &);
0038     void deleteAllFromLayout(QLayout *);
0039 
0040 private Q_SLOTS:
0041     void writeNewConfig(const QString &);
0042     void validatePeerCert(const QString &, const QString &, const QString &, bool *);
0043     void processAuthForm(struct oc_auth_form *);
0044     void updateLog(const QString &, const int &);
0045     void logLevelChanged(int);
0046     void formLoginClicked();
0047     void formGroupChanged();
0048     void workerFinished(const int &);
0049     void viewServerLogToggled(bool);
0050     void connectHost();
0051     void initTokens();
0052 };
0053 
0054 #endif // OPENCONNECTAUTH_H