Mailcommon

filteractionwithurl.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 <QToolButton>
12
13namespace MailCommon
14{
15/**
16 * @short Abstract base class for filter actions with a command line as parameter.
17 *
18 * Abstract base class for mail filter actions that need a command
19 * line as parameter, e.g. 'forward to'. Can create a QLineEdit
20 * (are there better widgets in the depths of the kdelibs?) as
21 * parameter widget. A subclass of this must provide at least
22 * implementations for the following methods:
23 *
24 * @li virtual FilterAction::ReturnCodes FilterAction::process
25 * @li static FilterAction::newAction
26 *
27 * The implementation of FilterAction::process should take the
28 * command line specified in mParameter, make all required
29 * modifications and stream the resulting command line into @p
30 * mProcess. Then you can start the command with @p mProcess.start().
31 *
32 * @author Marc Mutz <mutz@kde.org>, based upon work by Stefan Taferner <taferner@kde.org>
33 * @see FilterActionWithString FilterAction Filter KProcess
34 */
36{
38public:
39 explicit FilterActionWithUrlHelpButton(QWidget *parent = nullptr);
41};
42
43class FilterActionWithUrl : public FilterAction
44{
46public:
47 /**
48 * @copydoc FilterAction::FilterAction
49 */
50 FilterActionWithUrl(const QString &name, const QString &label, QObject *parent = nullptr);
51
52 /**
53 * @copydoc FilterAction::~FilterAction
54 */
55 ~FilterActionWithUrl() override;
56
57 /**
58 * @copydoc FilterAction::isEmpty
59 */
60 [[nodiscard]] bool isEmpty() const override;
61
62 /**
63 * @copydoc FilterAction::createParamWidget
64 */
65 [[nodiscard]] QWidget *createParamWidget(QWidget *parent) const override;
66
67 /**
68 * @copydoc FilterAction::applyParamWidgetValue
69 */
70 void applyParamWidgetValue(QWidget *paramWidget) override;
71
72 /**
73 * @copydoc FilterAction::setParamWidgetValue
74 */
75 void setParamWidgetValue(QWidget *paramWidget) const override;
76
77 /**
78 * @copydoc FilterAction::clearParamWidget
79 */
80 void clearParamWidget(QWidget *paramWidget) const override;
81
82 /**
83 * @copydoc FilterAction::applyFromString
84 */
85 void argsFromString(const QString &argsStr) override;
86
87 /**
88 * @copydoc FilterAction::argsAsString
89 */
90 [[nodiscard]] QString argsAsString() const override;
91
92 /**
93 * @copydoc FilterAction::displayString
94 */
95 [[nodiscard]] QString displayString() const override;
96
97protected:
98 QString mParameter;
99
100private:
101 mutable FilterActionWithUrlHelpButton *mHelpButton = nullptr;
102
103private:
104 void slotHelp();
105};
106}
Abstract base class for filter actions with a command line as parameter.
Abstract base class for mail filter actions.
QString name() const
Returns identifier name, ie.
QString label() const
Returns i18n'd label, ie.
The filter dialog.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.