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 | * Represents vlan setting |
21 | */ |
22 | class NETWORKMANAGERQT_EXPORT VlanSetting : public Setting |
23 | { |
24 | public: |
25 | typedef QSharedPointer<VlanSetting> Ptr; |
26 | typedef QList<Ptr> List; |
27 | enum Flag { |
28 | None = 0, |
29 | = 0x1, |
30 | Gvrp = 0x2, |
31 | LooseBinding = 0x4, |
32 | }; |
33 | Q_DECLARE_FLAGS(Flags, Flag) |
34 | |
35 | VlanSetting(); |
36 | explicit VlanSetting(const Ptr &other); |
37 | ~VlanSetting() override; |
38 | |
39 | QString name() const override; |
40 | |
41 | /// @deprecated in favor of connection.interface-name in NM 1.0.0 |
42 | void setInterfaceName(const QString &name); |
43 | QString interfaceName() const; |
44 | |
45 | void setParent(const QString &parent); |
46 | QString parent() const; |
47 | |
48 | void setId(quint32 id); |
49 | quint32 id() const; |
50 | |
51 | void setFlags(Flags flags); |
52 | Flags flags() const; |
53 | |
54 | void setIngressPriorityMap(const QStringList &map); |
55 | QStringList ingressPriorityMap() const; |
56 | |
57 | void setEgressPriorityMap(const QStringList &map); |
58 | QStringList egressPriorityMap() const; |
59 | |
60 | void fromMap(const QVariantMap &setting) override; |
61 | |
62 | QVariantMap toMap() const override; |
63 | |
64 | protected: |
65 | VlanSettingPrivate *d_ptr; |
66 | |
67 | private: |
68 | Q_DECLARE_PRIVATE(VlanSetting) |
69 | }; |
70 | Q_DECLARE_OPERATORS_FOR_FLAGS(VlanSetting::Flags) |
71 | |
72 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const VlanSetting &setting); |
73 | |
74 | } |
75 | |
76 | #endif // NETWORKMANAGERQT_VLAN_SETTING_H |
77 | |