File indexing completed on 2024-12-01 05:05:06

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003     SPDX-FileCopyrightText: 2013 Lukas 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 OPENCONNECTWIDGET_H
0009 #define OPENCONNECTWIDGET_H
0010 
0011 #include "settingwidget.h"
0012 
0013 #include <NetworkManagerQt/VpnSetting>
0014 
0015 class OpenconnectSettingWidgetPrivate;
0016 
0017 class OpenconnectSettingWidget : public SettingWidget
0018 {
0019     Q_OBJECT
0020 
0021     Q_DECLARE_PRIVATE(OpenconnectSettingWidget)
0022 public:
0023     explicit OpenconnectSettingWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
0024     ~OpenconnectSettingWidget() override;
0025     void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
0026     void loadSecrets(const NetworkManager::Setting::Ptr &setting) override;
0027     QVariantMap setting() const override;
0028     bool isValid() const override;
0029     bool initTokenGroup();
0030 
0031 private Q_SLOTS:
0032     void showTokens();
0033     void handleTokenSecret(int index);
0034     void saveTokens();
0035     void restoreTokens();
0036 
0037 private:
0038     OpenconnectSettingWidgetPrivate *const d_ptr;
0039 };
0040 
0041 #endif // OPENCONNECTWIDGET_H