Messagelib

scamdetectioninfo.cpp
1 /*
2  SPDX-FileCopyrightText: 2021-2023 Laurent Montel <[email protected]>
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 << "isValid: " << t.isValid();
47  d << "Enabled " << t.enabled();
48  d << "DomainOrName " << t.domainOrEmail();
49  d << "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 }
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
bool isEmpty() const const
The ScamDetectionInfo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Mar 22 2023 04:07:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.