Messagelib

dkimrule.h
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8#include "messageviewer_export.h"
9#include <QDebug>
10
11namespace MessageViewer
12{
13/**
14 * @brief The DKIMRule class
15 * @author Laurent Montel <montel@kde.org>
16 */
17class MESSAGEVIEWER_EXPORT DKIMRule
18{
19 Q_GADGET
20public:
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 [[nodiscard]] QString domain() const;
31 void setDomain(const QString &domain);
32
33 [[nodiscard]] QStringList signedDomainIdentifier() const;
34 void setSignedDomainIdentifier(const QStringList &signedDomainIdentifier);
35
36 [[nodiscard]] QString from() const;
37 void setFrom(const QString &from);
38
39 [[nodiscard]] bool enabled() const;
40 void setEnabled(bool enabled);
41
42 [[nodiscard]] bool isValid() const;
43
44 [[nodiscard]] RuleType ruleType() const;
45 void setRuleType(MessageViewer::DKIMRule::RuleType ruleType);
46
47 [[nodiscard]] QString listId() const;
48 void setListId(const QString &listId);
49
50 [[nodiscard]] bool operator==(const DKIMRule &other) const;
51 [[nodiscard]] bool operator!=(const DKIMRule &other) const;
52
53 [[nodiscard]] int priority() const;
54 void setPriority(int priority);
55
56private:
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}
66Q_DECLARE_TYPEINFO(MessageViewer::DKIMRule, Q_RELOCATABLE_TYPE);
67MESSAGEVIEWER_EXPORT QDebug operator<<(QDebug d, const MessageViewer::DKIMRule &t);
The DKIMRule class.
Definition dkimrule.h:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 11:49:56 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.