libsolidcontrol
fakenetworkmanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2006,2008 Will Stephenson <wstephenson@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 #ifndef FAKE_NETWORK_MANAGER_H 00021 #define FAKE_NETWORK_MANAGER_H 00022 00023 #include <QObject> 00024 #include <QStringList> 00025 00026 #include <kdemacros.h> 00027 00028 #include <solid/control/ifaces/networkmanager.h> 00029 00030 #include "fakenetworkinterface.h" 00031 00032 00033 class FakeAuthenticationValidator; 00034 class QDomElement; 00035 //class FakeNetworkInterface; 00036 00037 namespace Solid { 00038 class Authentication; 00039 } 00040 00041 class KDE_EXPORT FakeNetworkManager : public Solid::Control::Ifaces::NetworkManager 00042 { 00043 Q_OBJECT 00044 public: 00045 FakeNetworkManager(QObject * parent, const QStringList & args); 00046 FakeNetworkManager(QObject * parent, const QStringList & args, const QString & xmlFile); 00047 virtual ~FakeNetworkManager(); 00048 Solid::Networking::Status status() const; 00049 QStringList networkInterfaces() const; 00050 QStringList activeNetworkInterfaces() const; 00051 QObject * createNetworkInterface(const QString &); 00052 00053 bool isNetworkingEnabled() const; 00054 bool isWirelessEnabled() const; 00055 bool isWirelessHardwareEnabled() const; 00056 00057 void activateConnection(const QString & interfaceUni, const QString & connectionUni, const QVariantMap & connectionParameters); 00058 00059 void deactivateConnection(const QString & activeConnection); 00060 00061 public Q_SLOTS: 00062 void setWirelessEnabled(bool); 00063 void setNetworkingEnabled(bool); 00064 00065 private: 00066 void parseNetworkingFile(); 00067 FakeNetworkInterface *parseDeviceElement(const QDomElement &deviceElement); 00068 QMap<QString,QVariant> parseAPElement(const QDomElement &deviceElement); 00069 00070 bool mUserNetworkingEnabled; 00071 bool mUserWirelessEnabled; 00072 bool mRfKillEnabled; 00073 QMap<QString, FakeNetworkInterface *> mNetworkInterfaces; 00074 QString mXmlFile; 00075 }; 00076 00077 #endif