Messagelib

dkimrule.cpp
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "dkimrule.h"
8
9using namespace MessageViewer;
10DKIMRule::DKIMRule() = default;
11
12QString DKIMRule::domain() const
13{
14 return mDomain;
15}
16
17void DKIMRule::setDomain(const QString &domain)
18{
19 mDomain = domain;
20}
21
22QStringList DKIMRule::signedDomainIdentifier() const
23{
24 return mSignedDomainIdentifier;
25}
26
27void DKIMRule::setSignedDomainIdentifier(const QStringList &signedDomainIdentifier)
28{
29 mSignedDomainIdentifier = signedDomainIdentifier;
30}
31
32QString DKIMRule::from() const
33{
34 return mFrom;
35}
36
37void DKIMRule::setFrom(const QString &from)
38{
39 mFrom = from;
40}
41
42bool DKIMRule::enabled() const
43{
44 return mEnabled;
45}
46
47void DKIMRule::setEnabled(bool enabled)
48{
49 mEnabled = enabled;
50}
51
52bool DKIMRule::isValid() const
53{
54 return !mDomain.isEmpty() && !mFrom.isEmpty() && (mRuleType != DKIMRule::RuleType::Unknown);
55}
56
57DKIMRule::RuleType DKIMRule::ruleType() const
58{
59 return mRuleType;
60}
61
62void DKIMRule::setRuleType(RuleType ruleType)
63{
64 mRuleType = ruleType;
65}
66
67QString DKIMRule::listId() const
68{
69 return mListId;
70}
71
72void DKIMRule::setListId(const QString &listId)
73{
74 mListId = listId;
75}
76
77bool DKIMRule::operator==(const DKIMRule &other) const
78{
79 if (other.domain() == mDomain && other.signedDomainIdentifier() == mSignedDomainIdentifier && other.from() == mFrom && other.listId() == mListId
80 && other.ruleType() == mRuleType && other.enabled() == mEnabled && other.priority() == mPriority) {
81 return true;
82 }
83 return false;
84}
85
86bool DKIMRule::operator!=(const DKIMRule &other) const
87{
88 return !operator==(other);
89}
90
91int DKIMRule::priority() const
92{
93 return mPriority;
94}
95
96void DKIMRule::setPriority(int priority)
97{
98 mPriority = priority;
99}
100
101QDebug operator<<(QDebug d, const DKIMRule &t)
102{
103 d << " mDomain: " << t.domain();
104 d << " mSignedDomainIdentifier: " << t.signedDomainIdentifier();
105 d << " mFrom: " << t.from();
106 d << " mEnabled: " << t.enabled();
107 d << " mRuleType " << t.ruleType();
108 d << " mListId " << t.listId();
109 d << " mPriority " << t.priority();
110 return d;
111}
112
113#include "moc_dkimrule.cpp"
The DKIMRule class.
Definition dkimrule.h:18
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.