diff options
Diffstat (limited to 'Swift/Controllers/UIInterfaces/ChatWindow.h')
-rw-r--r-- | Swift/Controllers/UIInterfaces/ChatWindow.h | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/Swift/Controllers/UIInterfaces/ChatWindow.h b/Swift/Controllers/UIInterfaces/ChatWindow.h index 8ee083d..7aaa90e 100644 --- a/Swift/Controllers/UIInterfaces/ChatWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatWindow.h @@ -1,113 +1,140 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <memory> #include <string> #include <vector> #include <boost/algorithm/string.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/optional.hpp> #include <boost/signals2.hpp> #include <Swiften/Base/Tristate.h> #include <Swiften/Elements/ChatState.h> #include <Swiften/Elements/Form.h> #include <Swiften/Elements/MUCOccupant.h> #include <Swiften/Elements/SecurityLabelsCatalog.h> #include <Swiften/MUC/MUCBookmark.h> -#include <Swift/Controllers/HighlightManager.h> +#include <Swift/Controllers/Highlighting/HighlightManager.h> namespace Swift { class AvatarManager; class TreeWidget; class Roster; class TabComplete; class RosterItem; class ContactRosterItem; class FileTransferController; class UserSearchWindow; class ChatWindow { public: class ChatMessagePart { public: virtual ~ChatMessagePart() {} }; class ChatMessage { public: ChatMessage() {} ChatMessage(const std::string& text) { append(std::make_shared<ChatTextMessagePart>(text)); } void append(const std::shared_ptr<ChatMessagePart>& part) { parts_.push_back(part); } const std::vector<std::shared_ptr<ChatMessagePart> >& getParts() const { return parts_; } void setParts(const std::vector<std::shared_ptr<ChatMessagePart> >& parts) { parts_ = parts; } - void setFullMessageHighlightAction(const HighlightAction& action) { - fullMessageHighlightAction_ = action; + void setHighlightActionSender(const HighlightAction& action) { + highlightActionSender_ = action; } - const HighlightAction& getFullMessageHighlightAction() const { - return fullMessageHighlightAction_; + const HighlightAction& getHighlightActionSender() const { + return highlightActionSender_; + } + + void setHighlightActionOwnMention(const HighlightAction& action) { + highlightActionOwnMention_ = action; + } + + const HighlightAction& getHighlightActionOwnMention() const { + return highlightActionOwnMention_; + } + + void setHighlightActionGroupMessage(const HighlightAction& action) { + highlightActionGroupMessage_ = action; + } + + const HighlightAction& getHighlightActionGroupMessage() const { + return highlightActionGroupMessage_; + } + + void setHighlightActonDirectMessage(const HighlightAction& action) { + highlightActionDirectMessage_ = action; + } + + const HighlightAction& getHighlightActionDirectMessage() const { + return highlightActionDirectMessage_; } bool isMeCommand() const { return isMeCommand_; } void setIsMeCommand(bool isMeCommand) { isMeCommand_ = isMeCommand; } private: std::vector<std::shared_ptr<ChatMessagePart> > parts_; - HighlightAction fullMessageHighlightAction_; + HighlightAction highlightActionSender_; + HighlightAction highlightActionOwnMention_; + HighlightAction highlightActionGroupMessage_; + HighlightAction highlightActionDirectMessage_; bool isMeCommand_ = false; }; class ChatTextMessagePart : public ChatMessagePart { public: ChatTextMessagePart(const std::string& text) : text(text) {} std::string text; }; class ChatURIMessagePart : public ChatMessagePart { public: ChatURIMessagePart(const std::string& target) : target(target) {} std::string target; }; class ChatEmoticonMessagePart : public ChatMessagePart { public: std::string imagePath; std::string alternativeText; }; class ChatHighlightingMessagePart : public ChatMessagePart { public: HighlightAction action; std::string text; }; enum AckState {Pending, Received, Failed}; enum ReceiptState {ReceiptRequested, ReceiptReceived, ReceiptFailed}; |