kmail

KMFilter Class Reference

List of all members.

Detailed Description

Definition at line 40 of file kmfilter.h.


Public Types

enum  ReturnCode { NoResult, GoOn, CriticalError }
enum  AccountType { All, ButImap, Checked }

Public Member Functions

 KMFilter (KConfig *aConfig=0, bool popFilter=false)
 KMFilter (const KMFilter &other)
 ~KMFilter ()
QString name () const
ReturnCode execActions (KMMessage *msg, bool &stopIt) const
bool requiresBody (KMMsgBase *msgBase)
KMPopFilterAction action ()
void setAction (const KMPopFilterAction aAction)
void writeConfig (KConfig *config) const
void readConfig (KConfig *config)
void purify ()
bool isEmpty () const
QPtrList< KMFilterAction > * actions ()
const QPtrList< KMFilterAction > * actions () const
KMSearchPatternpattern ()
const KMSearchPatternpattern () const
void setApplyOnOutbound (bool aApply=TRUE)
bool applyOnOutbound () const
void setApplyOnInbound (bool aApply=TRUE)
bool applyOnInbound () const
void setApplyOnExplicit (bool aApply=TRUE)
bool applyOnExplicit () const
void setApplicability (AccountType aApply=All)
AccountType applicability () const
void setApplyOnAccount (uint id, bool aApply=TRUE)
bool applyOnAccount (uint id) const
void setStopProcessingHere (bool aStop)
bool stopProcessingHere () const
void setConfigureShortcut (bool aShort)
bool configureShortcut () const
void setConfigureToolbar (bool aTool)
bool configureToolbar () const
void setShortcut (const KShortcut &shortcut)
const KShortcut & shortcut () const
void setIcon (QString icon)
QString icon () const
bool folderRemoved (KMFolder *aFolder, KMFolder *aNewFolder)
const QString asString () const
bool isPopFilter () const
void setAutoNaming (bool useAutomaticNames)
bool isAutoNaming () const

Member Enumeration Documentation

Result codes returned by process.

They mean:

Parameters:
GoOn Everything OK. You are still the owner of the message and you should continue applying filter actions to this message.
CriticalError A critical error occurred (e.g. "disk full").
NoResult For internal use only!

Definition at line 54 of file kmfilter.h.

Account type codes used by setApplicability.

They mean:

Parameters:
All Apply to all accounts
ButImap Apply to all but online-IMAP accounts
Checked apply to all accounts specified by setApplyOnAccount

Definition at line 65 of file kmfilter.h.


Constructor & Destructor Documentation

KMFilter::KMFilter ( KConfig *  aConfig = 0,
bool  popFilter = false 
)

Constructor that initializes from given config file, if given.

Filters are stored one by one in config groups, i.e. one filter, one group. The config group has to be preset if config is not 0.

Definition at line 42 of file kmfilter.cpp.

KMFilter::KMFilter ( const KMFilter other  ) 

Copy constructor.

Constructs a deep copy of aFilter.

Definition at line 65 of file kmfilter.cpp.

KMFilter::~KMFilter (  )  [inline]

Cleanup.

Definition at line 76 of file kmfilter.h.


Member Function Documentation

QString KMFilter::name (  )  const [inline]

Equivalent to ()->name().

Returns:
name of the filter

Definition at line 79 of file kmfilter.h.

KMFilter::ReturnCode KMFilter::execActions ( KMMessage msg,
bool &  stopIt 
) const

Execute the filter action(s) on the given message.

Returns:

  • 2 if a critical error occurred,
  • 1 if the caller is still the owner of the message,
  • 0 if processed successfully.
    Parameters:
    msg The message to which the actions should be applied.
    stopIt Contains TRUE if the caller may apply other filters and FALSE if he shall stop the filtering of this message.

Definition at line 107 of file kmfilter.cpp.

bool KMFilter::requiresBody ( KMMsgBase msgBase  ) 

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

Definition at line 150 of file kmfilter.cpp.

