1 | /* |
2 | SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org> |
3 | SPDX-FileCopyrightText: 2011-2013 Lamarque V. Souza <lamarque@kde.org> |
4 | SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | |
9 | #ifndef NETWORKMANAGERQT_WIREDDEVICE_H |
10 | #define NETWORKMANAGERQT_WIREDDEVICE_H |
11 | |
12 | #include <networkmanagerqt/networkmanagerqt_export.h> |
13 | |
14 | #include "device.h" |
15 | |
16 | namespace NetworkManager |
17 | { |
18 | class WiredDevicePrivate; |
19 | |
20 | /** |
21 | * A wired device interface |
22 | */ |
23 | class NETWORKMANAGERQT_EXPORT WiredDevice : public Device |
24 | { |
25 | Q_OBJECT |
26 | Q_PROPERTY(QString hardwareAddress READ hardwareAddress) |
27 | Q_PROPERTY(QString permanentHardwareAddress READ permanentHardwareAddress) |
28 | Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged) |
29 | Q_PROPERTY(int bitRate READ bitRate NOTIFY bitRateChanged) |
30 | Q_PROPERTY(QStringList s390SubChannels READ s390SubChannels NOTIFY s390SubChannelsChanged) |
31 | |
32 | public: |
33 | typedef QSharedPointer<WiredDevice> Ptr; |
34 | typedef QList<Ptr> List; |
35 | explicit WiredDevice(const QString &path, QObject *parent = nullptr); |
36 | ~WiredDevice() override; |
37 | /** |
38 | * Return the type |
39 | */ |
40 | Type type() const override; |
41 | /** |
42 | * Active hardware address of the device |
43 | */ |
44 | QString hardwareAddress() const; |
45 | /** |
46 | * Permanent hardware address of the device |
47 | */ |
48 | QString permanentHardwareAddress() const; |
49 | /** |
50 | * Design speed of the device, in megabits/second (Mb/s) |
51 | */ |
52 | int bitRate() const; |
53 | /** |
54 | * Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not) |
55 | */ |
56 | bool carrier() const; |
57 | /** |
58 | * Array of S/390 subchannels for S/390 or z/Architecture devices |
59 | */ |
60 | QStringList s390SubChannels() const; |
61 | |
62 | Q_SIGNALS: |
63 | /** |
64 | * Emitted when the design speed of the device has changed |
65 | */ |
66 | void bitRateChanged(int bitRate); |
67 | /** |
68 | * Emitted when the carrier of this device has changed |
69 | */ |
70 | void carrierChanged(bool plugged); |
71 | /** |
72 | * Emitted when the hardware address of this device has changed |
73 | */ |
74 | void hardwareAddressChanged(const QString &hwAddress); |
75 | /** |
76 | * Emitted when the permanent hardware address of this device has changed |
77 | */ |
78 | void permanentHardwareAddressChanged(const QString &permHwAddress); |
79 | /* |
80 | * Emitted when the array of s390SubChannels has changed |
81 | */ |
82 | void s390SubChannelsChanged(const QStringList &channels); |
83 | |
84 | private: |
85 | Q_DECLARE_PRIVATE(WiredDevice) |
86 | }; |
87 | |
88 | } |
89 | |
90 | #endif // NETWORKMANAGERQT_WIREDDEVICE_H |
91 | |