/* * Copyright (c) 2016-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include namespace Swift { class HighlightConfiguration { public: class ContactHighlight { public: friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version); public: std::string name; HighlightAction action; }; class KeywordHightlight { public: friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version); public: std::string keyword; bool matchCaseSensitive = false; HighlightAction action; }; friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version); public: std::vector keywordHighlights; std::vector contactHighlights; HighlightAction ownMentionAction; bool playSoundOnIncomingDirectMessages = false; bool showNotificationOnIncomingDirectMessages = false; bool playSoundOnIncomingGroupchatMessages = false; bool showNotificationOnIncomingGroupchatMessages = false; }; bool operator ==(HighlightConfiguration const& a, HighlightConfiguration const& b); template void HighlightConfiguration::ContactHighlight::serialize(Archive& ar, const unsigned int /*version*/) { ar & name; ar & action; } template void HighlightConfiguration::KeywordHightlight::serialize(Archive& ar, const unsigned int /*version*/) { ar & keyword; ar & matchCaseSensitive; ar & action; } template void HighlightConfiguration::serialize(Archive& ar, const unsigned int /*version*/) { ar & keywordHighlights; ar & contactHighlights; ar & ownMentionAction; ar & playSoundOnIncomingDirectMessages; ar & showNotificationOnIncomingDirectMessages; ar & playSoundOnIncomingGroupchatMessages; ar & showNotificationOnIncomingGroupchatMessages; } }