File indexing completed on 2024-09-22 04:50:01

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 "filteractionwithstring.h"
0011 
0012 namespace MailCommon
0013 {
0014 /**
0015  * @short Abstract base class for filter actions with a mail address as parameter.
0016  *
0017  * Abstract base class for mail filter actions that need a mail
0018  * address as parameter, e.g. 'forward to'. Can create a
0019  * KComboBox (capable of completion from the address book) as
0020  * parameter widget. A subclass of this must provide at least
0021  * implementations for the following methods:
0022  *
0023  * @li virtual FilterAction::ReturnCodes FilterAction::process
0024  * @li static FilterAction::newAction
0025  *
0026  * @author Marc Mutz <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
0027  * @see FilterActionWithString FilterAction Filter
0028  */
0029 class FilterActionWithAddress : public FilterActionWithString
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     /**
0035      * @copydoc FilterAction::FilterAction
0036      */
0037     FilterActionWithAddress(const QString &name, const QString &label, QObject *parent = nullptr);
0038 
0039     /**
0040      * @copydoc FilterAction::createParamWidget
0041      */
0042     [[nodiscard]] QWidget *createParamWidget(QWidget *parent) const override;
0043 
0044     /**
0045      * @copydoc FilterAction::applyParamWidgetValue
0046      */
0047     void applyParamWidgetValue(QWidget *paramWidget) override;
0048 
0049     /**
0050      * @copydoc FilterAction::setParamWidgetValue
0051      */
0052     void setParamWidgetValue(QWidget *paramWidget) const override;
0053 
0054     /**
0055      * @copydoc FilterAction::clearParamWidget
0056      */
0057     void clearParamWidget(QWidget *paramWidget) const override;
0058 };
0059 }