• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

KMFilter Class Reference

#include <kmfilter.h>

List of all members.


Detailed Description

Definition at line 38 of file kmfilter.h.


Public Types

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

Public Member Functions

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

Member Enumeration Documentation

enum KMFilter::AccountType

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
Enumerator:
All 
ButImap 
Checked 

Definition at line 63 of file kmfilter.h.

enum KMFilter::ReturnCode

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!
Enumerator:
NoResult 
GoOn 
CriticalError 

Definition at line 52 of file kmfilter.h.


Constructor & Destructor Documentation

KMFilter::KMFilter ( bool  popFilter = false  ) 

Constructor that initializes basic settings.

Definition at line 45 of file kmfilter.cpp.

KMFilter::KMFilter ( KConfigGroup &  aConfig,
bool  popFilter = false 
) [explicit]

Constructor that initializes from given config group.

Filters are stored one by one in config groups, i.e. one filter, one group.

Definition at line 63 of file kmfilter.cpp.

KMFilter::KMFilter ( const KMFilter &  other  ) 

Copy constructor.

Constructs a deep copy of aFilter.

Definition at line 70 of file kmfilter.cpp.

KMFilter::~KMFilter (  ) 

Cleanup.

Definition at line 110 of file kmfilter.cpp.


Member Function Documentation

KMPopFilterAction KMFilter::action (  ) 

No descriptions.

Definition at line 180 of file kmfilter.cpp.

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

Provides a reference to the internal action list.

Const version.

Definition at line 125 of file kmfilter.h.

QList<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 122 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 188 of file kmfilter.h.

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 207 of file kmfilter.cpp.

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 171 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 159 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 147 of file kmfilter.h.

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 407 of file kmfilter.cpp.

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 218 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 232 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 118 of file kmfilter.cpp.

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 186 of file kmfilter.cpp.

QString KMFilter::icon (  )  const [inline]

Returns:
The name of the icon to be used.

See also:
setIcon

Definition at line 270 of file kmfilter.h.

bool KMFilter::isAutoNaming (  )  const [inline]

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

Definition at line 303 of file kmfilter.h.

bool KMFilter::isEmpty (  )  const

Check for empty pattern and action list.

Definition at line 390 of file kmfilter.cpp.

bool KMFilter::isPopFilter (  )  const [inline]

No descriptions.

Definition at line 289 of file kmfilter.h.

QString KMFilter::name (  )  const [inline]

Equivalent to ()->name().

Returns:
name of the filter

Definition at line 80 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 135 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 130 of file kmfilter.h.

void KMFilter::purify (  ) 

Remove empty rules (and actions one day).

Definition at line 366 of file kmfilter.cpp.

void KMFilter::readConfig ( KConfigGroup &  config  ) 

Initialize from given config group.

Definition at line 224 of file kmfilter.cpp.

bool KMFilter::requiresBody ( KMMsgBase *  msgBase  ) 

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

Definition at line 161 of file kmfilter.cpp.

void KMFilter::setAction ( const KMPopFilterAction  aAction  ) 

No descriptions.

Definition at line 174 of file kmfilter.cpp.

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 180 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 198 of file kmfilter.cpp.

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 165 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 153 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 141 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 297 of file kmfilter.h.

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

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

Definition at line 209 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 224 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 265 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 254 of file kmfilter.h.

void KMFilter::setStopProcessingHere ( bool  aStop  )  [inline]

Definition at line 204 of file kmfilter.h.

void KMFilter::setToolbarName ( QString  toolbarName  )  [inline]

This sets the toolbar name for this filter.

The toolbar name is the text to be displayed underneath the toolbar icon for this filter. This is usually the same as name(), expect when explicitly set by this function. This is useful if the normal filter mame is too long for the toolbar.

See also:
toolbarName, name

Definition at line 246 of file kmfilter.h.

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

Returns:
The shortcut assigned to the filter.

See also:
setShortcut

Definition at line 259 of file kmfilter.h.

bool KMFilter::stopProcessingHere (  )  const [inline]

Definition at line 205 of file kmfilter.h.

QString KMFilter::toolbarName (  )  const

Returns:
The toolbar name of this filter.

See also:
setToolbarName

Definition at line 398 of file kmfilter.cpp.

void KMFilter::writeConfig ( KConfigGroup &  config  )  const

Write contents to given config group.

Definition at line 313 of file kmfilter.cpp.


The documentation for this class was generated from the following files:
  • kmfilter.h
  • kmfilter.cpp

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal