Mailcommon

filteractionrewriteheader.h
1 /*
2  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <[email protected]>
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  *
6  */
7 
8 #pragma once
9 
10 #include "filteractionwithstringlist.h"
11 
12 #include <QRegularExpression>
13 
14 namespace MailCommon
15 {
16 //=============================================================================
17 // FilterActionRewriteHeader - rewrite header
18 // Rewrite a header using a regexp.
19 //=============================================================================
20 class FilterActionRewriteHeader : public FilterActionWithStringList
21 {
22  Q_OBJECT
23 public:
24  explicit FilterActionRewriteHeader(QObject *parent = nullptr);
25  Q_REQUIRED_RESULT ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
26  Q_REQUIRED_RESULT SearchRule::RequiredPart requiredPart() const override;
27  Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
28  void setParamWidgetValue(QWidget *paramWidget) const override;
29  void applyParamWidgetValue(QWidget *paramWidget) override;
30  void clearParamWidget(QWidget *paramWidget) const override;
31 
32  Q_REQUIRED_RESULT QString argsAsString() const override;
33  void argsFromString(const QString &argsStr) override;
34 
35  Q_REQUIRED_RESULT QString displayString() const override;
36 
37  static FilterAction *newAction();
38 
39  Q_REQUIRED_RESULT bool isEmpty() const override;
40  Q_REQUIRED_RESULT QString informationAboutNotValidAction() const override;
41 
42 private:
43  QRegularExpression mRegex;
44  QString mReplacementString;
45 };
46 }
Q_OBJECTQ_OBJECT
RequiredPart
Possible required parts.
Definition: searchrule.h:68
ReturnCode
Describes the possible return codes of filter processing:
Definition: filteraction.h:45
FilterAction(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Oct 1 2022 04:00:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.