1/*
2 SPDX-FileCopyrightText: 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_DEVICE_H
8#define NETWORKMANAGERQT_VLAN_DEVICE_H
9
10#include "device.h"
11#include <networkmanagerqt/networkmanagerqt_export.h>
12
13namespace NetworkManager
14{
15class VlanDevicePrivate;
16
17/**
18 * A vlan device interface
19 */
20class NETWORKMANAGERQT_EXPORT VlanDevice : public Device
21{
22 Q_OBJECT
23 Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged)
24 Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged)
25 Q_PROPERTY(uint vlanId READ vlanId NOTIFY vlanIdChanged)
26 Q_PROPERTY(NetworkManager::Device::Ptr parent READ parent NOTIFY parentChanged)
27
28public:
29 typedef QSharedPointer<VlanDevice> Ptr;
30 typedef QList<Ptr> List;
31
32 explicit VlanDevice(const QString &path, QObject *parent = nullptr);
33 ~VlanDevice() override;
34
35 Type type() const override;
36
37 /**
38 * Indicates whether the physical carrier is found
39 */
40 bool carrier() const;
41 /**
42 * Hardware address of the device
43 */
44 QString hwAddress() const;
45 /**
46 * The parent device of this VLAN device
47 * @since 5.8.0
48 */
49 NetworkManager::Device::Ptr parent() const;
50 /**
51 * The VLAN ID of this VLAN interface
52 */
53 uint vlanId() const;
54
55Q_SIGNALS:
56 /**
57 * Emitted when the carrier of this device has changed
58 */
59 void carrierChanged(bool plugged);
60 /**
61 * Emitted when the hardware address of this device has changed
62 */
63 void hwAddressChanged(const QString &address);
64 /**
65 * Emitted when the parent device of this device has changed
66 */
67 void parentChanged(const QString &path);
68 /**
69 * Emitted when the VLAN ID of this device has changed
70 */
71 void vlanIdChanged(uint id);
72
73private:
74 Q_DECLARE_PRIVATE(VlanDevice)
75};
76
77}
78
79#endif
80

source code of networkmanager-qt/src/vlandevice.h