File indexing completed on 2024-04-14 14:20:35
0001 /* This file is part of kdebase/workspace/solid 0002 Copyright (C) 2005,2007 Will Stephenson <wstephenson@kde.org> 0003 0004 This library is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Lesser General Public 0006 License as published by the Free Software Foundation; either 0007 version 2.1 of the License, or (at your option) version 3, or any 0008 later version accepted by the membership of KDE e.V. (or its 0009 successor approved by the membership of KDE e.V.), which shall 0010 act as a proxy defined in Section 6 of version 3 of the license. 0011 0012 This library is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 Lesser General Public License for more details. 0016 0017 You should have received a copy of the GNU Lesser General Public 0018 License along with this library. If not, see <http://www.gnu.org/licenses/>. 0019 */ 0020 0021 #ifndef KDED_NETWORKSTATUS_H 0022 #define KDED_NETWORKSTATUS_H 0023 0024 #include <QStringList> 0025 0026 #include <KDEDModule> 0027 0028 #include "network.h" 0029 0030 class SystemStatusInterface; 0031 0032 class NetworkStatusModule : public KDEDModule 0033 { 0034 Q_OBJECT 0035 Q_CLASSINFO( "D-Bus Interface", "org.kde.Solid.Networking" ) 0036 public: 0037 NetworkStatusModule(QObject* parent, const QList<QVariant>&); 0038 ~NetworkStatusModule() override; 0039 // Client interface 0040 public Q_SLOTS: 0041 Q_SCRIPTABLE int status(); 0042 // Service interface 0043 Q_SCRIPTABLE QStringList networks(); 0044 Q_SCRIPTABLE void setNetworkStatus( const QString & networkName, int status ); 0045 Q_SCRIPTABLE void registerNetwork( const QString & networkName, int status, const QString & serviceName ); 0046 Q_SCRIPTABLE void unregisterNetwork( const QString & networkName ); 0047 Q_SIGNALS: 0048 // Client interface 0049 /** 0050 * A status change occurred affecting the overall connectivity 0051 * @param status The new status 0052 */ 0053 void statusChanged( uint status ); 0054 protected Q_SLOTS: 0055 void serviceUnregistered( const QString & name ); 0056 void solidNetworkingStatusChanged( Solid::Networking::Status status ); 0057 void backendRegistered(); 0058 void backendUnregistered(); 0059 void delayedStatusChanged(); 0060 protected: 0061 // set up embedded backend 0062 void init(); 0063 // recalculate cached status 0064 void updateStatus(); 0065 0066 private: 0067 QList<SystemStatusInterface*> backends; 0068 class Private; 0069 Private *d; 0070 }; 0071 0072 #endif 0073 // vim: sw=4 ts=4