1 /* This file is part of the KDE project
2 Copyright (C) 2007 Will Stephenson <wstephenson@kde.org>
3 Copyright (C) 2008 Pino Toscano <pino@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #ifndef NETWORKMANAGER_NETWORKINTERFACE_H
22 #define NETWORKMANAGER_NETWORKINTERFACE_H
24 #include <solid/control/ifaces/networkinterface.h>
26 #include <QtCore/qobject.h>
27 #include <QtDBus/QDBusObjectPath>
31 struct NMDBusDeviceProperties
{
41 QString hardwareAddress
;
50 uint capabilitiesType
;
51 QString activeNetPath
;
55 Q_DECLARE_METATYPE(NMDBusDeviceProperties
)
57 class NMNetworkInterfacePrivate
;
59 class NMNetworkInterface
: public QObject
, virtual public Solid::Control::Ifaces::NetworkInterface
62 Q_INTERFACES(Solid::Control::Ifaces::NetworkInterface
)
64 NMNetworkInterface(const QString
& objectPath
);
65 virtual ~NMNetworkInterface();
67 bool isActive() const;
68 Solid::Control::NetworkInterface::Type
type() const;
69 Solid::Control::NetworkInterface::ConnectionState
connectionState() const;
70 int designSpeed() const;
71 Solid::Control::NetworkInterface::Capabilities
capabilities() const;
72 QString
activeNetwork() const;
73 // These setters are used to update the interface by the manager
74 // in response to DBus signals
76 void setActivationStage(int activationStage
);
77 void addNetwork(const QDBusObjectPath
& netPath
);
78 void removeNetwork(const QDBusObjectPath
& netPath
);
79 void setManagerInterface(QDBusInterface
* manager
);
80 QString
interfaceName() const;
81 QString
driver() const;
82 Solid::Control::IPv4Config
ipV4Config() const;
83 virtual bool activateConnection(const QString
& connectionUni
, const QVariantMap
& connectionParameters
);
84 virtual bool deactivateConnection();
86 void ipDetailsChanged();
87 void connectionStateChanged(int state
);
89 NMNetworkInterface(NMNetworkInterfacePrivate
&dd
);
90 NMNetworkInterfacePrivate
* d_ptr
;
92 Q_DECLARE_PRIVATE(NMNetworkInterface
)
93 Q_DISABLE_COPY(NMNetworkInterface
)