KMPopFilterAction KMFilter::action (  ) 

No descriptions.

Definition at line 169 of file kmfilter.cpp.

void KMFilter::setAction ( const KMPopFilterAction  aAction  ) 

No descriptions.

Definition at line 163 of file kmfilter.cpp.

void KMFilter::writeConfig ( KConfig *  config  )  const

Write contents to given config file.

The config group (see the constructor above) has to be preset. The config object will be deleted by higher levels, so it is not allowed to store a pointer to it anywhere inside this function.

Definition at line 298 of file kmfilter.cpp.

void KMFilter::readConfig ( KConfig *  config  ) 

Initialize from given config file.

The config group (see constructor above) has to be preset. The config object will be deleted by higher levels, so it is not allowed to store a pointer to it anywhere inside this function.

Definition at line 213 of file kmfilter.cpp.

void KMFilter::purify (  ) 

Remove empty rules (and actions one day).

Definition at line 350 of file kmfilter.cpp.

bool KMFilter::isEmpty (  )  const

Check for empty pattern and action list.

Definition at line 374 of file kmfilter.cpp.

QPtrList<KMFilterAction>* KMFilter::actions (  )  [inline]

Provides a reference to the internal action list.

If your used the setAction() and action() functions before, please convert to using myFilter->actions()->at() and friends now.

Definition at line 127 of file kmfilter.h.

const QPtrList<KMFilterAction>* KMFilter::actions (  )  const [inline]

Provides a reference to the internal action list.

Const version.

Definition at line 130 of file kmfilter.h.

KMSearchPattern* KMFilter::pattern (  )  [inline]

Provides a reference to the internal pattern.

If you used the matches() function before, please convert to using myFilter->pattern()->matches() now.

Definition at line 135 of file kmfilter.h.

const KMSearchPattern* KMFilter::pattern (  )  const [inline]

Provides a reference to the internal pattern.

If you used the matches() function before, please convert to using myFilter->pattern()->matches() now.

Definition at line 140 of file kmfilter.h.

void KMFilter::setApplyOnOutbound ( bool  aApply = TRUE  )  [inline]

Set whether this filter should be applied on outbound messages (aApply == TRUE) or not.

See applyOnOutbound applyOnInbound setApplyOnInbound

Definition at line 146 of file kmfilter.h.

bool KMFilter::applyOnOutbound (  )  const [inline]

Returns:
TRUE if this filter should be applied on outbound messages, FALSE otherwise.

See also:
setApplyOnOutbound applyOnInbound setApplyOnInbound

Definition at line 152 of file kmfilter.h.

void KMFilter::setApplyOnInbound ( bool  aApply = TRUE  )  [inline]

Set whether this filter should be applied on inbound messages (aApply == TRUE) or not.

See also:
setApplyOnOutbound applyOnInbound applyOnOutbound

Definition at line 158 of file kmfilter.h.

bool KMFilter::applyOnInbound (  )  const [inline]

Returns:
TRUE if this filter should be applied on inbound messages, FALSE otherwise.

See also:
setApplyOnOutbound applyOnOutbound setApplyOnInbound

Definition at line 164 of file kmfilter.h.

void KMFilter::setApplyOnExplicit ( bool  aApply = TRUE  )  [inline]

Set whether this filter should be applied on explicit (CTRL-J) filtering (aApply == TRUE) or not.

See also:
setApplyOnOutbound applyOnInbound applyOnOutbound

Definition at line 170 of file kmfilter.h.

bool KMFilter::applyOnExplicit (  )  const [inline]

Returns:
TRUE if this filter should be applied on explicit (CTRL-J) filtering, FALSE otherwise.

See also:
setApplyOnOutbound applyOnOutbound setApplyOnInbound

Definition at line 176 of file kmfilter.h.

void KMFilter::setApplicability ( AccountType  aApply = All  )  [inline]

Set whether this filter should be applied on inbound messages for all accounts (aApply == All) or inbound messages for all but nline IMAP accounts (aApply == ButImap) or for a specified set of accounts only.

