blob: e9f14dfad56edbdb7261cfefc722cd99dd92f9cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/*
* Copyright (c) 2012 Maciej Niedzielski
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
* Copyright (c) 2015-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/Controllers/Highlighting/HighlightAction.h>
namespace Swift {
bool operator ==(const HighlightAction& a, const HighlightAction& b) {
if (a.getFrontColor() != b.getFrontColor()) {
return false;
}
if (a.getBackColor() != b.getBackColor()) {
return false;
}
if (a.getSoundFilePath() != b.getSoundFilePath()) {
return false;
}
if (a.isSystemNotificationEnabled() != b.isSystemNotificationEnabled()) {
return false;
}
return true;
}
bool operator !=(const HighlightAction& a, const HighlightAction& b) {
return !(a == b);
}
void HighlightAction::setFrontColor(const boost::optional<std::string>& frontColor) {
frontColor_ = frontColor;
}
boost::optional<std::string> HighlightAction::getFrontColor() const {
return frontColor_;
}
void HighlightAction::setBackColor(const boost::optional<std::string>& backColor) {
backColor_ = backColor;
}
boost::optional<std::string> HighlightAction::getBackColor() const {
return backColor_;
}
void HighlightAction::setSoundFilePath(const boost::optional<std::string>& soundFilePath) {
soundFilePath_ = soundFilePath;
}
boost::optional<std::string> HighlightAction::getSoundFilePath() const {
return soundFilePath_;
}
void HighlightAction::setSystemNotificationEnabled(bool systemNotificationEnabled) {
systemNotificaitonEnabled_ = systemNotificationEnabled;
}
bool HighlightAction::isSystemNotificationEnabled() const {
return systemNotificaitonEnabled_;
}
bool HighlightAction::isEmpty() const {
return !frontColor_.is_initialized() && !backColor_.is_initialized() && !soundFilePath_.is_initialized() && !systemNotificaitonEnabled_;
}
}
|