Messagelib

dkimrule.h
1 /*
2  SPDX-FileCopyrightText: 2019-2023 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 #include "messageviewer_export.h"
9 #include <QDebug>
10 
11 namespace MessageViewer
12 {
13 /**
14  * @brief The DKIMRule class
15  * @author Laurent Montel <[email protected]>
16  */
17 class MESSAGEVIEWER_EXPORT DKIMRule
18 {
19  Q_GADGET
20 public:
21  enum class RuleType {
22  Unknown = 0,
23  MustBeSigned = 1,
24  CanBeSigned = 2,
25  IgnoreEmailNotSigned = 3,
26  };
27  Q_ENUM(RuleType)
28 
29  DKIMRule();
30  Q_REQUIRED_RESULT QString domain() const;
31  void setDomain(const QString &domain);
32 
33  Q_REQUIRED_RESULT QStringList signedDomainIdentifier() const;
34  void setSignedDomainIdentifier(const QStringList &signedDomainIdentifier);
35 
36  Q_REQUIRED_RESULT QString from() const;
37  void setFrom(const QString &from);
38 
39  Q_REQUIRED_RESULT bool enabled() const;
40  void setEnabled(bool enabled);
41 
42  Q_REQUIRED_RESULT bool isValid() const;
43 
44  Q_REQUIRED_RESULT RuleType ruleType() const;
45  void setRuleType(MessageViewer::DKIMRule::RuleType ruleType);
46 
47  Q_REQUIRED_RESULT QString listId() const;
48  void setListId(const QString &listId);
49 
50  Q_REQUIRED_RESULT bool operator==(const DKIMRule &other) const;
51  Q_REQUIRED_RESULT bool operator!=(const DKIMRule &other) const;
52 
53  Q_REQUIRED_RESULT int priority() const;
54  void setPriority(int priority);
55 
56 private:
57  QStringList mSignedDomainIdentifier;
58  QString mDomain;
59  QString mFrom;
60  QString mListId;
61  RuleType mRuleType = DKIMRule::RuleType::Unknown;
62  int mPriority = 1000;
63  bool mEnabled = true;
64 };
65 }
66 Q_DECLARE_TYPEINFO(MessageViewer::DKIMRule, Q_RELOCATABLE_TYPE);
67 MESSAGEVIEWER_EXPORT QDebug operator<<(QDebug d, const MessageViewer::DKIMRule &t);
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
The DKIMRule class.
Definition: dkimrule.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:00:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.