Mailcommon

filteractionwithstring.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 "filteraction.h"
11 
12 namespace MailCommon
13 {
14 /**
15  * @short Abstract base class for filter actions with a free-form string as parameter.
16  *
17  * Abstract base class for mail filter actions that need a
18  * free-form parameter, e.g. 'set transport' or 'set reply to'. Can
19  * create a QLineEdit as parameter widget. A subclass of this
20  * must provide at least implementations for the following methods:
21  *
22  * @li virtual FilterAction::ReturnCodes FilterAction::process
23  * @li static FilterAction::newAction
24  *
25  * @author Marc Mutz <[email protected]>, based upon work by Stefan Taferner <[email protected]>
26  * @see FilterAction Filter
27  */
29 {
30  Q_OBJECT
31 public:
32  /**
33  * @copydoc FilterAction::FilterAction
34  */
35  FilterActionWithString(const QString &name, const QString &label, QObject *parent = nullptr);
36 
37  /**
38  * @copydoc FilterAction::isEmpty
39  */
40  Q_REQUIRED_RESULT bool isEmpty() const override;
41 
42  /**
43  * @copydoc FilterAction::createParamWidget
44  */
45  Q_REQUIRED_RESULT QWidget *createParamWidget(QWidget *parent) const override;
46 
47  /**
48  * @copydoc FilterAction::applyParamWidgetValue
49  */
50  void applyParamWidgetValue(QWidget *paramWidget) override;
51 
52  /**
53  * @copydoc FilterAction::setParamWidgetValue
54  */
55  void setParamWidgetValue(QWidget *paramWidget) const override;
56 
57  /**
58  * @copydoc FilterAction::clearParamWidget
59  */
60  void clearParamWidget(QWidget *paramWidget) const override;
61 
62  /**
63  * @copydoc FilterAction::argsFromString
64  */
65  void argsFromString(const QString &argsStr) override;
66 
67  /**
68  * @copydoc FilterAction::argsAsString
69  */
70  Q_REQUIRED_RESULT QString argsAsString() const override;
71 
72  /**
73  * @copydoc FilterAction::displayString
74  */
75  Q_REQUIRED_RESULT QString displayString() const override;
76 
77 protected:
78  QString mParameter;
79 };
80 }
Q_OBJECTQ_OBJECT
QString displayString() const override
Returns a translated string describing this filter for visualization purposes, e.g.
void clearParamWidget(QWidget *paramWidget) const override
The filter action shall clear it's parameter widget's contents.
void argsFromString(const QString &argsStr) override
Read extra arguments from given string.
QString name() const
Returns identifier name, ie.
Abstract base class for mail filter actions.
Definition: filteraction.h:38
QString label() const
Returns i18n'd label, ie.
FilterActionWithString(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
QString argsAsString() const override
Return extra arguments as string.
void applyParamWidgetValue(QWidget *paramWidget) override
The filter action shall set it's parameter from the widget's contents.
void setParamWidgetValue(QWidget *paramWidget) const override
The filter action shall set it's widget's contents from it's parameter.
QWidget * createParamWidget(QWidget *parent) const override
Creates a widget for setting the filter action parameter.
bool isEmpty() const override
Determines whether this action is valid.
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 Mon May 8 2023 03:58:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.