File indexing completed on 2024-06-16 05:09:28

0001 /*
0002     SPDX-FileCopyrightText: 2019 Bruce Anderson <banderson19com@san.rr.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_WIREGUARD_TAB_WIDGET_H
0008 #define PLASMA_NM_WIREGUARD_TAB_WIDGET_H
0009 
0010 #include "plasmanm_editor_export.h"
0011 
0012 #include <QDialog>
0013 
0014 #include <NetworkManagerQt/WireguardSetting>
0015 
0016 class PLASMANM_EDITOR_EXPORT WireGuardTabWidget : public QDialog
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit WireGuardTabWidget(const NMVariantMapList &peerData, QWidget *parent = nullptr, Qt::WindowFlags f = {});
0022     ~WireGuardTabWidget() override;
0023 
0024     enum EndPointValid { BothValid, AddressValid, PortValid, BothInvalid };
0025 
0026     void loadConfig(const NMVariantMapList &peerData);
0027 
0028     NMVariantMapList setting() const;
0029 
0030     void slotAddPeer();
0031     void slotAddPeerWithData(const QVariantMap &peerData);
0032     void slotRemovePeer();
0033 
0034 private:
0035     void slotWidgetChanged();
0036 
0037     class Private;
0038     Private *const d;
0039 };
0040 
0041 #endif // PLASMA_NM_WIREGUARD_TAB_WIDGET_H