File indexing completed on 2024-09-08 03:42:58
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 Device::Interfaceflags interfaceFlags; 0044 bool firmwareMissing; 0045 mutable Dhcp4Config::Ptr dhcp4Config; 0046 QString dhcp4ConfigPath; 0047 mutable Dhcp6Config::Ptr dhcp6Config; 0048 QString dhcp6ConfigPath; 0049 QString driverVersion; 0050 QString firmwareVersion; 0051 QStringList availableConnections; 0052 bool autoconnect; 0053 Device::StateChangeReason reason; 0054 QString physicalPortId; 0055 uint mtu; 0056 bool nmPluginMissing; 0057 Device::MeteredStatus metered; 0058 DeviceStatistics::Ptr deviceStatistics; 0059 0060 static NetworkManager::Device::MeteredStatus convertMeteredStatus(uint); 0061 static NetworkManager::Device::Capabilities convertCapabilities(uint); 0062 static NetworkManager::Device::Interfaceflags convertInterfaceflags(uint); 0063 static NetworkManager::Device::State convertState(uint); 0064 static NetworkManager::Device::StateChangeReason convertReason(uint); 0065 static NetworkManager::Device::Type convertType(uint); 0066 0067 Q_DECLARE_PUBLIC(Device) 0068 Device *q_ptr; 0069 0070 public: 0071 /** 0072 * When subclassing make sure to call the parent class method 0073 * if the property was not useful to your new class 0074 */ 0075 virtual void propertyChanged(const QString &property, const QVariant &value); 0076 0077 public Q_SLOTS: 0078 void deviceStateChanged(uint, uint, uint); 0079 void dbusPropertiesChanged(const QString &interfaceName, const QVariantMap &properties, const QStringList &invalidatedProperties); 0080 void propertiesChanged(const QVariantMap &properties); 0081 }; 0082 0083 } // namespace NetworkManager 0084 #endif