Don't keep compiling/run if something failed.
[kdevelopdvcssupport.git] / plugins / teamwork / messagemanager.h
blob8d43e71c2cfad969d63231363d765bffbc6f393e
1 /***************************************************************************
2 Copyright 2006 David Nolden <david.nolden.kdevelop@art-master.de>
3 ***************************************************************************/
5 /***************************************************************************
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 ***************************************************************************/
14 #ifndef MESSAGEMANAGER_H
15 #define MESSAGEMANAGER_H
16 #include <list>
17 #include "kdevteamwork_messages.h"
18 #include "utils.h"
19 #include "indocumentmessage.h"
20 #include "autoconstructpointer.h"
22 class QDomElement;
23 class KDevTeamwork;
24 class LocalPatchSource;
25 class KDevTeamworkTextMessage;
26 class MessageHistory;
27 class MessageHistoryManager;
28 class QAction;
29 //class LocalPatchSource::Identity;
31 class KDevTeamworkUser;
33 typedef SafeSharedPtr<KDevTeamworkUser, BoostSerialization> KDevTeamworkUserPointer;
35 class ConversationManager;
38 BIND_LIST_2( MessageManagerMessages, KDevTeamworkTextMessage, InDocumentMessage )
40 /** This class manages the KDevTeamworkTextMessage-based messages
43 class MessageManager : public QObject {
44 Q_OBJECT
45 public:
46 MessageManager( KDevTeamwork* tw );
47 ~MessageManager();
49 void restorePartialProjectSession( const QDomElement* el );
51 void savePartialProjectSession( QDomElement* el );
53 int receiveMessage( MessageInterface* msg );
54 int receiveMessage( KDevTeamworkTextMessage* msg );
55 int receiveMessage( InDocumentMessage* msg );
57 int processMessage( KDevTeamworkTextMessage* msg );
59 KDevTeamwork* teamwork();
61 void log( const QString& str, LogLevel level = Info );
63 MessageHistoryManager& historyManager();
64 ConversationManager& conversationManager();
66 void showMessageHistory( const QList<KDevTeamworkUserPointer>& users = QList<KDevTeamworkUserPointer>(), const QString& context = "" );
68 void fillMessageMenu( QMenu* menu, MessagePointer msg );
70 void showMessage( const MessagePointer& msg );
72 public slots:
73 ///This can be used to indicate that information about the message(like icon, text, etc.) has been changed.
74 void updateMessage( const MessagePointer& msg );
75 void slotShowMessage();
76 void init();
78 signals:
79 ///Is emitted whenver a message is reported to have changed.(through updateMessage(..))
80 void messageUpdated( const MessagePointer& msg );
82 private:
83 MessageDispatcher<MessageManager, MessageManagerMessages> dispatcher_;
84 KDevTeamwork* m_teamwork;
86 AutoConstructPointer<ConversationManager> m_conversationManager;
87 AutoConstructPointer<MessageHistoryManager> m_historyManager;
89 QAction* m_showMessageAction;
93 #endif
95 // kate: space-indent on; indent-width 2; tab-width 2; replace-tabs on