File indexing completed on 2024-07-14 09:00:23

0001 /*
0002     SPDX-FileCopyrightText: 2011 Ilia Kats <ilia-kats@gmx.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef IPV6ROUTESWIDGET_H
0008 #define IPV6ROUTESWIDGET_H
0009 
0010 #include <QDialog>
0011 #include <QStyledItemDelegate>
0012 
0013 #include <NetworkManagerQt/IpConfig>
0014 
0015 class QStandardItem;
0016 class QItemSelection;
0017 
0018 class IpV6RoutesWidget : public QDialog
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit IpV6RoutesWidget(QWidget *parent = nullptr);
0023     ~IpV6RoutesWidget() override;
0024 
0025     void setRoutes(const QList<NetworkManager::IpRoute> &list);
0026     QList<NetworkManager::IpRoute> routes() const;
0027     void setNeverDefault(bool checked);
0028     bool neverDefault() const;
0029     void setIgnoreAutoRoutes(bool checked);
0030     void setIgnoreAutoRoutesCheckboxEnabled(bool enabled);
0031     bool ignoreautoroutes() const;
0032 
0033 private Q_SLOTS:
0034     void addRoute();
0035     void removeRoute();
0036     /**
0037      * Update remove IP button depending on if there is a selection
0038      */
0039     void selectionChanged(const QItemSelection &);
0040     void tableViewItemChanged(QStandardItem *);
0041 
0042 private:
0043     class Private;
0044     Private *const d;
0045 };
0046 
0047 #endif // IPV6ROUTESWIDGET_H