summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/private/kopeteviewmanager.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/private/kopeteviewmanager.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/private/kopeteviewmanager.h')
-rw-r--r--kopete/libkopete/private/kopeteviewmanager.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/kopete/libkopete/private/kopeteviewmanager.h b/kopete/libkopete/private/kopeteviewmanager.h
new file mode 100644
index 00000000..b1706906
--- /dev/null
+++ b/kopete/libkopete/private/kopeteviewmanager.h
@@ -0,0 +1,103 @@
+/*
+ kopeteviewmanager.h - View Manager
+
+ Copyright (c) 2003 by Jason Keirstead
+ Kopete (c) 2002-2003 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 KOPETEVIEWMANAGER_H
+#define KOPETEVIEWMANAGER_H
+
+#include "kopetemessage.h"
+#include "kopete_export.h"
+
+namespace Kopete
+{
+ class ChatSession;
+ class Protocol;
+ class Contact;
+ class MessageEvent;
+}
+
+class KopeteView;
+class QTextEdit;
+
+struct KopeteViewManagerPrivate;
+
+/**
+ * Relates an actual chat to the means used to view it.
+ */
+class KOPETE_EXPORT KopeteViewManager : public QObject
+{
+ Q_OBJECT
+ public:
+ /** This is a singleton class. Call this method to get a pointer to
+ * a KopeteViewManager.
+ */
+ static KopeteViewManager *viewManager();
+
+ KopeteViewManager();
+ ~KopeteViewManager();
+
+ /**
+ * Return a view for the supplied Kopete::ChatSession. If one already
+ * exists, it will be returned, otherwise, a new view is created.
+ * @param session The Kopete::ChatSession we are viewing.
+ * @param requestedPlugin Specifies the view plugin to use.
+ */
+ KopeteView *view( Kopete::ChatSession *session, const QString &requestedPlugin = QString::null );
+
+ /**
+ * Provide access to the list of KopeteChatWindow the class maintains.
+ */
+ KopeteView *activeView() const;
+
+ private:
+
+
+ KopeteViewManagerPrivate *d;
+ static KopeteViewManager *s_viewManager;
+
+ public slots:
+ /**
+ * Make a view visible and on top.
+ * @param manager The originating Kopete::ChatSession.
+ * @param outgoingMessage Whether the message is inbound or outbound.
+ * @param activate Indicate whether the view should be activated
+ * @todo Document @p activate
+ */
+ void readMessages( Kopete::ChatSession* manager, bool outgoingMessage, bool activate = false );
+
+ /**
+ * Called when a new message has been appended to the given
+ * Kopete::ChatSession. Procures a view for the message, and generates any notification events or displays messages, as appropriate.
+ * @param msg The new message
+ * @param manager The originating Kopete::ChatSession
+ */
+ void messageAppended( Kopete::Message &msg, Kopete::ChatSession *manager);
+
+ void nextEvent();
+
+ private slots:
+ void slotViewDestroyed( KopeteView *);
+ void slotChatSessionDestroyed( Kopete::ChatSession * );
+
+ /**
+ * An event has been deleted.
+ */
+ void slotEventDeleted( Kopete::MessageEvent * );
+
+ void slotPrefsChanged();
+ void slotViewActivated( KopeteView * );
+};
+
+#endif