/* * Copyright (c) 2012 Maciej Niedzielski * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* * Copyright (c) 2014-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include namespace Swift { class HighlightAction { public: void setFrontColor(const boost::optional& frontColor); boost::optional getFrontColor() const; void setBackColor(const boost::optional& backColor); boost::optional getBackColor() const; void setSoundFilePath(const boost::optional& soundFilePath); boost::optional getSoundFilePath() const; void setSystemNotificationEnabled(bool systemNotificationEnabled); bool isSystemNotificationEnabled() const; // @return returns true if the HighlightAction would result in no // noticable action to the user. bool isEmpty() const; private: friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version); private: // Highlight color. boost::optional frontColor_; boost::optional backColor_; // Audio notification. boost::optional soundFilePath_; // macOS Notification Center or similar. bool systemNotificaitonEnabled_ = false; }; bool operator ==(const HighlightAction& a, const HighlightAction& b); bool operator !=(const HighlightAction& a, const HighlightAction& b); template void HighlightAction::serialize(Archive& ar, const unsigned int /*version*/) { ar & frontColor_; ar & backColor_; ar & soundFilePath_; ar & systemNotificaitonEnabled_; } }