File indexing completed on 2024-11-10 04:50:02

0001 /*
0002  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <taferner@kde.org>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  *
0006  */
0007 
0008 #pragma once
0009 
0010 #include "filteractionwithstringlist.h"
0011 
0012 namespace MailCommon
0013 {
0014 //=============================================================================
0015 // FilterActionAddHeader - add header
0016 // Add a header with the given value.
0017 //=============================================================================
0018 class FilterActionAddHeader : public FilterActionWithStringList
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit FilterActionAddHeader(QObject *parent = nullptr);
0023     ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
0024     QWidget *createParamWidget(QWidget *parent) const override;
0025     void setParamWidgetValue(QWidget *paramWidget) const override;
0026     void applyParamWidgetValue(QWidget *paramWidget) override;
0027     void clearParamWidget(QWidget *paramWidget) const override;
0028 
0029     [[nodiscard]] SearchRule::RequiredPart requiredPart() const override;
0030 
0031     [[nodiscard]] QString argsAsString() const override;
0032     void argsFromString(const QString &argsStr) override;
0033 
0034     [[nodiscard]] QString displayString() const override;
0035 
0036     static FilterAction *newAction();
0037 
0038     [[nodiscard]] QStringList sieveRequires() const override;
0039     [[nodiscard]] QString sieveCode() const override;
0040 
0041     [[nodiscard]] bool isEmpty() const override;
0042     [[nodiscard]] QString informationAboutNotValidAction() const override;
0043 
0044 private:
0045     QString mValue;
0046 };
0047 }