| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2013 Lukáš Tinkl <ltinkl@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_TEAM_DEVICE_H |
| 8 | #define NETWORKMANAGERQT_TEAM_DEVICE_H |
| 9 | |
| 10 | #include "device.h" |
| 11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
| 12 | |
| 13 | namespace NetworkManager |
| 14 | { |
| 15 | class TeamDevicePrivate; |
| 16 | |
| 17 | /*! |
| 18 | * \class NetworkManager::TeamDevice |
| 19 | * \inheaderfile NetworkManagerQt/TeamDevice |
| 20 | * \inmodule NetworkManagerQt |
| 21 | * |
| 22 | * \brief A team device interface. |
| 23 | */ |
| 24 | class NETWORKMANAGERQT_EXPORT TeamDevice : public Device |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | |
| 28 | /*! |
| 29 | * \property NetworkManager::TeamDevice::carrier |
| 30 | */ |
| 31 | Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged) |
| 32 | |
| 33 | /*! |
| 34 | * \property NetworkManager::TeamDevice::hwAddress |
| 35 | */ |
| 36 | Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged) |
| 37 | |
| 38 | /*! |
| 39 | * \property NetworkManager::TeamDevice::slaves |
| 40 | */ |
| 41 | Q_PROPERTY(QStringList slaves READ slaves NOTIFY slavesChanged) |
| 42 | |
| 43 | /*! |
| 44 | * \property NetworkManager::TeamDevice::config |
| 45 | */ |
| 46 | Q_PROPERTY(QString config READ config NOTIFY configChanged) |
| 47 | |
| 48 | public: |
| 49 | /*! |
| 50 | * \typedef NetworkManager::TeamDevice::Ptr |
| 51 | */ |
| 52 | typedef QSharedPointer<TeamDevice> Ptr; |
| 53 | /*! |
| 54 | * \typedef NetworkManager::TeamDevice::List |
| 55 | */ |
| 56 | typedef QList<Ptr> List; |
| 57 | |
| 58 | /*! |
| 59 | */ |
| 60 | explicit TeamDevice(const QString &path, QObject *parent = nullptr); |
| 61 | ~TeamDevice() override; |
| 62 | |
| 63 | /*! |
| 64 | */ |
| 65 | Type type() const override; |
| 66 | |
| 67 | /*! |
| 68 | * Indicates whether the physical carrier is found |
| 69 | */ |
| 70 | bool carrier() const; |
| 71 | /*! |
| 72 | * Hardware address of the device |
| 73 | */ |
| 74 | QString hwAddress() const; |
| 75 | |
| 76 | /*! |
| 77 | * Devices which are currently slaved to this device |
| 78 | */ |
| 79 | QStringList slaves() const; |
| 80 | |
| 81 | /*! |
| 82 | * The JSON configuration currently applied on the device. |
| 83 | */ |
| 84 | QString config() const; |
| 85 | |
| 86 | Q_SIGNALS: |
| 87 | /*! |
| 88 | * Emitted when the carrier of this device has changed |
| 89 | */ |
| 90 | void carrierChanged(bool plugged); |
| 91 | /*! |
| 92 | * Emitted when the hardware address of this device has changed |
| 93 | */ |
| 94 | void hwAddressChanged(const QString &address); |
| 95 | |
| 96 | /*! |
| 97 | * Emitted when the list of devices slaved to this device has changed |
| 98 | */ |
| 99 | void slavesChanged(const QStringList &slaves); |
| 100 | |
| 101 | /*! |
| 102 | * Emitted when the JSON confugration which is currently applied has changed |
| 103 | */ |
| 104 | void configChanged(const QString &config); |
| 105 | |
| 106 | private: |
| 107 | Q_DECLARE_PRIVATE(TeamDevice) |
| 108 | }; |
| 109 | |
| 110 | } |
| 111 | |
| 112 | #endif |
| 113 | |