diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-04 17:53:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-04 17:53:12 +0000 |
commit | af20635a2bb11eefabb627a2419644d3ac78831d (patch) | |
tree | a10097346376a69cf49288d3bd592b635a8744f9 /networkstatus/networkstatus.h | |
parent | 84ae8923dff22da5912d9a322db515ce0a2388c7 (diff) | |
download | tdelibs-af20635a2bb11eefabb627a2419644d3ac78831d.tar.gz tdelibs-af20635a2bb11eefabb627a2419644d3ac78831d.zip |
Added networkstatus service from pim to core for use in other network enabled applications
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1171617 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'networkstatus/networkstatus.h')
-rw-r--r-- | networkstatus/networkstatus.h | 80 |
1 files changed, 47 insertions, 33 deletions
diff --git a/networkstatus/networkstatus.h b/networkstatus/networkstatus.h index 0bc343915..710afd79a 100644 --- a/networkstatus/networkstatus.h +++ b/networkstatus/networkstatus.h @@ -1,9 +1,12 @@ -/* This file is part of kdepim - Copyright (C) 2005,2007 Will Stephenson <wstephenson@kde.org> +/* + This file is part of kdepim. + + Copyright (c) 2005 Will Stephenson <lists@stevello.free-online.co.uk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -11,56 +14,67 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License - along with this library. If not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - As a special exception, permission is given to link this library - with any edition of TQt, and distribute the resulting executable, - without including the source code for TQt in the source distribution. */ #ifndef KDED_NETWORKSTATUS_H #define KDED_NETWORKSTATUS_H +#include "networkstatuscommon.h" + #include <kdedmodule.h> -#include "networkstatuscommon.h" +#include "clientiface.h" #include "network.h" +#include "serviceiface.h" + +struct NetworkStatusStruct; -class NetworkStatusModule : virtual public KDEDModule +class NetworkStatusModule : virtual public KDEDModule/*, public ClientIface, ServiceIface*/ // <-spot the multiple inheritance pb { Q_OBJECT K_DCOP public: - NetworkStatusModule( const TQCString& obj ); - ~NetworkStatusModule(); + NetworkStatusModule( const TQCString & obj ); + ~NetworkStatusModule(); k_dcop: - // Client interface - TQStringList networks(); - int status(); - // Service interface - void setNetworkStatus( const TQString & networkName, int status ); - void registerNetwork( NetworkStatus::Properties properties ); - void unregisterNetwork( const TQString & networkName ); + // Client interface + TQStringList networks(); + int status( const TQString & host ); + int request( const TQString & host, bool userInitiated ); + void relinquish( const TQString & host ); + bool reportFailure( const TQString & host ); +// TQString statusAsString(); + // Service interface + void setNetworkStatus( const TQString & networkName, int status ); + void registerNetwork( const TQString & networkName, NetworkStatus::Properties properties ); + void unregisterNetwork( const TQString & networkName ); + void requestShutdown( const TQString & networkName ); k_dcop_signals: - /** - * A status change occurred affecting the overall connectivity - * @param status The new status - */ - void statusChange( int status ); + /** + * A status change occurred for the network(s) used to connect to the given host. + * @param host The host which the application has indicated it is using + * @param status The new status of the network used to reach host. + */ + void statusChange( TQString host, int status ); + /** + * The network would like to shut down - any clients using this host are to finish using it immediately and call + * relinquish() when done. + * @param host The host, registered as in use by applications, which is about to be disconnected. + */ + void shutdownRequested( TQString host ); protected slots: - //void registeredToDCOP( const TQCString& appId ); - void unregisteredFromDCOP( const TQCString& appId ); + void registeredToDCOP( const TQCString& appId ); + void unregisteredFromDCOP( const TQCString& appId ); protected: - // recalculate cached status - void updateStatus(); + // TQStringList networkUsers( const TQString & networkName ); + Network * networkForHost( const TQString & host ) const; private: - class Private; - Private *d; + class Private; + Private *d; }; - #endif -// vim: sw=4 ts=4 |