12 #include <boost/optional.hpp> 22 boost::optional<QUrl> _customSoundUrl,
23 std::shared_ptr<QColor> _color,
bool _showInMentions)
38 false,
false, boost::none,
nullptr,
false,
62 std::shared_ptr<QColor>
color{};
102 return !(*
this == other);
118 [[nodiscard]]
bool full()
const 128 os <<
"Alert: " << (result.
alert ?
"Yes" :
"No") <<
", " 129 <<
"Play sound: " << (result.
playSound ?
"Yes" :
"No") <<
" (" 136 << (result.
color ? result.
color->name().toStdString() :
"") <<
", " 137 <<
"Show in mentions: " << (result.
showInMentions ?
"Yes" :
"No");
143 using Checker = std::function<boost::optional<HighlightResult>(
145 const QString &senderName,
const QString &originalMessage,
158 [[nodiscard]] std::pair<bool, HighlightResult> check(
160 const QString &senderName,
const QString &originalMessage,
169 void rebuildChecks(
Settings &settings);
173 pajlada::SettingListener rebuildListener_;
174 pajlada::Signals::SignalHolder signalHolder_;
bool full() const
Returns true if all side-effects have been enabled.
Definition: HighlightController.hpp:118
static HighlightResult emptyResult()
Construct an empty HighlightResult with all side-effects disabled.
Definition: HighlightController.hpp:35
bool playSound
true if highlight should play a notification sound
Definition: HighlightController.hpp:50
bool empty() const
Returns true if no side-effect has been enabled.
Definition: HighlightController.hpp:108
Definition: Singleton.hpp:10
bool showInMentions
true if highlight should show message in the /mentions split
Definition: HighlightController.hpp:67
Definition: SeventvEventAPISubscription.hpp:67
HighlightResult(bool _alert, bool _playSound, boost::optional< QUrl > _customSoundUrl, std::shared_ptr< QColor > _color, bool _showInMentions)
Definition: HighlightController.hpp:21
Definition: Application.cpp:48
Definition: HighlightController.hpp:142
Definition: HighlightController.hpp:150
std::function< boost::optional< HighlightResult >(const MessageParseArgs &args, const std::vector< Badge > &badges, const QString &senderName, const QString &originalMessage, const MessageFlags &messageFlags, bool self)> Checker
Definition: HighlightController.hpp:146
friend std::ostream & operator<<(std::ostream &os, const HighlightResult &result)
Definition: HighlightController.hpp:125
Definition: UniqueAccess.hpp:53
bool operator!=(const HighlightResult &other) const
Definition: HighlightController.hpp:100
bool operator==(const HighlightResult &other) const
Definition: HighlightController.hpp:69
bool alert
true if highlight should trigger the taskbar to flash
Definition: HighlightController.hpp:45
Settings which are availlable for reading and writing on the gui thread.
Definition: Settings.hpp:78
int64_t FlagsEnum< MessageFlag > MessageFlags
Definition: Channel.hpp:20
std::shared_ptr< QColor > color
set if highlight should set a background color
Definition: HighlightController.hpp:62
Checker cb
Definition: HighlightController.hpp:147
Definition: HighlightController.hpp:20
Definition: MessageBuilder.hpp:43
boost::optional< QUrl > customSoundUrl
Can be set to a different sound that should play when this highlight is activated.
Definition: HighlightController.hpp:57