Mailcommon

filteractiondelete.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 "filteractiondelete.h"
9
10#include <KColorScheme>
11#include <KLocalizedString>
12
13#include <QLabel>
14
15using namespace MailCommon;
16
17FilterActionDelete::FilterActionDelete(QObject *parent)
18 : FilterActionWithNone(QStringLiteral("delete"), i18n("Delete Message"), parent)
19{
20}
21
22FilterAction::ReturnCode FilterActionDelete::process(ItemContext &context, bool) const
23{
24 context.setDeleteItem();
25 return GoOn;
26}
27
28SearchRule::RequiredPart FilterActionDelete::requiredPart() const
29{
31}
32
33QWidget *FilterActionDelete::createParamWidget(QWidget *parent) const
34{
35 auto lab = new QLabel(parent);
36 lab->setObjectName(QLatin1StringView("label_delete"));
37 QPalette pal = lab->palette();
39 pal.setColor(QPalette::WindowText, scheme.foreground(KColorScheme::NegativeText).color());
40 lab->setPalette(pal);
41 lab->setText(i18n("Be careful, mails will be removed."));
42 return lab;
43}
44
45FilterAction *FilterActionDelete::newAction()
46{
47 return new FilterActionDelete;
48}
49
50QString FilterActionDelete::sieveCode() const
51{
52 return QStringLiteral("discard;");
53}
54
55#include "moc_filteractiondelete.cpp"
Abstract base class for filter actions with no parameter.
Abstract base class for mail filter actions.
ReturnCode
Describes the possible return codes of filter processing:
@ GoOn
Go on with applying filter actions.
A helper class for the filtering process.
Definition itemcontext.h:27
RequiredPart
Possible required parts.
Definition searchrule.h:70
QString i18n(const char *text, const TYPE &arg...)
The filter dialog.
QObject * parent() const const
void setColor(ColorGroup group, ColorRole role, const QColor &color)
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.