summaryrefslogtreecommitdiffstats
blob: 03adcfe28a7b0bcdac8f2afe4ab43139f6103e1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (c) 2010 Kevin Smith
 * Licensed under the GNU General Public License v3.
 * See Documentation/Licenses/GPLv3.txt for more information.
 */

#pragma once

#include "Swift/Controllers/UIInterfaces/ChatWindow.h"

namespace Swift {
	class MockChatWindow : public ChatWindow {
		public:
			MockChatWindow() {};
			virtual ~MockChatWindow();

			virtual String addMessage(const String& message, const String& /*senderName*/, bool /*senderIsSelf*/, const boost::optional<SecurityLabel>& /*label*/, const String& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";};
			virtual String addAction(const String& message, const String& /*senderName*/, bool /*senderIsSelf*/, const boost::optional<SecurityLabel>& /*label*/, const String& /*avatarPath*/, const boost::posix_time::ptime&) {lastMessageBody_ = message; return "";};
			virtual void addSystemMessage(const String& /*message*/) {};
			virtual void addErrorMessage(const String& /*message*/) {};
			virtual void addPresenceMessage(const String& /*message*/) {};

			virtual void setContactChatState(ChatState::ChatStateType /*state*/) {};
			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 void setSecurityLabelsError() {};
			virtual SecurityLabel getSelectedSecurityLabel() {return SecurityLabel();};
			virtual void setInputEnabled(bool /*enabled*/) {};
			virtual void setRosterModel(Roster* /*roster*/) {};
			virtual void setTabComplete(TabComplete*) {};
			virtual void replaceLastMessage(const Swift::String&) {};
			void setAckState(const String& /*id*/, AckState /*state*/) {};
			virtual void flash() {};

			boost::signal<void ()> onClosed;
			boost::signal<void ()> onAllMessagesRead;
			boost::signal<void (const String&)> onSendMessageRequest;

			String name_;
			String lastMessageBody_;
			std::vector<SecurityLabel> labels_;
			bool labelsEnabled_;
	};
}