Messagelib

dkimmanageruleswidget.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 <MessageViewer/DKIMRule>
10#include <QTreeWidgetItem>
11#include <QWidget>
12class QTreeWidget;
13namespace MessageViewer
14{
15class DKIMManageRulesComboBox;
16/**
17 * @brief The DKIMManageRulesWidgetItem class
18 * @author Laurent Montel <montel@kde.org>
19 */
20class MESSAGEVIEWER_EXPORT DKIMManageRulesWidgetItem : public QTreeWidgetItem
21{
22public:
23 enum ColumnType {
24 Enabled = 0,
25 Domain = 1,
26 ListId = 2,
27 From = 3,
28 SDid = 4,
29 RuleType = 5,
30 Priority = 6,
31 };
32
33 explicit DKIMManageRulesWidgetItem(QTreeWidget *parent = nullptr);
35
36 [[nodiscard]] MessageViewer::DKIMRule rule() const;
37 void setRule(const MessageViewer::DKIMRule &rule);
38
39private:
40 MESSAGEVIEWER_NO_EXPORT void updateInfo();
42 DKIMManageRulesComboBox *const mRuleTypeCombobox;
43};
44
45/**
46 * @brief The DKIMManageRulesWidget class
47 * @author Laurent Montel <montel@kde.org>
48 */
49class MESSAGEVIEWER_EXPORT DKIMManageRulesWidget : public QWidget
50{
51 Q_OBJECT
52public:
53 explicit DKIMManageRulesWidget(QWidget *parent = nullptr);
54 ~DKIMManageRulesWidget() override;
55 void loadSettings();
56 void saveSettings();
57 [[nodiscard]] QByteArray saveHeaders() const;
58 void restoreHeaders(const QByteArray &header);
59
60 void addRule();
61 [[nodiscard]] QList<MessageViewer::DKIMRule> rules() const;
62
63 void updateRules();
64Q_SIGNALS:
65 void updateExportButton(bool enabled);
66
67private:
68 MESSAGEVIEWER_NO_EXPORT void modifyRule(DKIMManageRulesWidgetItem *rulesItem);
69 MESSAGEVIEWER_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &);
70 MESSAGEVIEWER_NO_EXPORT void duplicateRule(DKIMManageRulesWidgetItem *rulesItem);
71 MESSAGEVIEWER_NO_EXPORT void emitUpdateExportButton();
72 QTreeWidget *const mTreeWidget;
73};
74}
The DKIMManageRulesWidgetItem class.
The DKIMManageRulesWidget 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 Fri May 17 2024 11:53:08 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.