summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-11-28 21:44:26 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-12-24 13:43:44 (GMT)
commitf08d7dc30a1242ea5a148377c5593188a8fb1317 (patch)
treef55fd5175d21c804528c5f531c08880621274e71 /Swift/Controllers/UnitTest/MockChatWindow.h
parent39209e6b419af417d3db011d7fd29433e88c8b3a (diff)
downloadswift-f08d7dc30a1242ea5a148377c5593188a8fb1317.zip
swift-f08d7dc30a1242ea5a148377c5593188a8fb1317.tar.bz2
Extract the Chat dialog management from MainController into ChatsManager.
There is a single unit test so far - but that's more than was there before, so I'm pushing. Expect more unit tests shortly. Resolves: #139
Diffstat (limited to 'Swift/Controllers/UnitTest/MockChatWindow.h')
-rw-r--r--Swift/Controllers/UnitTest/MockChatWindow.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Swift/Controllers/UnitTest/MockChatWindow.h b/Swift/Controllers/UnitTest/MockChatWindow.h
new file mode 100644
index 0000000..015bb9b
--- /dev/null
+++ b/Swift/Controllers/UnitTest/MockChatWindow.h
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "Swift/Controllers/ChatWindow.h"
+
+namespace Swift {
+ class MockChatWindow : public ChatWindow {
+ public:
+ MockChatWindow() {};
+ virtual ~MockChatWindow();
+
+ virtual void addMessage(const String& /*message*/, const String& /*senderName*/, bool /*senderIsSelf*/, const boost::optional<SecurityLabel>& /*label*/, const String& /*avatarPath*/) {};
+ virtual void addSystemMessage(const String& /*message*/) {};
+ virtual void addErrorMessage(const String& /*message*/) {};
+
+ virtual void setName(const String& name) {name_ = name;};
+ virtual void show() {};
+ virtual void activate() {};
+ virtual void setAvailableSecurityLabels(const std::vector<SecurityLabel>& labels) {labels_ = labels;};
+ virtual void setSecurityLabelsEnabled(bool enabled) {labelsEnabled_ = enabled;};
+ virtual void setUnreadMessageCount(int /*count*/) {};
+ virtual void convertToMUC() {};
+ virtual TreeWidget *getTreeWidget() {return NULL;};
+ virtual void setSecurityLabelsError() {};
+ virtual SecurityLabel getSelectedSecurityLabel() {return SecurityLabel();};
+ virtual void setInputEnabled(bool /*enabled*/) {};
+
+ boost::signal<void ()> onClosed;
+ boost::signal<void ()> onAllMessagesRead;
+ boost::signal<void (const String&)> onSendMessageRequest;
+
+ String name_;
+ std::vector<SecurityLabel> labels_;
+ bool labelsEnabled_;
+ };
+}
+