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

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 "filteraction.h"
0011 
0012 namespace MailCommon
0013 {
0014 /**
0015  *  @short Abstract base class for filter actions with no parameter.
0016  *
0017  *  Abstract base class for mail filter actions that need no
0018  *  parameter, e.g. "Confirm Delivery". Creates an (empty) QWidget as
0019  *  parameter widget. A subclass of this must provide at least
0020  *  implementations for the following methods:
0021  *
0022  *  @li virtual FilterAction::ReturnCodes FilterAction::process
0023  *  @li static FilterAction::newAction
0024  *
0025  *  @author Marc Mutz <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
0026  *  @see FilterAction Filter
0027  */
0028 class FilterActionWithNone : public FilterAction
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     /**
0034      * @copydoc FilterAction::FilterAction
0035      */
0036     FilterActionWithNone(const QString &name, const QString &label, QObject *parent = nullptr);
0037 
0038     /**
0039      * @copydoc FilterAction::argsFromString
0040      */
0041     void argsFromString(const QString &) override;
0042 
0043     /**
0044      * @copydoc FilterAction::argsAsString
0045      */
0046     [[nodiscard]] QString argsAsString() const override;
0047 
0048     /**
0049      * @copydoc FilterAction::displayString
0050      */
0051     [[nodiscard]] QString displayString() const override;
0052 };
0053 }