Only applicable to filters that are applied on inbound messages.

See also:
setApplyOnInbound setApplyOnAccount

Definition at line 185 of file kmfilter.h.

AccountType KMFilter::applicability (  )  const [inline]

Returns:
TRUE if this filter should be applied on inbound messages for all accounts, or FALSE if this filter is to be applied on a specified set of accounts only.

Only applicable to filters that are applied on inbound messages.

See also:
setApplicability

Definition at line 193 of file kmfilter.h.

void KMFilter::setApplyOnAccount ( uint  id,
bool  aApply = TRUE 
)

Set whether this filter should be applied on inbound messages for the account with id (id).

Only applicable to filters that are only applied to a specified set of accounts.

See also:
setApplicability applyOnAccount

Definition at line 187 of file kmfilter.cpp.

bool KMFilter::applyOnAccount ( uint  id  )  const

Returns:
TRUE if this filter should be applied on inbound messages from the account with id (id), FALSE otherwise.

See also:
setApplicability

Definition at line 196 of file kmfilter.cpp.

void KMFilter::setConfigureShortcut ( bool  aShort  )  [inline]

Set whether this filter should be plugged into the filter menu.

Definition at line 214 of file kmfilter.h.

bool KMFilter::configureShortcut (  )  const [inline]

Returns:
TRUE if this filter should be plugged into the filter menu, FALSE otherwise.

See also:
setConfigureShortcut

Definition at line 223 of file kmfilter.h.

void KMFilter::setConfigureToolbar ( bool  aTool  )  [inline]

Set whether this filter should be plugged into the toolbar.

This can be done only if a shortcut is defined.

See also:
setConfigureShortcut

Definition at line 229 of file kmfilter.h.

bool KMFilter::configureToolbar (  )  const [inline]

Returns:
TRUE if this filter should be plugged into the toolbar, FALSE otherwise.

See also:
setConfigureToolbar

Definition at line 237 of file kmfilter.h.

void KMFilter::setShortcut ( const KShortcut &  shortcut  )  [inline]

Set the shortcut to be used if plugged into the filter menu or toolbar.

Default is no shortcut.

See also:
setConfigureShortcut setConfigureToolbar

Definition at line 243 of file kmfilter.h.

const KShortcut& KMFilter::shortcut (  )  const [inline]

Returns:
The shortcut assigned to the filter.

See also:
setShortcut

Definition at line 248 of file kmfilter.h.

void KMFilter::setIcon ( QString  icon  )  [inline]

Set the icon to be used if plugged into the filter menu or toolbar.

Default is the gear icon.

See also:
setConfigureShortcut setConfigureToolbar

Definition at line 254 of file kmfilter.h.

QString KMFilter::icon (  )  const [inline]

Returns:
The name of the icon to be used.

See also:
setIcon

Definition at line 259 of file kmfilter.h.

bool KMFilter::folderRemoved ( KMFolder aFolder,
KMFolder aNewFolder 
)

Called from the filter manager when a folder is moved.

Tests if the folder aFolder is used in any action. Changes it to aNewFolder folder in this case.

Returns:
TRUE if a change in some action occurred, FALSE if no action was affected.

Definition at line 175 of file kmfilter.cpp.

const QString KMFilter::asString (  )  const

Returns the filter in a human-readable form.

useful for debugging but not much else. Don't use, as it may well go away in the future...

Definition at line 383 of file kmfilter.cpp.

bool KMFilter::isPopFilter (  )  const [inline]

No descriptions.

Definition at line 278 of file kmfilter.h.

void KMFilter::setAutoNaming ( bool  useAutomaticNames  )  [inline]

Set the mode for using automatic naming for the filter.

If the feature is enabled, the name is derived from the first filter rule.

Definition at line 286 of file kmfilter.h.

bool KMFilter::isAutoNaming (  )  const [inline]

Returns:
Tells, if an automatic name is used for the filter

Definition at line 292 of file kmfilter.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys