SolidModules
networkstatus.h
Go to the documentation of this file.00001 /* This file is part of kdebase/workspace/solid 00002 Copyright (C) 2005,2007 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. If not, write to the Free Software 00015 Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 As a special exception, permission is given to link this library 00019 with any edition of Qt, and distribute the resulting executable, 00020 without including the source code for Qt in the source distribution. 00021 */ 00022 00023 #ifndef KDED_NETWORKSTATUS_H 00024 #define KDED_NETWORKSTATUS_H 00025 00026 #include <QStringList> 00027 00028 #include <KDEDModule> 00029 00030 #include "network.h" 00031 00032 class NetworkStatusModule : public KDEDModule 00033 { 00034 Q_OBJECT 00035 Q_CLASSINFO( "D-Bus Interface", "org.kde.Solid.Networking" ) 00036 public: 00037 NetworkStatusModule(QObject* parent, const QList<QVariant>&); 00038 ~NetworkStatusModule(); 00039 // Client interface 00040 public Q_SLOTS: 00041 Q_SCRIPTABLE int status(); 00042 // Service interface 00043 Q_SCRIPTABLE QStringList networks(); 00044 Q_SCRIPTABLE void setNetworkStatus( const QString & networkName, int status ); 00045 Q_SCRIPTABLE void registerNetwork( const QString & networkName, int status, const QString & serviceName ); 00046 Q_SCRIPTABLE void unregisterNetwork( const QString & networkName ); 00047 Q_SIGNALS: 00048 // Client interface 00053 void statusChanged( uint status ); 00054 protected Q_SLOTS: 00055 void serviceOwnerChanged( const QString & name ,const QString & oldOwner, const QString & newOwner ); 00056 void solidNetworkingStatusChanged( Solid::Networking::Status status ); 00057 protected: 00058 // set up embedded backend 00059 void init(); 00060 // recalculate cached status 00061 void updateStatus(); 00062 00063 private: 00064 class Private; 00065 Private *d; 00066 }; 00067 00068 #endif 00069 // vim: sw=4 ts=4