File indexing completed on 2024-09-22 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 "filteraction.h"
0011 
0012 namespace MailCommon
0013 {
0014 /**
0015  * @short Abstract base class for filter actions with a free-form string as parameter.
0016  *
0017  * Abstract base class for mail filter actions that need a
0018  * parameter that has a UOID, e.g. "set identity". A subclass of this
0019  * must provide at least implementations for the following methods:
0020  *
0021  * @li virtual FilterAction::ReturnCodes FilterAction::process
0022  * @li static FilterAction::newAction
0023  * @li the *ParamWidget* methods.
0024  *
0025  * @author Marc Mutz <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
0026  * @see FilterAction Filter
0027  */
0028 class FilterActionWithUOID : public FilterAction
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     /**
0034      * @copydoc FilterAction::FilterAction
0035      */
0036     FilterActionWithUOID(const QString &name, const QString &label, QObject *parent = nullptr);
0037 
0038     /**
0039      * @copydoc FilterAction::isEmpty
0040      */
0041     [[nodiscard]] bool isEmpty() const override;
0042 
0043     /**
0044      * @copydoc FilterAction::argsFromString
0045      */
0046     void argsFromString(const QString &argsStr) override;
0047 
0048     /**
0049      * @copydoc FilterAction::argsAsString
0050      */
0051     [[nodiscard]] QString argsAsString() const override;
0052 
0053     /**
0054      * @copydoc FilterAction::displayString
0055      */
0056     [[nodiscard]] QString displayString() const override;
0057 
0058 protected:
0059     uint mParameter;
0060 };
0061 }