File indexing completed on 2024-05-05 17:42:50

0001 /*
0002     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0003     SPDX-FileCopyrightText: 2020 Douglas Kosovic <doug@uq.edu.au>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef PLASMA_NM_L2TP_IPSEC_WIDGET_H
0009 #define PLASMA_NM_L2TP_IPSEC_WIDGET_H
0010 
0011 #include <QDialog>
0012 
0013 #include <NetworkManagerQt/VpnSetting>
0014 
0015 namespace Ui
0016 {
0017 class L2tpIpsecWidget;
0018 }
0019 
0020 class L2tpIpsecWidget : public QDialog
0021 {
0022     Q_OBJECT
0023 
0024     enum AuthType { PSK = 0, TLS };
0025     enum IpsecDaemonType { NoIpsecDaemon, Libreswan, Strongswan, Openswan, UnknownIpsecDaemon };
0026 
0027 public:
0028     explicit L2tpIpsecWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr);
0029     ~L2tpIpsecWidget() override;
0030 
0031     NMStringMap setting() const;
0032     NMStringMap secrets() const;
0033 
0034     static bool hasIpsecDaemon();
0035 
0036 private Q_SLOTS:
0037     void updateStartDirUrl(const QUrl &);
0038     void setDefaultIkelifetime(bool isChecked);
0039     void setDefaultSalifetime(bool isChecked);
0040     void resizeStackedWidget(int currentIndex);
0041 
0042 private:
0043     void loadConfig(const NetworkManager::VpnSetting::Ptr &setting);
0044     Ui::L2tpIpsecWidget *const m_ui;
0045     static IpsecDaemonType m_ipsecDaemonType;
0046 };
0047 
0048 #endif // PLASMA_NM_L2TP_IPSEC_WIDGET_H