Messagelib

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

KDE's Doxygen guidelines are available online.