| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2012-2013 Jan Grulich <jgrulich@redhat.com> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 | */ |
| 6 | |
| 7 | #ifndef NETWORKMANAGERQT_VLAN_SETTING_H |
| 8 | #define NETWORKMANAGERQT_VLAN_SETTING_H |
| 9 | |
| 10 | #include "setting.h" |
| 11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
| 12 | |
| 13 | #include <QString> |
| 14 | |
| 15 | namespace NetworkManager |
| 16 | { |
| 17 | class VlanSettingPrivate; |
| 18 | |
| 19 | /*! |
| 20 | * \class NetworkManager::VlanSetting |
| 21 | * \inheaderfile NetworkManagerQt/VlanSetting |
| 22 | * \inmodule NetworkManagerQt |
| 23 | * |
| 24 | * \brief Represents vlan setting. |
| 25 | */ |
| 26 | class NETWORKMANAGERQT_EXPORT VlanSetting : public Setting |
| 27 | { |
| 28 | public: |
| 29 | /*! |
| 30 | * \typedef NetworkManager::VlanSetting::Ptr |
| 31 | */ |
| 32 | typedef QSharedPointer<VlanSetting> Ptr; |
| 33 | /*! |
| 34 | * \typedef NetworkManager::VlanSetting::List |
| 35 | */ |
| 36 | typedef QList<Ptr> List; |
| 37 | /*! |
| 38 | * |
| 39 | * \value None |
| 40 | * \value ReorderHeaders |
| 41 | * \value Gvrp |
| 42 | * \value LooseBinding |
| 43 | */ |
| 44 | enum Flag { |
| 45 | None = 0, |
| 46 | = 0x1, |
| 47 | Gvrp = 0x2, |
| 48 | LooseBinding = 0x4, |
| 49 | }; |
| 50 | Q_DECLARE_FLAGS(Flags, Flag) |
| 51 | |
| 52 | /*! |
| 53 | */ |
| 54 | VlanSetting(); |
| 55 | /*! |
| 56 | */ |
| 57 | explicit VlanSetting(const Ptr &other); |
| 58 | ~VlanSetting() override; |
| 59 | |
| 60 | QString name() const override; |
| 61 | |
| 62 | /*! \deprecated in favor of connection.interface-name in NM 1.0.0 */ |
| 63 | void setInterfaceName(const QString &name); |
| 64 | /*! |
| 65 | */ |
| 66 | QString interfaceName() const; |
| 67 | |
| 68 | /*! |
| 69 | */ |
| 70 | void setParent(const QString &parent); |
| 71 | /*! |
| 72 | */ |
| 73 | QString parent() const; |
| 74 | |
| 75 | /*! |
| 76 | */ |
| 77 | void setId(quint32 id); |
| 78 | /*! |
| 79 | */ |
| 80 | quint32 id() const; |
| 81 | |
| 82 | /*! |
| 83 | */ |
| 84 | void setFlags(Flags flags); |
| 85 | /*! |
| 86 | */ |
| 87 | Flags flags() const; |
| 88 | |
| 89 | /*! |
| 90 | */ |
| 91 | void setIngressPriorityMap(const QStringList &map); |
| 92 | /*! |
| 93 | */ |
| 94 | QStringList ingressPriorityMap() const; |
| 95 | |
| 96 | /*! |
| 97 | */ |
| 98 | void setEgressPriorityMap(const QStringList &map); |
| 99 | /*! |
| 100 | */ |
| 101 | QStringList egressPriorityMap() const; |
| 102 | |
| 103 | void fromMap(const QVariantMap &setting) override; |
| 104 | |
| 105 | QVariantMap toMap() const override; |
| 106 | |
| 107 | protected: |
| 108 | VlanSettingPrivate *d_ptr; |
| 109 | |
| 110 | private: |
| 111 | Q_DECLARE_PRIVATE(VlanSetting) |
| 112 | }; |
| 113 | Q_DECLARE_OPERATORS_FOR_FLAGS(VlanSetting::Flags) |
| 114 | |
| 115 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const VlanSetting &setting); |
| 116 | |
| 117 | } |
| 118 | |
| 119 | #endif // NETWORKMANAGERQT_VLAN_SETTING_H |
| 120 | |