Mailcommon

filteractionwithurl.h
1 /*
2  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <[email protected]>
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 
13 namespace 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 <[email protected]>, based upon work by Stefan Taferner <[email protected]>
33  * @see FilterActionWithString FilterAction Filter KProcess
34  */
36 {
37  Q_OBJECT
38 public:
39  explicit FilterActionWithUrlHelpButton(QWidget *parent = nullptr);
41 };
42 
43 class FilterActionWithUrl : public FilterAction
44 {
45  Q_OBJECT
46 public:
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  Q_REQUIRED_RESULT bool isEmpty() const override;
61 
62  /**
63  * @copydoc FilterAction::createParamWidget
64  */
65  Q_REQUIRED_RESULT 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  Q_REQUIRED_RESULT QString argsAsString() const override;
91 
92  /**
93  * @copydoc FilterAction::displayString
94  */
95  Q_REQUIRED_RESULT QString displayString() const override;
96 
97 protected:
98  QString mParameter;
99 
100 private:
101  mutable FilterActionWithUrlHelpButton *mHelpButton = nullptr;
102 
103 private:
104  void slotHelp();
105 };
106 }
Q_OBJECTQ_OBJECT
Abstract base class for mail filter actions.
Definition: filteraction.h:38
Abstract base class for filter actions with a command line as parameter.
QObject * parent() const const
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:58:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.