/* * Copyright (c) 2013 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include #include namespace Swift { class ChatMessageParser { public: ChatMessageParser(const std::map& emoticons, HighlightRulesListPtr highlightRules); ChatWindow::ChatMessage parseMessageBody(const std::string& body, bool senderIsSelf = false); private: ChatWindow::ChatMessage emoticonHighlight(const ChatWindow::ChatMessage& parsedMessage); ChatWindow::ChatMessage splitHighlight(const ChatWindow::ChatMessage& parsedMessage); std::map emoticons_; HighlightRulesListPtr highlightRules_; }; }