Mailcommon

filteractionwithstring.cpp
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#include "filteractionwithstring.h"
9
10#include <KLineEdit>
11
12using namespace MailCommon;
13
15 : FilterAction(name, label, parent)
16{
17}
18
20{
21 return mParameter.trimmed().isEmpty();
22}
23
25{
26 auto lineEdit = new KLineEdit(parent);
27 lineEdit->setClearButtonEnabled(true);
28 lineEdit->setObjectName(QLatin1StringView("lineedit"));
29 lineEdit->setTrapReturnKey(true);
30 lineEdit->setText(mParameter);
31
33
34 return lineEdit;
35}
36
38{
39 mParameter = static_cast<KLineEdit *>(paramWidget)->text();
40}
41
43{
44 static_cast<KLineEdit *>(paramWidget)->setText(mParameter);
45}
46
48{
49 static_cast<KLineEdit *>(paramWidget)->clear();
50}
51
53{
54 mParameter = argsStr;
55}
56
58{
59 return mParameter;
60}
61
66
67#include "moc_filteractionwithstring.cpp"
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 clearParamWidget(QWidget *paramWidget) const override
The filter action shall clear it's parameter widget's contents.
FilterActionWithString(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
QString argsAsString() const override
Return extra arguments as string.
bool isEmpty() const override
Determines whether this action is valid.
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.
QString displayString() const override
Returns a translated string describing this filter for visualization purposes, e.g.
Abstract base class for mail filter actions.
void filterActionModified()
Called to notify that the current FilterAction has had some value modification.
QString label() const
Returns i18n'd label, ie.
The filter dialog.
void textChanged(const QString &text)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
bool isEmpty() const const
QString toHtmlEscaped() const const
QString trimmed() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.