summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/jabberchatsession.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/jabber/jabberchatsession.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/jabber/jabberchatsession.h')
-rw-r--r--kopete/protocols/jabber/jabberchatsession.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/kopete/protocols/jabber/jabberchatsession.h b/kopete/protocols/jabber/jabberchatsession.h
new file mode 100644
index 00000000..66b4c63b
--- /dev/null
+++ b/kopete/protocols/jabber/jabberchatsession.h
@@ -0,0 +1,103 @@
+/*
+ jabbermessagemanager.h - Jabber Message Manager
+
+ Copyright (c) 2004 by Till Gerken <till@tantalo.net>
+
+ Kopete (c) 2004 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program 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 JABBERCHATSESSION_H
+#define JABBERCHATSESSION_H
+
+#include "kopetechatsession.h"
+
+#include "im.h"
+
+class JabberProtocol;
+class JabberAccount;
+class JabberBaseContact;
+namespace Kopete { class Message; }
+class QString;
+
+
+/**
+ * @author Till Gerken
+ */
+class JabberChatSession : public Kopete::ChatSession
+{
+ Q_OBJECT
+
+public:
+ JabberChatSession ( JabberProtocol *protocol, const JabberBaseContact *user,
+ Kopete::ContactPtrList others, const QString &resource = "",
+ const char *name = 0 );
+
+ ~JabberChatSession();
+
+ /**
+ * @brief Get the local user in the session
+ * @return the local user in the session, same as account()->myself()
+ */
+ const JabberBaseContact *user () const;
+
+ /**
+ * @brief get the account
+ * @return the account
+ */
+ JabberAccount *account() const ;
+
+ /**
+ * @brief Return the resource this manager is currently associated with.
+ * @return currently associated resource
+ */
+ const QString &resource () const;
+
+public slots:
+ /**
+ * Show a message to the chatwindow, or append it to the queue.
+ * This is the function protocols HAVE TO call for both incoming and outgoing messages
+ * if the message must be showed in the chatwindow
+ *
+ * This is an overloaded version of the original implementation which
+ * also accepts a resource the message originates from. The message manager
+ * will set its own resource to the resource the message was received from.
+ * See @ref JabberBaseContact::manager() about how to deal with instantiating
+ * new message managers for messages not originating from the same resource
+ * a manager already exists for.
+ */
+ void appendMessage ( Kopete::Message &msg, const QString &fromResource );
+
+private slots:
+ void slotSendTypingNotification ( bool typing );
+ void slotMessageSent ( Kopete::Message &message, Kopete::ChatSession *kmm );
+
+ /**
+ * Re-generate the display name
+ */
+ void slotUpdateDisplayName ();
+
+ void slotSendFile();
+
+private:
+ /**
+ * Send a notification (XMPP::MsgEvent) to the members of the chatsession.
+ * SlotSendTypingNotification uses it.
+ */
+ void sendNotification( XMPP::MsgEvent event );
+
+ QString mResource;
+};
+
+#endif
+
+// vim: set noet ts=4 sts=4 tw=4:
+