KDE PIM / Developers / API Docs / kmail

KMFilterAction Class Reference

Abstract base class for KMail's filter actions.Abstract base class for KMail's filter actions. More...

#include <kmfilteraction.h>

Inherited by KMFilterActionWithFolder, KMFilterActionWithNone, KMFilterActionWithString, KMFilterActionWithTest, KMFilterActionWithUOID, and KMFilterActionWithUrl.

List of all members.

Public Types

Public Member Functions

Static Public Member Functions


Detailed Description

Abstract base class for KMail's filter actions.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.)

Author:
Marc Mutz <Marc@Mutz.com>, based on work by Stefan Taferner <taferner@kde.org>.
See also:
KMFilter KMFilterMgr


Member Enumeration Documentation

enum KMFilterAction::ReturnCode
 

Possible return codes of.

See also:
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").

Constructor & Destructor Documentation

KMFilterAction::KMFilterAction const char *  aName,
const QString  aLabel
 

Initialize filter action with (english) name aName and (internationalized) label aLabel.


Member Function Documentation

const QString KMFilterAction::label  )  const [inline]
 

Returns nationalized label, ie.

the one which is presented in the filter dialog.

const QString KMFilterAction::name  )  const [inline]
 

Returns english name, ie.

the one under which it is known in the config.

virtual ReturnCode KMFilterAction::process KMMessage *  msg  )  const [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.

void KMFilterAction::processAsync KMMessage *  msg  )  const [virtual]
 

Execute an action on given message asynchronously.

Emits a result signal on completion.

bool KMFilterAction::requiresBody KMMsgBase *  msgBase  )  const [virtual]
 

Determines if the action depends on the body of the message.

virtual bool KMFilterAction::isEmpty  )  const [inline, virtual]
 

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 KMFilterActionWithString, KMFilterActionWithUOID, KMFilterActionWithFolder, and KMFilterActionWithUrl.

QWidget * KMFilterAction::createParamWidget QWidget *  parent  )  const [virtual]
 

Creates a widget for setting the filter action parameter.

Also sets the value of the widget.

Reimplemented in KMFilterActionWithString, KMFilterActionWithStringList, KMFilterActionWithFolder, KMFilterActionWithAddress, and KMFilterActionWithUrl.

void KMFilterAction::applyParamWidgetValue QWidget *  paramWidget  )  [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 KMFilterActionWithString, KMFilterActionWithStringList, KMFilterActionWithFolder, KMFilterActionWithAddress, and KMFilterActionWithUrl.

void KMFilterAction::setParamWidgetValue QWidget *  paramWidget  )  const [virtual]
 

The filter action shall set it's widget's contents from it's parameter.

Reimplemented in KMFilterActionWithString, KMFilterActionWithStringList, KMFilterActionWithFolder, KMFilterActionWithAddress, and KMFilterActionWithUrl.

void KMFilterAction::clearParamWidget QWidget *  paramWidget  )  const [virtual]
 

The filter action shall clear it's parameter widget's contents.

Reimplemented in KMFilterActionWithString, KMFilterActionWithStringList, KMFilterActionWithFolder, KMFilterActionWithAddress, and KMFilterActionWithUrl.

virtual void KMFilterAction::argsFromString const QString  argsStr  )  [pure virtual]
 

Read extra arguments from given string.

Implemented in KMFilterActionWithNone, KMFilterActionWithString, KMFilterActionWithUOID, KMFilterActionWithStringList, KMFilterActionWithFolder, and KMFilterActionWithUrl.

virtual const QString KMFilterAction::argsAsString  )  const [pure virtual]
 

Return extra arguments as string.

Must not contain newlines.

Implemented in KMFilterActionWithNone, KMFilterActionWithString, KMFilterActionWithUOID, KMFilterActionWithFolder, and KMFilterActionWithUrl.

virtual const QString KMFilterAction::displayString  )  const [pure virtual]
 

Returns a translated string describing this filter for visualization purposes, e.g.

in the filter log.

Implemented in KMFilterActionWithNone, KMFilterActionWithString, KMFilterActionWithUOID, KMFilterActionWithFolder, and KMFilterActionWithUrl.

bool KMFilterAction::folderRemoved KMFolder aFolder,
KMFolder aNewFolder
[virtual]
 

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.

KMFilterAction * KMFilterAction::newAction  )  [static]
 

Static function that creates a filter action of this type.

int KMFilterAction::tempOpenFolder KMFolder aFolder  )  [static]
 

Temporarily open folder.

Will be closed by the next

See also:
KMFilterMgr::cleanup() call.

void KMFilterAction::sendMDN KMMessage *  msg,
KMime::MDN::DispositionType  d,
const QValueList< KMime::MDN::DispositionModifier > &  m = QValueList< KMime::MDN::DispositionModifier >()
[static]
 

Automates the sending of MDNs from filter actions.


The documentation for this class was generated from the following files: