summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/connectionmanager.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/libkopete/connectionmanager.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/libkopete/connectionmanager.h')
-rw-r--r--kopete/libkopete/connectionmanager.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/kopete/libkopete/connectionmanager.h b/kopete/libkopete/connectionmanager.h
new file mode 100644
index 00000000..b78df8d4
--- /dev/null
+++ b/kopete/libkopete/connectionmanager.h
@@ -0,0 +1,58 @@
+/*
+ connectionmanager.h - Provides the client side interface to the kde networkstatus daemon
+
+ Copyright (c) 2004 by 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 Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef KDE_CONNECTION_MANAGER_H
+#define KDE_CONNECTION_MANAGER_H
+
+#include <dcopobject.h>
+
+#include "kopete_export.h"
+#include "networkstatuscommon.h"
+
+class ConnectionManagerPrivate;
+
+class KOPETE_EXPORT ConnectionManager : public QObject, virtual public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+ public:
+ static ConnectionManager* self();
+ enum State { Inactive, Online, Offline, Pending };
+ virtual ~ConnectionManager();
+ NetworkStatus::EnumStatus status( const QString & host );
+ // check if a hostname is available. Ask user if offline. Request host
+ NetworkStatus::EnumRequestResult requestConnection( QWidget* mainWidget, const QString & host, bool userInitiated );
+ // method to relinquish a connection
+ void relinquishConnection( const QString & host );
+ signals:
+ // signal that the network for a hostname is up/down
+ void statusChanged( const QString & host, NetworkStatus::EnumStatus status );
+ protected:
+ // sets up internal state
+ void initialise();
+ // reread the desktop status from the daemon and update internal state
+ void updateStatus();
+ // ask if the user would like to reconnect
+ bool askToConnect( QWidget * mainWidget );
+ k_dcop:
+ void slotStatusChanged( QString host, int status );
+ private:
+ ConnectionManager( QObject *parent, const char * name );
+ ConnectionManagerPrivate *d;
+ static ConnectionManager * s_self;
+};
+
+#endif
+