not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / solid / networkmanager-0.6 / NetworkManager-networkinterface.h
blob2aec9d87648602665fc181fd3ba6ea52b7012be3
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>
29 class QDBusInterface;
31 struct NMDBusDeviceProperties {
32 QDBusObjectPath path;
33 QString interface;
34 uint type;
35 QString udi;
36 bool active;
37 uint activationStage;
38 QString ipv4Address;
39 QString subnetMask;
40 QString broadcast;
41 QString hardwareAddress;
42 QString route;
43 QString primaryDNS;
44 QString secondaryDNS;
45 int mode;
46 int strength;
47 bool linkActive;
48 int speed;
49 uint capabilities;
50 uint capabilitiesType;
51 QString activeNetPath;
52 QStringList networks;
55 Q_DECLARE_METATYPE(NMDBusDeviceProperties)
57 class NMNetworkInterfacePrivate;
59 class NMNetworkInterface : public QObject, virtual public Solid::Control::Ifaces::NetworkInterface
61 Q_OBJECT
62 Q_INTERFACES(Solid::Control::Ifaces::NetworkInterface)
63 public:
64 NMNetworkInterface(const QString & objectPath);
65 virtual ~NMNetworkInterface();
66 QString uni() const;
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
75 void setActive(bool);
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();
85 Q_SIGNALS:
86 void ipDetailsChanged();
87 void connectionStateChanged(int state);
88 protected:
89 NMNetworkInterface(NMNetworkInterfacePrivate &dd);
90 NMNetworkInterfacePrivate * d_ptr;
91 private:
92 Q_DECLARE_PRIVATE(NMNetworkInterface)
93 Q_DISABLE_COPY(NMNetworkInterface)
96 #endif