NetworkManagerQt

fakenetwork/device.h
1/*
2 SPDX-FileCopyrightText: 2014 Jan Grulich <jgrulich@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_FAKE_NETWORK_DEVICE_H
8#define NETWORKMANAGERQT_FAKE_NETWORK_DEVICE_H
9
10#include <QObject>
11
12#include <QDBusObjectPath>
13
14#include "../device.h"
15#include "../generictypes.h"
16
17class Device : public QObject
18{
20 Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Device")
21public:
22 explicit Device(QObject *parent = nullptr);
23 ~Device() override;
24
25 Q_PROPERTY(QDBusObjectPath ActiveConnection READ activeConnection)
26 Q_PROPERTY(bool Autoconnect READ autoconnect WRITE setAutoconnect)
27 Q_PROPERTY(QList<QDBusObjectPath> AvailableConnections READ availableConnections)
28 Q_PROPERTY(uint Capabilities READ capabilities)
29 Q_PROPERTY(uint DeviceType READ deviceType)
30 Q_PROPERTY(QDBusObjectPath Dhcp4Config READ dhcp4Config)
31 Q_PROPERTY(QDBusObjectPath Dhcp6Config READ dhcp6Config)
32 Q_PROPERTY(QString Driver READ driver)
33 Q_PROPERTY(QString DriverVersion READ driverVersion)
34 Q_PROPERTY(bool FirmwareMissing READ firmwareMissing)
35 Q_PROPERTY(QString FirmwareVersion READ firmwareVersion)
36 Q_PROPERTY(QString Interface READ interface)
37 Q_PROPERTY(int Ip4Address READ ip4Address)
38 Q_PROPERTY(QDBusObjectPath Ip4Config READ ip4Config)
39 Q_PROPERTY(QDBusObjectPath Ip6Config READ ip6Config)
40 Q_PROPERTY(QString IpInterface READ ipInterface)
41 Q_PROPERTY(uint InterfaceFlags READ interfaceFlags)
42 Q_PROPERTY(bool Managed READ managed)
43 Q_PROPERTY(uint Mtu READ mtu)
44 Q_PROPERTY(uint State READ state)
45 Q_PROPERTY(DeviceDBusStateReason StateReason READ stateReason)
46 Q_PROPERTY(QString Udi READ udi)
47
48 QDBusObjectPath activeConnection() const;
49 bool autoconnect() const;
50 void setAutoconnect(bool autoconnect);
51 QList<QDBusObjectPath> availableConnections() const;
52 uint capabilities() const;
53 uint deviceType() const;
54 QDBusObjectPath dhcp4Config() const;
55 QDBusObjectPath dhcp6Config() const;
56 QString driver() const;
57 QString driverVersion() const;
58 bool firmwareMissing() const;
59 QString firmwareVersion() const;
60 QString interface() const;
61 int ip4Address() const;
62 QDBusObjectPath ip4Config() const;
63 QDBusObjectPath ip6Config() const;
64 QString ipInterface() const;
65 uint interfaceFlags() const;
66 bool managed() const;
67 uint mtu() const;
68 uint state() const;
69 DeviceDBusStateReason stateReason() const;
70 QString udi() const;
71
72 /* Not part of DBus interface */
73 void addAvailableConnection(const QDBusObjectPath &availableConnection);
74 void removeAvailableConnection(const QDBusObjectPath &availableConnection);
75 void setActiveConnection(const QString &activeConnection);
76 void setCapabilities(uint capabilities);
77 QString deviceInterface() const;
78 QString devicePath() const;
79 void setDevicePath(const QString &devicePath);
80 void setDeviceType(uint deviceType);
81 void setDhcp4Config(const QString &config);
82 void setDhcp6Config(const QString &config);
83 void setDriver(const QString &driver);
84 void setDriverVersion(const QString &driverVersion);
85 void setFirmwareMissing(bool firmwareMissing);
86 void setFirmwareVersion(const QString &firmwareVersion);
87 void setInterface(const QString &interface);
88 void setInterfaceFlags(uint interfaceFlags);
89 void setIpv4Address(int address);
90 void setIp4Config(const QString &config);
91 void setIp6Config(const QString &config);
92 void setIpInterface(const QString &interface);
93 void setManaged(bool managed);
94 void setMtu(uint mtu);
95 virtual void setState(uint state);
96 void setStateReason(const DeviceDBusStateReason &reason);
97 void setUdi(const QString &udi);
98
99public Q_SLOTS:
100 Q_SCRIPTABLE void Disconnect();
101
103 void activeConnectionRemoved(const QDBusObjectPath &activeConnection);
104 Q_SCRIPTABLE void StateChanged(uint new_state, uint old_state, uint reason);
105
106private:
107 QDBusObjectPath m_activeConnection;
108 bool m_autoconnect;
109 QList<QDBusObjectPath> m_availableConnections;
110 uint m_capabilities;
111 QString m_devicePath;
112 uint m_deviceType;
113 QDBusObjectPath m_dhcp4Config;
114 QDBusObjectPath m_dhcp6Config;
115 QString m_driver;
116 QString m_driverVersion;
117 bool m_firmwareMissing;
118 QString m_firmwareVersion;
119 QString m_interface;
120 uint m_interfaceFlags;
121 int m_ip4Address;
122 QDBusObjectPath m_ip4Config;
123 QDBusObjectPath m_ip6Config;
124 QString m_ipInterface;
125 bool m_managed;
126 uint m_mtu;
127 QString m_physicalPortId;
128 uint m_state;
129 DeviceDBusStateReason m_stateReason;
130 QString m_udi;
131};
132
133#endif
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.