Mailcommon

filteractionwithtest.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 "filteractionwithtest.h"
9
10#include "filter/soundtestwidget.h"
11
12using namespace MailCommon;
13
14FilterActionWithTest::FilterActionWithTest(const QString &name, const QString &label, QObject *parent)
15 : FilterAction(name, label, parent)
16{
17}
18
19FilterActionWithTest::~FilterActionWithTest() = default;
20
21bool FilterActionWithTest::isEmpty() const
22{
23 return mParameter.trimmed().isEmpty();
24}
25
26QWidget *FilterActionWithTest::createParamWidget(QWidget *parent) const
27{
28 auto soundWidget = new SoundTestWidget(parent);
29 soundWidget->setUrl(mParameter);
30 soundWidget->setObjectName(QLatin1StringView("soundwidget"));
31
33
34 return soundWidget;
35}
36
37void FilterActionWithTest::applyParamWidgetValue(QWidget *paramWidget)
38{
39 mParameter = static_cast<SoundTestWidget *>(paramWidget)->url();
40}
41
42void FilterActionWithTest::setParamWidgetValue(QWidget *paramWidget) const
43{
44 static_cast<SoundTestWidget *>(paramWidget)->setUrl(mParameter);
45}
46
47void FilterActionWithTest::clearParamWidget(QWidget *paramWidget) const
48{
49 static_cast<SoundTestWidget *>(paramWidget)->clear();
50}
51
52void FilterActionWithTest::argsFromString(const QString &argsStr)
53{
54 mParameter = argsStr;
55}
56
57QString FilterActionWithTest::argsAsString() const
58{
59 return mParameter;
60}
61
62QString FilterActionWithTest::displayString() const
63{
64 return label() + QLatin1StringView(" \"") + argsAsString().toHtmlEscaped() + QLatin1StringView("\"");
65}
66
67#include "moc_filteractionwithtest.cpp"
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.
A widget to play a sound from a given URL.
void textChanged(const QString &)
This signal is emitted when the user enters a new URL.
QString name(StandardAction id)
QString label(StandardShortcut id)
The filter dialog.
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 Sat Dec 21 2024 17:00:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.