summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/testbed/testbedcontact.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/testbedcontact.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/testbedcontact.h')
-rw-r--r--kopete/protocols/testbed/testbedcontact.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/kopete/protocols/testbed/testbedcontact.h b/kopete/protocols/testbed/testbedcontact.h
new file mode 100644
index 00000000..7f7c168a
--- /dev/null
+++ b/kopete/protocols/testbed/testbedcontact.h
@@ -0,0 +1,95 @@
+/*
+ testbedcontact.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 TESTBEDCONTACT_H
+#define TESTBEDCONTACT_H
+
+#include <qmap.h>
+#include "kopetecontact.h"
+#include "kopetemessage.h"
+
+class KAction;
+class KActionCollection;
+namespace Kopete { class Account; }
+namespace Kopete { class ChatSession; }
+namespace Kopete { class MetaContact; }
+
+/**
+@author Will Stephenson
+*/
+class TestbedContact : public Kopete::Contact
+{
+ Q_OBJECT
+public:
+ /**
+ * The range of possible contact types
+ */
+ enum TestbedContactType { Null, Echo };
+
+ TestbedContact( Kopete::Account* _account, const QString &uniqueName,
+ const TestbedContact::TestbedContactType type, const QString &displayName,
+ Kopete::MetaContact *parent );
+
+ ~TestbedContact();
+
+ virtual bool isReachable();
+ /**
+ * Serialize the contact's data into a key-value map
+ * suitable for writing to a file
+ */
+ virtual void serialize(QMap< QString, QString >& serializedData,
+ QMap< QString, QString >& addressBookData);
+ /**
+ * Return the actions for this contact
+ */
+ virtual QPtrList<KAction> *customContextMenuActions();
+ /**
+ * Returns a Kopete::ChatSession associated with this contact
+ */
+ virtual Kopete::ChatSession *manager( CanCreateFlags canCreate = CannotCreate );
+
+public slots:
+ /**
+ * Transmits an outgoing message to the server
+ * Called when the chat window send button has been pressed
+ * (in response to the relevant Kopete::ChatSession signal)
+ */
+ void sendMessage( Kopete::Message &message );
+ /**
+ * Called when an incoming message arrived
+ * This displays it in the chatwindow
+ */
+ void receivedMessage( const QString &message );
+
+protected slots:
+ /**
+ * Show the settings dialog
+ */
+ void showContactSettings();
+ /**
+ * Notify the contact that its current Kopete::ChatSession was
+ * destroyed - probably by the chatwindow being closed
+ */
+ void slotChatSessionDestroyed();
+
+protected:
+ Kopete::ChatSession* m_msgManager;
+ KActionCollection* m_actionCollection;
+ TestbedContactType m_type;
+ KAction* m_actionPrefs;
+};
+
+#endif