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_BRIDGE_DEVICE_H |
8 | #define NETWORKMANAGERQT_BRIDGE_DEVICE_H |
9 | |
10 | #include "device.h" |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | namespace NetworkManager |
14 | { |
15 | class BridgeDevicePrivate; |
16 | |
17 | /*! |
18 | * \class NetworkManager::BridgeDevice |
19 | * \inheaderfile NetworkManagerQt/BridgeDevice |
20 | * \inmodule NetworkManagerQt |
21 | * |
22 | * \brief A bridge device interface. |
23 | */ |
24 | class NETWORKMANAGERQT_EXPORT BridgeDevice : public Device |
25 | { |
26 | Q_OBJECT |
27 | |
28 | /*! |
29 | * \property NetworkManager::BridgeDevice::carrier |
30 | */ |
31 | Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged) |
32 | |
33 | /*! |
34 | * \property NetworkManager::BridgeDevice::hwAddress |
35 | */ |
36 | Q_PROPERTY(QString hwAddress READ hwAddress NOTIFY hwAddressChanged) |
37 | |
38 | /*! |
39 | * \property NetworkManager::BridgeDevice::slaves |
40 | */ |
41 | Q_PROPERTY(QStringList slaves READ slaves NOTIFY slavesChanged) |
42 | |
43 | public: |
44 | /*! |
45 | * \typedef NetworkManager::BridgeDevice::Ptr |
46 | */ |
47 | typedef QSharedPointer<BridgeDevice> Ptr; |
48 | /*! |
49 | * \typedef NetworkManager::BridgeDevice::List |
50 | */ |
51 | typedef QList<Ptr> List; |
52 | /*! |
53 | */ |
54 | explicit BridgeDevice(const QString &path, QObject *parent = nullptr); |
55 | ~BridgeDevice() override; |
56 | |
57 | Type type() const override; |
58 | |
59 | /*! |
60 | * Indicates whether the physical carrier is found |
61 | */ |
62 | bool carrier() const; |
63 | /*! |
64 | * Hardware address of the device |
65 | */ |
66 | QString hwAddress() const; |
67 | /*! |
68 | * Array of object paths representing devices which are currently slaved to this device |
69 | */ |
70 | QStringList slaves() const; |
71 | |
72 | Q_SIGNALS: |
73 | /*! |
74 | * Emitted when the carrier of this device has changed |
75 | */ |
76 | void carrierChanged(bool plugged); |
77 | /*! |
78 | * Emitted when the hardware address of this device has changed |
79 | */ |
80 | void hwAddressChanged(const QString &address); |
81 | /*! |
82 | * Emitted when the slaves of this device have changed |
83 | */ |
84 | void slavesChanged(const QStringList &slaves); |
85 | |
86 | private: |
87 | Q_DECLARE_PRIVATE(BridgeDevice) |
88 | }; |
89 | |
90 | } |
91 | |
92 | #endif |
93 | |