Messagelib

dkimmanagerrules.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
9#include "messageviewer_export.h"
10#include <KSharedConfig>
11#include <MessageViewer/DKIMRule>
12#include <QList>
13#include <QObject>
14namespace MessageViewer
15{
16/**
17 * @brief The DKIMManagerRules class
18 * @author Laurent Montel <montel@kde.org>
19 */
20class MESSAGEVIEWER_EXPORT DKIMManagerRules : public QObject
21{
22 Q_OBJECT
23public:
24 explicit DKIMManagerRules(QObject *parent = nullptr);
25 ~DKIMManagerRules() override;
26 static DKIMManagerRules *self();
27
28 void addRule(const DKIMRule &rule);
29
30 [[nodiscard]] QList<DKIMRule> rules() const;
31
32 void saveRules(const QList<DKIMRule> &lst);
33
34 void clear();
35
36 [[nodiscard]] int importRules(const QString &fileName);
37 void exportRules(const QString &fileName, const QList<DKIMRule> &lst = {});
38
39 [[nodiscard]] bool isEmpty() const;
40
41private:
42 [[nodiscard]] MESSAGEVIEWER_NO_EXPORT int loadRules(const QString &fileName = QString());
43 MESSAGEVIEWER_NO_EXPORT void save(const QString &fileName = QString(), const QList<DKIMRule> &lst = {});
44 [[nodiscard]] MESSAGEVIEWER_NO_EXPORT QStringList ruleGroups(const KSharedConfig::Ptr &config) const;
45 QList<DKIMRule> mRules;
46};
47}
The DKIMManagerRules class.
The DKIMRule class.
Definition dkimrule.h:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.