1 | /* |
2 | SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
5 | */ |
6 | |
7 | #ifndef NETWORKMANAGERQT_DEVICE_P_H |
8 | #define NETWORKMANAGERQT_DEVICE_P_H |
9 | |
10 | #include "dbus/deviceinterface.h" |
11 | #include "device.h" |
12 | |
13 | namespace NetworkManager |
14 | { |
15 | class NetworkManagerPrivate; |
16 | |
17 | class DevicePrivate : public QObject |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | explicit DevicePrivate(const QString &path, Device *q); |
22 | ~DevicePrivate() override; |
23 | |
24 | void init(); |
25 | |
26 | OrgFreedesktopNetworkManagerDeviceInterface deviceIface; |
27 | Device::Capabilities capabilities; |
28 | QString uni; |
29 | QString udi; |
30 | QString activeConnection; |
31 | int designSpeed; |
32 | Device::Type deviceType; |
33 | Device::State connectionState; |
34 | bool managed; |
35 | mutable IpConfig ipV4Config; |
36 | QString ipV4ConfigPath; |
37 | mutable IpConfig ipV6Config; |
38 | QString ipV6ConfigPath; |
39 | QString driver; |
40 | QHostAddress ipV4Address; |
41 | QString interfaceName; |
42 | QString ipInterface; |
43 | Device::Interfaceflags interfaceFlags; |
44 | bool firmwareMissing; |
45 | mutable Dhcp4Config::Ptr dhcp4Config; |
46 | QString dhcp4ConfigPath; |
47 | mutable Dhcp6Config::Ptr dhcp6Config; |
48 | QString dhcp6ConfigPath; |
49 | QString driverVersion; |
50 | QString firmwareVersion; |
51 | QStringList availableConnections; |
52 | bool autoconnect; |
53 | Device::StateChangeReason reason; |
54 | QString physicalPortId; |
55 | uint mtu; |
56 | bool nmPluginMissing; |
57 | Device::MeteredStatus metered; |
58 | DeviceStatistics::Ptr deviceStatistics; |
59 | |
60 | static NetworkManager::Device::MeteredStatus convertMeteredStatus(uint); |
61 | static NetworkManager::Device::Capabilities convertCapabilities(uint); |
62 | static NetworkManager::Device::Interfaceflags convertInterfaceflags(uint); |
63 | static NetworkManager::Device::State convertState(uint); |
64 | static NetworkManager::Device::StateChangeReason convertReason(uint); |
65 | static NetworkManager::Device::Type convertType(uint); |
66 | |
67 | Q_DECLARE_PUBLIC(Device) |
68 | Device *q_ptr; |
69 | |
70 | public: |
71 | /** |
72 | * When subclassing make sure to call the parent class method |
73 | * if the property was not useful to your new class |
74 | */ |
75 | virtual void propertyChanged(const QString &property, const QVariant &value); |
76 | |
77 | public Q_SLOTS: |
78 | void deviceStateChanged(uint, uint, uint); |
79 | void dbusPropertiesChanged(const QString &interfaceName, const QVariantMap &properties, const QStringList &invalidatedProperties); |
80 | void propertiesChanged(const QVariantMap &properties); |
81 | }; |
82 | |
83 | } // namespace NetworkManager |
84 | #endif |
85 | |