Mailcommon

filteractionwithfolder.h
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#pragma once
9
10#include "filteraction.h"
11#include "mailcommon_private_export.h"
12namespace MailCommon
13{
14/**
15 * @short Abstract base class for filter actions with a mail folder as parameter.
16 *
17 * Abstract base class for mail filter actions that need a
18 * mail folder as parameter, e.g. 'move into folder'. Can
19 * create a KComboBox 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 <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
26 * @see FilterActionWithStringList FilterAction Filter
27 */
28class MAILCOMMON_TESTS_EXPORT FilterActionWithFolder : public FilterAction
29{
31
32public:
33 /**
34 * @copydoc FilterAction::FilterAction
35 */
36 FilterActionWithFolder(const QString &name, const QString &label, QObject *parent = nullptr);
37
38 /**
39 * @copydoc FilterAction::isEmpty
40 */
41 [[nodiscard]] bool isEmpty() const override;
42
43 /**
44 * @copydoc FilterAction::createParamWidget
45 */
46 [[nodiscard]] QWidget *createParamWidget(QWidget *parent) const override;
47
48 /**
49 * @copydoc FilterAction::applyParamWidgetValue
50 */
51 void applyParamWidgetValue(QWidget *paramWidget) override;
52
53 /**
54 * @copydoc FilterAction::setParamWidgetValue
55 */
56 void setParamWidgetValue(QWidget *paramWidget) const override;
57
58 /**
59 * @copydoc FilterAction::clearParamWidget
60 */
61 void clearParamWidget(QWidget *paramWidget) const override;
62
63 /**
64 * @copydoc FilterAction::argsFromString
65 */
66 void argsFromString(const QString &argsStr) override;
67
68 /**
69 * @copydoc FilterAction::argsAsString
70 */
71 [[nodiscard]] QString argsAsString() const override;
72
73 [[nodiscard]] bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
74
75 [[nodiscard]] QString argsAsStringReal() const override;
76
77 /**
78 * @copydoc FilterAction::displayString
79 */
80 [[nodiscard]] QString displayString() const override;
81
82 /**
83 * @copydoc FilterAction::folderRemoved
84 */
85 [[nodiscard]] bool folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder) override;
86
87protected:
88 Akonadi::Collection mFolder;
89};
90}
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.
bool folderRemoved(const Akonadi::Collection &aFolder, const Akonadi::Collection &aNewFolder) override
Called from the filter when a folder is removed.
QString displayString() const override
Returns a translated string describing this filter for visualization purposes, e.g.
void setParamWidgetValue(QWidget *paramWidget) const override
The filter action shall set it's widget's contents from it's parameter.
bool isEmpty() const override
Determines whether this action is valid.
FilterActionWithFolder(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
QWidget * createParamWidget(QWidget *parent) const override
Creates a widget for setting the filter action parameter.
QString argsAsString() const override
Return extra arguments as string.
bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override
Read extra arguments from given string.
FilterAction(const QString &name, const QString &label, QObject *parent=nullptr)
Creates a new filter action.
QString name() const
Returns identifier name, ie.
QString label() const
Returns i18n'd label, ie.
The filter dialog.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:56:35 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.