| 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 | |
| 13 | namespace NetworkManager |
| 14 | { |
| 15 | class VlanDevicePrivate; |
| 16 | |
| 17 | /*! |
| 18 | * \class NetworkManager::VlanDevice |
| 19 | * \inheaderfile NetworkManagerQt/VlanDevice |
| 20 | * \inmodule NetworkManagerQt |
| 21 | * |
| 22 | * \brief A vlan device interface. |
| 23 | */ |
| 24 | class NETWORKMANAGERQT_EXPORT VlanDevice : public Device |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | |
| 28 | /*! |
| 29 | * \property NetworkManager::VlanDevice::carrier |
| 30 | */ |
| 31 | Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged) |
| 32 | |
| 33 | /*! |
| 34 | * \property NetworkManager::VlanDevice::hwAddress |
| 35 | */ |
| 36 | Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged) |
| 37 | |
| 38 | /*! |
| 39 | * \property NetworkManager::VlanDevice::vlanId |
| 40 | */ |
| 41 | Q_PROPERTY(uint vlanId READ vlanId NOTIFY vlanIdChanged) |
| 42 | |
| 43 | /*! |
| 44 | * \property NetworkManager::VlanDevice::parent |
| 45 | */ |
| 46 | Q_PROPERTY(NetworkManager::Device::Ptr parent READ parent NOTIFY parentChanged) |
| 47 | |
| 48 | public: |
| 49 | /*! |
| 50 | * \typedef NetworkManager::VlanDevice::Ptr |
| 51 | */ |
| 52 | typedef QSharedPointer<VlanDevice> Ptr; |
| 53 | /*! |
| 54 | * \typedef NetworkManager::VlanDevice::List |
| 55 | */ |
| 56 | typedef QList<Ptr> List; |
| 57 | |
| 58 | /*! |
| 59 | */ |
| 60 | explicit VlanDevice(const QString &path, QObject *parent = nullptr); |
| 61 | ~VlanDevice() override; |
| 62 | |
| 63 | Type type() const override; |
| 64 | |
| 65 | /*! |
| 66 | * Indicates whether the physical carrier is found |
| 67 | */ |
| 68 | bool carrier() const; |
| 69 | /*! |
| 70 | * Hardware address of the device |
| 71 | */ |
| 72 | QString hwAddress() const; |
| 73 | /*! |
| 74 | * The parent device of this VLAN device |
| 75 | * \since 5.8.0 |
| 76 | */ |
| 77 | NetworkManager::Device::Ptr parent() const; |
| 78 | /*! |
| 79 | * The VLAN ID of this VLAN interface |
| 80 | */ |
| 81 | uint vlanId() const; |
| 82 | |
| 83 | Q_SIGNALS: |
| 84 | /*! |
| 85 | * Emitted when the carrier of this device has changed |
| 86 | */ |
| 87 | void carrierChanged(bool plugged); |
| 88 | /*! |
| 89 | * Emitted when the hardware address of this device has changed |
| 90 | */ |
| 91 | void hwAddressChanged(const QString &address); |
| 92 | /*! |
| 93 | * Emitted when the parent device of this device has changed |
| 94 | */ |
| 95 | void parentChanged(const QString &path); |
| 96 | /*! |
| 97 | * Emitted when the VLAN ID of this device has changed |
| 98 | */ |
| 99 | void vlanIdChanged(uint id); |
| 100 | |
| 101 | private: |
| 102 | Q_DECLARE_PRIVATE(VlanDevice) |
| 103 | }; |
| 104 | |
| 105 | } |
| 106 | |
| 107 | #endif |
| 108 | |