#include <kmfilteraction.h>
Public Types | |
enum | ReturnCode { ErrorNeedComplete = 0x1 , GoOn = 0x2 , ErrorButGoOn = 0x4 , CriticalError = 0x8 } |
Public Member Functions | |
KMFilterAction (const char *aName, const TQString aLabel) | |
const TQString | label () const |
const TQString | name () const |
virtual ReturnCode | process (KMMessage *msg) const =0 |
virtual void | processAsync (KMMessage *msg) const |
virtual bool | requiresBody (KMMsgBase *msgBase) const |
virtual bool | isEmpty () const |
virtual TQWidget * | createParamWidget (TQWidget *parent) const |
virtual void | applyParamWidgetValue (TQWidget *paramWidget) |
virtual void | setParamWidgetValue (TQWidget *paramWidget) const |
virtual void | clearParamWidget (TQWidget *paramWidget) const |
virtual void | argsFromString (const TQString argsStr)=0 |
virtual const TQString | argsAsString () const =0 |
virtual const TQString | displayString () const =0 |
virtual bool | folderRemoved (KMFolder *aFolder, KMFolder *aNewFolder) |
Static Public Member Functions | |
static KMFilterAction * | newAction () |
static int | tempOpenFolder (KMFolder *aFolder) |
static void | sendMDN (KMMessage *msg, KMime::MDN::DispositionType d, const TQValueList< KMime::MDN::DispositionModifier > &m=TQValueList< KMime::MDN::DispositionModifier >()) |
Detailed Description
Abstract base class for KMail's filter actions.
All it can do is hold a name (ie. type-string). There are several sub-classes that inherit form this and are capable of providing parameter handling (import/export as string, a widget to allow editing, etc.)
Abstract base class for KMail's filter actions.
- See also
- KMFilter KMFilterMgr
Definition at line 55 of file kmfilteraction.h.
Member Enumeration Documentation
◆ ReturnCode
Possible return codes of process:
ErrorNeedComplete:
Could not process because a complete message is needed.
GoOn:
Go on with applying filter actions.
ErrorButGoOn:
There was a non-critical error (e.g. an invalid address in the 'forward' action), but the processing should continue.
CriticalError:
A critical error has occurred during processing (e.g. "disk full").
Definition at line 73 of file kmfilteraction.h.
Constructor & Destructor Documentation
◆ KMFilterAction()
KMFilterAction::KMFilterAction | ( | const char * | aName, |
const TQString | aLabel | ||
) |
Initialize filter action with (english) name aName
and (internationalized) label aLabel
.
Definition at line 63 of file kmfilteraction.cpp.
Member Function Documentation
◆ applyParamWidgetValue()
|
virtual |
The filter action shall set it's parameter from the widget's contents.
It is allowed that the value is read by the action before this function is called.
Reimplemented in KMFilterActionWithUrl, KMFilterActionWithAddress, KMFilterActionWithFolder, KMFilterActionWithStringList, and KMFilterActionWithString.
Definition at line 96 of file kmfilteraction.cpp.
◆ argsAsString()
|
pure virtual |
Return extra arguments as string.
Must not contain newlines.
Implemented in KMFilterActionWithUrl, KMFilterActionWithFolder, KMFilterActionWithUOID, KMFilterActionWithString, and KMFilterActionWithNone.
◆ argsFromString()
|
pure virtual |
Read extra arguments from given string.
Implemented in KMFilterActionWithNone, KMFilterActionWithUrl, KMFilterActionWithFolder, KMFilterActionWithStringList, KMFilterActionWithUOID, and KMFilterActionWithString.
◆ clearParamWidget()
|
virtual |
The filter action shall clear it's parameter widget's contents.
Reimplemented in KMFilterActionWithUrl, KMFilterActionWithAddress, KMFilterActionWithFolder, KMFilterActionWithStringList, and KMFilterActionWithString.
Definition at line 104 of file kmfilteraction.cpp.
◆ createParamWidget()
|
virtual |
Creates a widget for setting the filter action parameter.
Also sets the value of the widget.
Reimplemented in KMFilterActionWithUrl, KMFilterActionWithAddress, KMFilterActionWithFolder, KMFilterActionWithStringList, and KMFilterActionWithString.
Definition at line 91 of file kmfilteraction.cpp.
◆ displayString()
|
pure virtual |
Returns a translated string describing this filter for visualization purposes, e.g.
in the filter log.
Implemented in KMFilterActionWithUrl, KMFilterActionWithFolder, KMFilterActionWithUOID, KMFilterActionWithString, and KMFilterActionWithNone.
◆ folderRemoved()
Called from the filter when a folder is removed.
Tests if the folder aFolder
is used and changes to aNewFolder
in this case. Returns TRUE if a change was made.
Reimplemented in KMFilterActionWithFolder.
Definition at line 108 of file kmfilteraction.cpp.
◆ isEmpty()
|
inlinevirtual |
Determines whether this action is valid.
But this is just a quick test. Eg., actions that have a mail address as parameter shouldn't try real address validation, but only check if the string representation is empty.
Reimplemented in KMFilterActionWithUrl, KMFilterActionWithFolder, KMFilterActionWithUOID, and KMFilterActionWithString.
Definition at line 110 of file kmfilteraction.h.
◆ label()
|
inline |
Returns nationalized label, ie.
the one which is presented in the filter dialog.
Definition at line 82 of file kmfilteraction.h.
◆ name()
|
inline |
Returns english name, ie.
the one under which it is known in the config.
Definition at line 86 of file kmfilteraction.h.
◆ newAction()
|
static |
Static function that creates a filter action of this type.
Definition at line 86 of file kmfilteraction.cpp.
◆ process()
|
pure virtual |
Execute action on given message.
Returns CriticalError
if a critical error has occurred (eg. disk full), ErrorButGoOn
if there was a non-critical error (e.g. invalid address in 'forward' action), ErrorNeedComplete
if a complete message is required, GoOn
if the message shall be processed by further filters and Ok
otherwise.
◆ processAsync()
|
virtual |
Execute an action on given message asynchronously.
Emits a result signal on completion.
Definition at line 73 of file kmfilteraction.cpp.
◆ requiresBody()
|
virtual |
Determines if the action depends on the body of the message.
Definition at line 81 of file kmfilteraction.cpp.
◆ sendMDN()
|
static |
Automates the sending of MDNs from filter actions.
Definition at line 118 of file kmfilteraction.cpp.
◆ setParamWidgetValue()
|
virtual |
The filter action shall set it's widget's contents from it's parameter.
Reimplemented in KMFilterActionWithUrl, KMFilterActionWithAddress, KMFilterActionWithFolder, KMFilterActionWithStringList, and KMFilterActionWithString.
Definition at line 100 of file kmfilteraction.cpp.
◆ tempOpenFolder()
|
static |
Temporarily open folder.
Will be closed by the next KMFilterMgr::cleanup() call.
Definition at line 113 of file kmfilteraction.cpp.
The documentation for this class was generated from the following files: