SolidModules
NetworkManager-networkinterface.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2007 Will Stephenson <wstephenson@kde.org> 00003 Copyright (C) 2008 Pino Toscano <pino@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 00019 */ 00020 00021 #ifndef NETWORKMANAGER_NETWORKINTERFACE_H 00022 #define NETWORKMANAGER_NETWORKINTERFACE_H 00023 00024 #include <solid/control/ifaces/networkinterface.h> 00025 00026 #include <QtCore/qobject.h> 00027 #include <QtDBus/QDBusObjectPath> 00028 00029 class QDBusInterface; 00030 00031 struct NMDBusDeviceProperties { 00032 QDBusObjectPath path; 00033 QString interface; 00034 uint type; 00035 QString udi; 00036 bool active; 00037 uint activationStage; 00038 QString ipv4Address; 00039 QString subnetMask; 00040 QString broadcast; 00041 QString hardwareAddress; 00042 QString route; 00043 QString primaryDNS; 00044 QString secondaryDNS; 00045 int mode; 00046 int strength; 00047 bool linkActive; 00048 int speed; 00049 uint capabilities; 00050 uint capabilitiesType; 00051 QString activeNetPath; 00052 QStringList networks; 00053 }; 00054 00055 Q_DECLARE_METATYPE(NMDBusDeviceProperties) 00056 00057 class NMNetworkInterfacePrivate; 00058 00059 class NMNetworkInterface : public QObject, virtual public Solid::Control::Ifaces::NetworkInterface 00060 { 00061 Q_OBJECT 00062 Q_INTERFACES(Solid::Control::Ifaces::NetworkInterface) 00063 public: 00064 NMNetworkInterface(const QString & objectPath); 00065 virtual ~NMNetworkInterface(); 00066 QString uni() const; 00067 bool isActive() const; 00068 Solid::Control::NetworkInterface::Type type() const; 00069 Solid::Control::NetworkInterface::ConnectionState connectionState() const; 00070 int designSpeed() const; 00071 Solid::Control::NetworkInterface::Capabilities capabilities() const; 00072 QString activeNetwork() const; 00073 // These setters are used to update the interface by the manager 00074 // in response to DBus signals 00075 void setActive(bool); 00076 void setActivationStage(int activationStage); 00077 void addNetwork(const QDBusObjectPath & netPath); 00078 void removeNetwork(const QDBusObjectPath & netPath); 00079 void setManagerInterface(QDBusInterface * manager); 00080 QString interfaceName() const; 00081 QString driver() const; 00082 Solid::Control::IPv4Config ipV4Config() const; 00083 virtual bool activateConnection(const QString & connectionUni, const QVariantMap & connectionParameters); 00084 virtual bool deactivateConnection(); 00085 Q_SIGNALS: 00086 void ipDetailsChanged(); 00087 void connectionStateChanged(int state); 00088 protected: 00089 NMNetworkInterface(NMNetworkInterfacePrivate &dd); 00090 NMNetworkInterfacePrivate * d_ptr; 00091 private: 00092 Q_DECLARE_PRIVATE(NMNetworkInterface) 00093 Q_DISABLE_COPY(NMNetworkInterface) 00094 }; 00095 00096 #endif