MailCommon::SearchRuleNumerical
#include <searchrulenumerical.h>
Public Member Functions | |
SearchRuleNumerical (const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString()) | |
void | addQueryTerms (Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const override |
QString | informationAboutNotValidRules () const override |
bool | isEmpty () const override |
bool | matches (const Akonadi::Item &item) const override |
bool | matchesInternal (long numericalValue, long numericalContents, const QString &contents) const |
RequiredPart | requiredPart () const override |
Public Member Functions inherited from MailCommon::SearchRule | |
SearchRule (const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString()) | |
SearchRule (const SearchRule &other) | |
virtual | ~SearchRule () |
const QString | asString () const |
QString | contents () const |
QByteArray | field () const |
Function | function () const |
void | generateSieveScript (QStringList &requireModules, QString &code) |
const SearchRule & | operator= (const SearchRule &other) |
QDataStream & | operator>> (QDataStream &) const |
void | setContents (const QString &contents) |
void | setField (const QByteArray &name) |
void | setFunction (Function function) |
void | writeConfig (KConfigGroup &group, int index) const |
Additional Inherited Members | |
Public Types inherited from MailCommon::SearchRule | |
enum | Function { FuncNone = -1 , FuncContains = 0 , FuncContainsNot , FuncEquals , FuncNotEqual , FuncRegExp , FuncNotRegExp , FuncIsGreater , FuncIsLessOrEqual , FuncIsLess , FuncIsGreaterOrEqual , FuncIsInAddressbook , FuncIsNotInAddressbook , FuncIsInCategory , FuncIsNotInCategory , FuncHasAttachment , FuncHasNoAttachment , FuncStartWith , FuncNotStartWith , FuncEndWith , FuncNotEndWith } |
using | Ptr = std::shared_ptr<SearchRule> |
enum | RequiredPart { Envelope = 0 , Header , CompleteMessage } |
Static Public Member Functions inherited from MailCommon::SearchRule | |
static SearchRule::Ptr | createInstance (const QByteArray &field, const char *function, const QString &contents) |
static SearchRule::Ptr | createInstance (const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString()) |
static SearchRule::Ptr | createInstance (const SearchRule &other) |
static SearchRule::Ptr | createInstance (QDataStream &stream) |
static SearchRule::Ptr | createInstanceFromConfig (const KConfigGroup &group, int index) |
Protected Member Functions inherited from MailCommon::SearchRule | |
Akonadi::SearchTerm::Condition | akonadiComparator () const |
bool | isNegated () const |
Detailed Description
This class represents a search pattern rule operating on numerical values.
This class represents a search to be performed against a numerical value, such as the age of the message in days or its size.
Definition at line 19 of file searchrulenumerical.h.
Constructor & Destructor Documentation
◆ SearchRuleNumerical()
|
explicit |
Creates new numerical search rule.
- Parameters
-
field The field to search in. function The function to use for searching. contents The contents to search for.
Definition at line 21 of file searchrulenumerical.cpp.
Member Function Documentation
◆ addQueryTerms()
|
overridevirtual |
Adds query terms to the given term group.
Reimplemented from MailCommon::SearchRule.
Definition at line 118 of file searchrulenumerical.cpp.
◆ informationAboutNotValidRules()
|
nodiscardoverridevirtual |
Reimplemented from MailCommon::SearchRule.
Definition at line 135 of file searchrulenumerical.cpp.
◆ isEmpty()
|
nodiscardoverridevirtual |
Determines whether the rule is worth considering.
It isn't if either the field is not set or the contents is empty. The calling code should make sure that it's rule list contains only non-empty rules, as matches doesn't check this.
Implements MailCommon::SearchRule.
Definition at line 26 of file searchrulenumerical.cpp.
◆ matches()
|
nodiscardoverridevirtual |
Tries to match the rule against the KMime::Message in the given item
.
- Returns
- true if the rule matched, false otherwise.
- Note
- Must be implemented by subclasses.
Implements MailCommon::SearchRule.
Definition at line 34 of file searchrulenumerical.cpp.
◆ matchesInternal()
bool SearchRuleNumerical::matchesInternal | ( | long | numericalValue, |
long | numericalContents, | ||
const QString & | contents ) const |
A helper method for the main matches() method.
Does the actual comparing.
Definition at line 73 of file searchrulenumerical.cpp.
◆ requiredPart()
|
nodiscardoverridevirtual |
Returns the required part from the item that is needed for the search to operate.
See RequiredPart
Implements MailCommon::SearchRule.
Definition at line 68 of file searchrulenumerical.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:19 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.