File indexing completed on 2024-03-24 04:03:02

0001 /*
0002     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef NETWORKMANAGERQT_VLAN_DEVICE_H
0008 #define NETWORKMANAGERQT_VLAN_DEVICE_H
0009 
0010 #include "device.h"
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 namespace NetworkManager
0014 {
0015 class VlanDevicePrivate;
0016 
0017 /**
0018  * A vlan device interface
0019  */
0020 class NETWORKMANAGERQT_EXPORT VlanDevice : public Device
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged)
0024     Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged)
0025     Q_PROPERTY(uint vlanId READ vlanId NOTIFY vlanIdChanged)
0026     Q_PROPERTY(NetworkManager::Device::Ptr parent READ parent NOTIFY parentChanged)
0027 
0028 public:
0029     typedef QSharedPointer<VlanDevice> Ptr;
0030     typedef QList<Ptr> List;
0031 
0032     explicit VlanDevice(const QString &path, QObject *parent = nullptr);
0033     ~VlanDevice() override;
0034 
0035     Type type() const override;
0036 
0037     /**
0038      * Indicates whether the physical carrier is found
0039      */
0040     bool carrier() const;
0041     /**
0042      * Hardware address of the device
0043      */
0044     QString hwAddress() const;
0045     /**
0046      * The parent device of this VLAN device
0047      * @since 5.8.0
0048      */
0049     NetworkManager::Device::Ptr parent() const;
0050     /**
0051      * The VLAN ID of this VLAN interface
0052      */
0053     uint vlanId() const;
0054 
0055 Q_SIGNALS:
0056     /**
0057      * Emitted when the carrier of this device has changed
0058      */
0059     void carrierChanged(bool plugged);
0060     /**
0061      * Emitted when the hardware address of this device has changed
0062      */
0063     void hwAddressChanged(const QString &address);
0064     /**
0065      * Emitted when the parent device of this device has changed
0066      */
0067     void parentChanged(const QString &path);
0068     /**
0069      * Emitted when the VLAN ID of this device has changed
0070      */
0071     void vlanIdChanged(uint id);
0072 
0073 private:
0074     Q_DECLARE_PRIVATE(VlanDevice)
0075 };
0076 
0077 }
0078 
0079 #endif