Mailcommon

filteractionwithstringlist.h
1/*
2 * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <taferner@kde.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 *
6 */
7
8#pragma once
9
10#include "filteractionwithstring.h"
11
12#include <QStringList>
13
14namespace MailCommon
15{
16/**
17 * @short Abstract base class for filter actions with a fixed set of string parameters.
18 *
19 * Abstract base class for mail filter actions that need a
20 * parameter which can be chosen from a fixed set, e.g. 'set
21 * identity'. Can create a KComboBox as parameter widget. A
22 * subclass of this must provide at least implementations for the
23 * following methods:
24 *
25 * @li virtual FilterAction::ReturnCodes FilterAction::process
26 * @li static FilterAction::newAction
27 *
28 * Additionally, it's constructor should populate the
29 * QStringList @p mParameterList with the valid parameter
30 * strings. The combobox will then contain be populated automatically
31 * with those strings. The default string will be the first one.
32 *
33 * @author Marc Mutz <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
34 * @see FilterActionWithString FilterActionWithFolder FilterAction Filter
35 */
37{
39
40public:
41 /**
42 * @copydoc FilterAction::FilterAction
43 */
45
46 /**
47 * @copydoc FilterAction::createParamWidget
48 */
49 [[nodiscard]] QWidget *createParamWidget(QWidget *parent) const override;
50
51 /**
52 * @copydoc FilterAction::applyParamWidgetValue
53 */
54 void applyParamWidgetValue(QWidget *paramWidget) override;
55
56 /**
57 * @copydoc FilterAction::setParamWidgetValue
58 */
59 void setParamWidgetValue(QWidget *paramWidget) const override;
60
61 /**
62 * @copydoc FilterAction::clearParamWidget
63 */
64 void clearParamWidget(QWidget *paramWidget) const override;
65
66 /**
67 * @copydoc FilterAction::argsFromString
68 */
69 void argsFromString(const QString &argsStr) override;
70
71protected:
72 QStringList mParameterList;
73};
74}
Abstract base class for filter actions with a fixed set of string parameters.
QWidget * createParamWidget(QWidget *parent) const override
Creates a widget for setting the filter action parameter.
void setParamWidgetValue(QWidget *paramWidget) const override
The filter action shall set it's widget's contents from it's parameter.
void applyParamWidgetValue(QWidget *paramWidget) override
The filter action shall set it's parameter from the widget's contents.
void clearParamWidget(QWidget *paramWidget) const override
The filter action shall clear it's parameter widget's contents.
FilterActionWithStringList(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
void argsFromString(const QString &argsStr) override
Read extra arguments from given string.
Abstract base class for filter actions with a free-form string as parameter.
QString name() const
Returns identifier name, ie.
QString label() const
Returns i18n'd label, ie.
The filter dialog.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 1 2024 18:50:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.