Mailcommon

filteractionwithstringlist.h
1 /*
2  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <[email protected]>
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 
14 namespace 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 <[email protected]>, based upon work by Stefan Taferner <[email protected]>
34  * @see FilterActionWithString FilterActionWithFolder FilterAction Filter
35  */
37 {
38  Q_OBJECT
39 
40 public:
41  /**
42  * @copydoc FilterAction::FilterAction
43  */
45 
46  /**
47  * @copydoc FilterAction::createParamWidget
48  */
49  Q_REQUIRED_RESULT 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 
71 protected:
72  QStringList mParameterList;
73 };
74 }
Q_OBJECTQ_OBJECT
Abstract base class for filter actions with a fixed set of string parameters.
QString name() const
Returns identifier name, ie.
FilterActionWithStringList(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
QString label() const
Returns i18n'd label, ie.
void setParamWidgetValue(QWidget *paramWidget) const override
The filter action shall set it's widget's contents from it's parameter.
void argsFromString(const QString &argsStr) override
Read extra arguments from given string.
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.
QWidget * createParamWidget(QWidget *parent) const override
Creates a widget for setting the filter action parameter.
QObject * parent() const const
Abstract base class for filter actions with a free-form string as parameter.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 03:59:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.