File indexing completed on 2024-04-14 14:30:35

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_BRIDGE_DEVICE_H
0008 #define NETWORKMANAGERQT_BRIDGE_DEVICE_H
0009 
0010 #include "device.h"
0011 #include <networkmanagerqt/networkmanagerqt_export.h>
0012 
0013 namespace NetworkManager
0014 {
0015 class BridgeDevicePrivate;
0016 
0017 /**
0018  * A bridge device interface
0019  */
0020 class NETWORKMANAGERQT_EXPORT BridgeDevice : 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(QStringList slaves READ slaves NOTIFY slavesChanged)
0026 
0027 public:
0028     typedef QSharedPointer<BridgeDevice> Ptr;
0029     typedef QList<Ptr> List;
0030     explicit BridgeDevice(const QString &path, QObject *parent = nullptr);
0031     ~BridgeDevice() override;
0032 
0033     Type type() const override;
0034 
0035     /**
0036      * Indicates whether the physical carrier is found
0037      */
0038     bool carrier() const;
0039     /**
0040      * Hardware address of the device
0041      */
0042     QString hwAddress() const;
0043     /**
0044      * Array of object paths representing devices which are currently slaved to this device
0045      */
0046     QStringList slaves() const;
0047 
0048 Q_SIGNALS:
0049     /**
0050      * Emitted when the carrier of this device has changed
0051      */
0052     void carrierChanged(bool plugged);
0053     /**
0054      * Emitted when the hardware address of this device has changed
0055      */
0056     void hwAddressChanged(const QString &address);
0057     /**
0058      * Emitted when the slaves of this device have changed
0059      */
0060     void slavesChanged(const QStringList &slaves);
0061 
0062 private:
0063     Q_DECLARE_PRIVATE(BridgeDevice)
0064 };
0065 
0066 }
0067 
0068 #endif