MailCommon::MailFilter
#include <mailfilter.h>
Public Types | |
enum | AccountType { All , ButImap , Checked } |
enum | ReturnCode { NoResult , GoOn , CriticalError } |
Static Public Member Functions | |
static int | filterActionsMaximumSize () |
Detailed Description
The MailFilter class.
Definition at line 28 of file mailfilter.h.
Member Enumeration Documentation
◆ AccountType
Account type codes used by setApplicability.
They mean:
- Parameters
-
All Apply to all accounts ButImap Apply to all but IMAP accounts Checked apply to all accounts specified by setApplyOnAccount
Definition at line 60 of file mailfilter.h.
◆ 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 45 of file mailfilter.h.
Constructor & Destructor Documentation
◆ MailFilter() [1/3]
MailFilter::MailFilter | ( | ) |
Constructor that initializes basic settings.
Definition at line 38 of file mailfilter.cpp.
◆ MailFilter() [2/3]
|
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 54 of file mailfilter.cpp.
◆ MailFilter() [3/3]
MailFilter::MailFilter | ( | const MailFilter & | other | ) |
◆ ~MailFilter()
MailFilter::~MailFilter | ( | ) |
Cleanup.
Definition at line 100 of file mailfilter.cpp.
Member Function Documentation
◆ actions() [1/2]
QList< FilterAction * > * MailFilter::actions | ( | ) |
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 161 of file mailfilter.cpp.
◆ actions() [2/2]
const QList< FilterAction * > * MailFilter::actions | ( | ) | const |
Provides a reference to the internal action list.
Const version.
Definition at line 166 of file mailfilter.cpp.
◆ agentRemoved()
void MailFilter::agentRemoved | ( | const QString & | identifier | ) |
Definition at line 269 of file mailfilter.cpp.
◆ applicability()
|
nodiscard |
- 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 236 of file mailfilter.cpp.
◆ applyBeforeOutbound()
|
nodiscard |
- Returns
- TRUE if this filter should be applied on outbound messages before they are sent, FALSE otherwise.
Definition at line 196 of file mailfilter.cpp.
◆ applyOnAccount()
|
nodiscard |
- 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 296 of file mailfilter.cpp.
◆ applyOnAllFoldersInbound()
|
nodiscard |
Returns whether the filter should be applied on inbound emails in all folders, not just Inbox.
Definition at line 226 of file mailfilter.cpp.
◆ applyOnExplicit()
|
nodiscard |
- Returns
- true if this filter should be applied on explicit (CTRL-J) filtering, false otherwise.
Definition at line 216 of file mailfilter.cpp.
◆ applyOnInbound()
|
nodiscard |
- Returns
- true if this filter should be applied on inbound messages, false otherwise.
Definition at line 206 of file mailfilter.cpp.
◆ applyOnOutbound()
|
nodiscard |
- Returns
- true if this filter should be applied on outbound messages, false otherwise.
Definition at line 191 of file mailfilter.cpp.
◆ asString()
const QString MailFilter::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 615 of file mailfilter.cpp.
◆ clearApplyOnAccount()
void MailFilter::clearApplyOnAccount | ( | ) |
Definition at line 282 of file mailfilter.cpp.
◆ configureShortcut()
|
nodiscard |
- Returns
- true if this filter should be plugged into the filter menu, false otherwise.
- See also
- setConfigureShortcut
Definition at line 332 of file mailfilter.cpp.
◆ configureToolbar()
|
nodiscard |
- Returns
- true if this filter should be plugged into the toolbar, false otherwise.
- See also
- setConfigureToolbar
Definition at line 342 of file mailfilter.cpp.
◆ execActions()
|
nodiscard |
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
-
context The context that contains the item to which the actions should be applied. stopIt Contains true
if the caller may apply other filters andfalse
if he shall stop the filtering of this message.applyOnOutbound Defines whether to apply the rules on the outbound.
Definition at line 125 of file mailfilter.cpp.
◆ filterActionsMaximumSize()
|
static |
Definition at line 105 of file mailfilter.cpp.
◆ folderRemoved()
void MailFilter::folderRemoved | ( | const Akonadi::Collection & | aFolder, |
const Akonadi::Collection & | 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 274 of file mailfilter.cpp.
◆ generateRandomIdentifier()
void MailFilter::generateRandomIdentifier | ( | ) |
Definition at line 110 of file mailfilter.cpp.
◆ generateSieveScript()
void MailFilter::generateSieveScript | ( | QStringList & | requiresModules, |
QString & | code ) |
Definition at line 479 of file mailfilter.cpp.
◆ icon()
|
nodiscard |
- Returns
- The name of the icon to be used.
- See also
- setIcon
Definition at line 367 of file mailfilter.cpp.
◆ identifier()
|
nodiscard |
Returns the unique identifier of this filter.
Definition at line 115 of file mailfilter.cpp.
◆ isAutoNaming()
|
nodiscard |
- Returns
- Tells, if an automatic name is used for the filter
Definition at line 377 of file mailfilter.cpp.
◆ isEmpty()
bool MailFilter::isEmpty | ( | ) | const |
Check for empty pattern and action list.
Definition at line 601 of file mailfilter.cpp.
◆ isEnabled()
|
nodiscard |
Return if filter is enabled or not.
Definition at line 780 of file mailfilter.cpp.
◆ name()
|
nodiscard |
Equivalent to pattern()->name()
.
- Returns
- name of the filter
Definition at line 120 of file mailfilter.cpp.
◆ pattern() [1/2]
|
nodiscard |
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 171 of file mailfilter.cpp.
◆ pattern() [2/2]
const SearchPattern * MailFilter::pattern | ( | ) | const |
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 176 of file mailfilter.cpp.
◆ purify()
QString MailFilter::purify | ( | bool | removeAction = true | ) |
Remove empty rules (and actions one day).
Definition at line 561 of file mailfilter.cpp.
◆ readConfig()
|
nodiscard |
Initialize from given config group.
Definition at line 383 of file mailfilter.cpp.
◆ requiredPart()
|
nodiscard |
Returns the required part from the item that is needed for the filter to operate.
Definition at line 241 of file mailfilter.cpp.
◆ setApplicability()
void MailFilter::setApplicability | ( | AccountType | aApply = All | ) |
Set whether this filter should be applied on inbound messages for all accounts (aApply
== All) or inbound messages for all but 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 231 of file mailfilter.cpp.
◆ setApplyBeforeOutbound()
void MailFilter::setApplyBeforeOutbound | ( | bool | aApply | ) |
Set whether this filter should be applied on outbound messages before sending (aApply
== TRUE) or not.
See applyOnOutbound applyOnInbound setApplyOnInbound
Definition at line 186 of file mailfilter.cpp.
◆ setApplyOnAccount()
void MailFilter::setApplyOnAccount | ( | const QString & | 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 287 of file mailfilter.cpp.
◆ setApplyOnAllFoldersInbound()
void MailFilter::setApplyOnAllFoldersInbound | ( | bool | aApply | ) |
Sets whether the filter should be applied on inbound emails in all folders, not just Inbox.
Definition at line 221 of file mailfilter.cpp.
◆ setApplyOnExplicit()
void MailFilter::setApplyOnExplicit | ( | bool | aApply | ) |
Set whether this filter should be applied on explicit (CTRL-J) filtering (aApply
== true) or not.
Definition at line 211 of file mailfilter.cpp.
◆ setApplyOnInbound()
void MailFilter::setApplyOnInbound | ( | bool | aApply | ) |
Set whether this filter should be applied on inbound messages (aApply
== true) or not.
Definition at line 201 of file mailfilter.cpp.
◆ setApplyOnOutbound()
void MailFilter::setApplyOnOutbound | ( | bool | aApply | ) |
Set whether this filter should be applied on outbound messages (aApply
== true) or not.
See applyOnOutbound applyOnInbound setApplyOnInbound
Definition at line 181 of file mailfilter.cpp.
◆ setAutoNaming()
void MailFilter::setAutoNaming | ( | bool | useAutomaticNames | ) |
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 372 of file mailfilter.cpp.
◆ setConfigureShortcut()
void MailFilter::setConfigureShortcut | ( | bool | aShort | ) |
Set whether this filter should be plugged into the filter menu.
Definition at line 326 of file mailfilter.cpp.
◆ setConfigureToolbar()
void MailFilter::setConfigureToolbar | ( | bool | aTool | ) |
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 337 of file mailfilter.cpp.
◆ setEnabled()
void MailFilter::setEnabled | ( | bool | enabled | ) |
Definition at line 785 of file mailfilter.cpp.
◆ setIcon()
void MailFilter::setIcon | ( | const QString & | icon | ) |
Set the icon to be used if plugged into the filter menu or toolbar.
Default is the gear icon.
Definition at line 362 of file mailfilter.cpp.
◆ setShortcut()
void MailFilter::setShortcut | ( | const QKeySequence & | shortcut | ) |
Set the shortcut to be used if plugged into the filter menu or toolbar.
Default is no shortcut.
Definition at line 352 of file mailfilter.cpp.
◆ setStopProcessingHere()
void MailFilter::setStopProcessingHere | ( | bool | aStop | ) |
Definition at line 316 of file mailfilter.cpp.
◆ setToolbarName()
void MailFilter::setToolbarName | ( | const QString & | toolbarName | ) |
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 347 of file mailfilter.cpp.
◆ shortcut()
const QKeySequence & MailFilter::shortcut | ( | ) | const |
- Returns
- The shortcut assigned to the filter.
- See also
- setShortcut
Definition at line 357 of file mailfilter.cpp.
◆ stopProcessingHere()
bool MailFilter::stopProcessingHere | ( | ) | const |
Definition at line 321 of file mailfilter.cpp.
◆ toolbarName()
QString MailFilter::toolbarName | ( | ) | const |
- Returns
- The toolbar name of this filter.
- See also
- setToolbarName
Definition at line 606 of file mailfilter.cpp.
◆ writeConfig()
void MailFilter::writeConfig | ( | KConfigGroup & | config, |
bool | exportFilter ) const |
Write contents to given config group.
Definition at line 510 of file mailfilter.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.