File indexing completed on 2024-09-15 12:04:54
0001 /* 0002 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef NETWORKMANAGERQT_DEVICE_P_H 0008 #define NETWORKMANAGERQT_DEVICE_P_H 0009 0010 #include "dbus/deviceinterface.h" 0011 #include "device.h" 0012 0013 namespace NetworkManager 0014 { 0015 class NetworkManagerPrivate; 0016 0017 class DevicePrivate : public QObject 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit DevicePrivate(const QString &path, Device *q); 0022 ~DevicePrivate() override; 0023 0024 void init(); 0025 0026 OrgFreedesktopNetworkManagerDeviceInterface deviceIface; 0027 Device::Capabilities capabilities; 0028 QString uni; 0029 QString udi; 0030 QString activeConnection; 0031 int designSpeed; 0032 Device::Type deviceType; 0033 Device::State connectionState; 0034 bool managed; 0035 mutable IpConfig ipV4Config; 0036 QString ipV4ConfigPath; 0037 mutable IpConfig ipV6Config; 0038 QString ipV6ConfigPath; 0039 QString driver; 0040 QHostAddress ipV4Address; 0041 QString interfaceName; 0042 QString ipInterface; 0043 bool firmwareMissing; 0044 mutable Dhcp4Config::Ptr dhcp4Config; 0045 QString dhcp4ConfigPath; 0046 mutable Dhcp6Config::Ptr dhcp6Config; 0047 QString dhcp6ConfigPath; 0048 QString driverVersion; 0049 QString firmwareVersion; 0050 QStringList availableConnections; 0051 bool autoconnect; 0052 Device::StateChangeReason reason; 0053 QString physicalPortId; 0054 uint mtu; 0055 bool nmPluginMissing; 0056 Device::MeteredStatus metered; 0057 DeviceStatistics::Ptr deviceStatistics; 0058 0059 static NetworkManager::Device::MeteredStatus convertMeteredStatus(uint); 0060 static NetworkManager::Device::Capabilities convertCapabilities(uint); 0061 static NetworkManager::Device::State convertState(uint); 0062 static NetworkManager::Device::StateChangeReason convertReason(uint); 0063 static NetworkManager::Device::Type convertType(uint); 0064 0065 Q_DECLARE_PUBLIC(Device) 0066 Device *q_ptr; 0067 0068 public: 0069 /** 0070 * When subclassing make sure to call the parent class method 0071 * if the property was not useful to your new class 0072 */ 0073 virtual void propertyChanged(const QString &property, const QVariant &value); 0074 0075 public Q_SLOTS: 0076 void deviceStateChanged(uint, uint, uint); 0077 void dbusPropertiesChanged(const QString &interfaceName, const QVariantMap &properties, const QStringList &invalidatedProperties); 0078 void propertiesChanged(const QVariantMap &properties); 0079 }; 0080 0081 } // namespace NetworkManager 0082 #endif