2 Copyright 2008 Will Stephenson <wstephenson@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License or (at your option) version 3 or any later version
8 accepted by the membership of KDE e.V. (or its successor approved
9 by the membership of KDE e.V.), which shall act as a proxy
10 defined in Section 14 of version 3 of the license.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef NM07_NETWORKINTERFACE_H
22 #define NM07_NETWORKINTERFACE_H
24 #include "solid/control/solid_control_export.h"
25 #include "solid/control/networkinterface.h"
26 #include "solid/control/ifaces/networkinterface.h"
28 class NMNetworkInterfacePrivate
;
29 class NMNetworkManager
;
31 class KDE_EXPORT NMNetworkInterface
: public QObject
, virtual public Solid::Control::Ifaces::NetworkInterface
34 Q_DECLARE_PRIVATE(NMNetworkInterface
)
35 Q_INTERFACES(Solid::Control::Ifaces::NetworkInterface
)
37 Q_PROPERTY(QString uni READ uni WRITE setUni
)
38 Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName
)
39 Q_PROPERTY(QString driver READ driver WRITE setDriver
)
40 Q_PROPERTY(QVariant genericCapabilities READ capabilitiesV WRITE setCapabilitiesV
)
41 Q_PROPERTY(int ipV4Address READ ipV4Address
)
42 Q_PROPERTY(bool managed READ managed WRITE setManaged
)
44 //Q_PROPERTY(Solid::Control::IPv4Config ipV4Config READ ipV4Config WRITE setIpV4Config)
45 Q_PROPERTY(Solid::Control::NetworkInterface::ConnectionState connectionState READ connectionState WRITE setConnectionState
)
46 Q_FLAGS(Solid::Control::NetworkInterface::Capabilities
)
49 NMNetworkInterface( const QString
& path
, NMNetworkManager
* manager
, QObject
* parent
);
50 NMNetworkInterface( NMNetworkInterfacePrivate
&dd
, NMNetworkManager
* manager
, QObject
* parent
);
51 ~NMNetworkInterface();
53 void setUni(const QVariant
&);
54 QString
interfaceName() const;
55 void setInterfaceName(const QVariant
&);
56 QString
driver() const;
57 void setDriver(const QVariant
&);
58 int ipV4Address() const;
59 Solid::Control::IPv4Config
ipV4Config() const;
60 bool isActive() const;
61 Solid::Control::NetworkInterface::ConnectionState
connectionState() const;
62 void setConnectionState(const QVariant
&);
63 int designSpeed() const;
64 bool isLinkUp() const;
65 Solid::Control::NetworkInterface::Capabilities
capabilities() const;
66 void setCapabilities(const QVariant
&);
67 QVariant
capabilitiesV() const;
68 void setCapabilitiesV(const QVariant
&);
70 void setManaged(const QVariant
&);
73 void ipDetailsChanged();
74 //void linkUpChanged(bool linkActivated);
75 void connectionStateChanged(int state
);
77 void stateChanged(uint
,uint
,uint
);
80 Solid::Control::NetworkInterface::Capabilities
convertCapabilities(uint theirCaps
);
81 Solid::Control::NetworkInterface::ConnectionState
convertState(uint theirState
);
83 NMNetworkInterfacePrivate
* d_ptr
;