kmail
KMFilter Class Reference
#include <kmfilter.h>
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
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 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!
Definition at line 52 of file kmfilter.h.
Constructor & Destructor Documentation
| KMFilter::KMFilter | ( | bool | popFilter = false |
) |
| 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 | ) |
| KMFilter::~KMFilter | ( | ) |
Member Function Documentation
| KMPopFilterAction KMFilter::action | ( | ) |
| 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.
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.
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.
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.
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 |
| bool KMFilter::isPopFilter | ( | ) | const [inline] |
| QString KMFilter::name | ( | ) | const [inline] |
| 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 | ( | ) |
| void KMFilter::readConfig | ( | KConfigGroup & | config | ) |
| 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 | ) |
| 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.
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.
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 |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference