Messagelib

scamdetectioninfo.cpp
1 /*
2  SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 
6 */
7 
8 #include "scamdetectioninfo.h"
9 using namespace MessageViewer;
10 ScamDetectionInfo::ScamDetectionInfo() = default;
11 
12 ScamDetectionInfo::~ScamDetectionInfo() = default;
13 
14 const QString &ScamDetectionInfo::domainOrEmail() const
15 {
16  return mDomainOrEmail;
17 }
18 
19 void ScamDetectionInfo::setDomainOrEmail(const QString &newDomainOrEmail)
20 {
21  mDomainOrEmail = newDomainOrEmail;
22 }
23 
24 bool ScamDetectionInfo::enabled() const
25 {
26  return mEnabled;
27 }
28 
29 void ScamDetectionInfo::setEnabled(bool newEnabled)
30 {
31  mEnabled = newEnabled;
32 }
33 
34 bool ScamDetectionInfo::isValid() const
35 {
36  return !mDomainOrEmail.isEmpty();
37 }
38 
39 ScamDetectionInfo::ScamDetectionFields ScamDetectionInfo::scamChecks() const
40 {
41  return mFields;
42 }
43 
45 {
46  d.space() << "isValid" << t.isValid();
47  d.space() << "Enabled" << t.enabled();
48  d.space() << "DomainOrName" << t.domainOrEmail();
49  d.space() << "scamChecks" << t.scamChecks();
50  return d;
51 }
52 
53 bool ScamDetectionInfo::operator==(const ScamDetectionInfo &other) const
54 {
55  return domainOrEmail() == other.domainOrEmail() && enabled() == other.enabled() && scamChecks() == other.scamChecks();
56 }
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
QDebug & space()
bool isEmpty() const const
The ScamDetectionInfo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.