summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/testbed/testbedaccount.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/protocols/testbed/testbedaccount.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/protocols/testbed/testbedaccount.h')
-rw-r--r--kopete/protocols/testbed/testbedaccount.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/kopete/protocols/testbed/testbedaccount.h b/kopete/protocols/testbed/testbedaccount.h
new file mode 100644
index 00000000..34429300
--- /dev/null
+++ b/kopete/protocols/testbed/testbedaccount.h
@@ -0,0 +1,105 @@
+/*
+ testbedaccount.h - Kopete Testbed Protocol
+
+ Copyright (c) 2003 by Will Stephenson <will@stevello.free-online.co.uk>
+ Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef TESTBEDACCOUNT_H
+#define TESTBEDACCOUNT_H
+
+#include <kopeteaccount.h>
+#include "testbedwebcamdialog.h"
+
+class KActionMenu;
+namespace Kopete { class Contact; }
+namespace Kopete { class MetaContact; }
+
+class TestbedContact;
+class TestbedProtocol;
+class TestbedFakeServer;
+
+/**
+ * This represents an account connected to the testbed
+ * @author Will Stephenson
+*/
+class TestbedAccount : public Kopete::Account
+{
+ Q_OBJECT
+public:
+ TestbedAccount( TestbedProtocol *parent, const QString& accountID, const char *name = 0 );
+ ~TestbedAccount();
+ /**
+ * Construct the context menu used for the status bar icon
+ */
+ virtual KActionMenu* actionMenu();
+
+ /**
+ * Creates a protocol specific Kopete::Contact subclass and adds it to the supplie
+ * Kopete::MetaContact
+ */
+ virtual bool createContact(const QString& contactId, Kopete::MetaContact* parentContact);
+ /**
+ * Called when Kopete is set globally away
+ */
+ virtual void setAway(bool away, const QString& reason);
+ /**
+ * Called when Kopete status is changed globally
+ */
+ virtual void setOnlineStatus(const Kopete::OnlineStatus& status , const QString &reason = QString::null);
+ /**
+ * 'Connect' to the testbed server. Only sets myself() online.
+ */
+ virtual void connect( const Kopete::OnlineStatus& initialStatus = Kopete::OnlineStatus::OnlineStatus() );
+ /**
+ * Disconnect from the server. Only sets myself() offline.
+ */
+ virtual void disconnect();
+ /**
+ * Return a reference to the server stub
+ */
+ TestbedFakeServer* server();
+public slots:
+ /**
+ * Called by the server when it has a message for us.
+ * This identifies the sending Kopete::Contact and passes it a Kopete::Message
+ */
+ void receivedMessage( const QString &message );
+
+protected:
+ /**
+ * This simulates contacts going on and offline in sync with the account's status changes
+ */
+ void updateContactStatus();
+ TestbedFakeServer* m_server;
+
+protected slots:
+ /**
+ * Change the account's status. Called by KActions and internally.
+ */
+ void slotGoOnline();
+ /**
+ * Change the account's status. Called by KActions and internally.
+ */
+ void slotGoAway();
+ /**
+ * Change the account's status. Called by KActions and internally.
+ */
+ void slotGoOffline();
+ /**
+ * Show webcam. Called by KActions and internally.
+ */
+ void slotShowVideo();
+
+};
+
+#endif