File indexing completed on 2024-04-14 03:57:46

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
0003     SPDX-FileCopyrightText: 2011-2013 Lamarque V. Souza <lamarque@kde.org>
0004     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef NETWORKMANAGERQT_WIREDDEVICE_H
0010 #define NETWORKMANAGERQT_WIREDDEVICE_H
0011 
0012 #include <networkmanagerqt/networkmanagerqt_export.h>
0013 
0014 #include "device.h"
0015 
0016 namespace NetworkManager
0017 {
0018 class WiredDevicePrivate;
0019 
0020 /**
0021  * A wired device interface
0022  */
0023 class NETWORKMANAGERQT_EXPORT WiredDevice : public Device
0024 {
0025     Q_OBJECT
0026     Q_PROPERTY(QString hardwareAddress READ hardwareAddress)
0027     Q_PROPERTY(QString permanentHardwareAddress READ permanentHardwareAddress)
0028     Q_PROPERTY(bool carrier READ carrier NOTIFY carrierChanged)
0029     Q_PROPERTY(int bitRate READ bitRate NOTIFY bitRateChanged)
0030     Q_PROPERTY(QStringList s390SubChannels READ s390SubChannels NOTIFY s390SubChannelsChanged)
0031 
0032 public:
0033     typedef QSharedPointer<WiredDevice> Ptr;
0034     typedef QList<Ptr> List;
0035     explicit WiredDevice(const QString &path, QObject *parent = nullptr);
0036     ~WiredDevice() override;
0037     /**
0038      * Return the type
0039      */
0040     Type type() const override;
0041     /**
0042      * Active hardware address of the device
0043      */
0044     QString hardwareAddress() const;
0045     /**
0046      * Permanent hardware address of the device
0047      */
0048     QString permanentHardwareAddress() const;
0049     /**
0050      * Design speed of the device, in megabits/second (Mb/s)
0051      */
0052     int bitRate() const;
0053     /**
0054      * Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not)
0055      */
0056     bool carrier() const;
0057     /**
0058      * Array of S/390 subchannels for S/390 or z/Architecture devices
0059      */
0060     QStringList s390SubChannels() const;
0061 
0062 Q_SIGNALS:
0063     /**
0064      * Emitted when the design speed of the device has changed
0065      */
0066     void bitRateChanged(int bitRate);
0067     /**
0068      * Emitted when the carrier of this device has changed
0069      */
0070     void carrierChanged(bool plugged);
0071     /**
0072      * Emitted when the hardware address of this device has changed
0073      */
0074     void hardwareAddressChanged(const QString &hwAddress);
0075     /**
0076      * Emitted when the permanent hardware address of this device has changed
0077      */
0078     void permanentHardwareAddressChanged(const QString &permHwAddress);
0079     /*
0080      * Emitted when the array of s390SubChannels has changed
0081      */
0082     void s390SubChannelsChanged(const QStringList &channels);
0083 
0084 private:
0085     Q_DECLARE_PRIVATE(WiredDevice)
0086 };
0087 
0088 }
0089 
0090 #endif // NETWORKMANAGERQT_WIREDDEVICE_H