mailcommon
searchrulestring.cpp
Go to the documentation of this file.
102 //qDebug()<< "VERIFY IT: SearchRule::RequiredPart SearchRuleString::requiredPart() const use default \"Header\" for field :"<<f;
199 void SearchRuleString::addQueryTerms(Akonadi::SearchTerm &groupTerm , bool &emptyIsNotAnError) const
205 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::Subject, contents(), akonadiComparator()) );
207 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderReplyTo, contents(), akonadiComparator()) );
209 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::Message, contents(), akonadiComparator()) );
212 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::Attachment, contents(), akonadiComparator()) );
214 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderTo, contents(), akonadiComparator()) );
215 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderCC, contents(), akonadiComparator()) );
216 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderBCC, contents(), akonadiComparator()) );
218 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::Headers, contents(), akonadiComparator()) );
219 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::Subject, contents(), akonadiComparator()) );
221 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderTo, contents(), akonadiComparator()) );
223 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderCC, contents(), akonadiComparator()) );
225 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderBCC, contents(), akonadiComparator()) );
227 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderFrom, contents(), akonadiComparator()) );
229 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderListId, contents(), akonadiComparator()) );
231 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderResentFrom, contents(), akonadiComparator()) );
233 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderXLoop, contents(), akonadiComparator()) );
235 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderXMailingList, contents(), akonadiComparator()) );
237 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderXSpamFlag, contents(), akonadiComparator()) );
239 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::HeaderOrganization, contents(), akonadiComparator()) );
241 termGroup.addSubTerm(EmailSearchTerm(EmailSearchTerm::MessageTag, contents(), akonadiComparator()) );
bool matchesInternal(const QString &contents) const
A helper method for the main matches() method.
Definition: searchrulestring.cpp:259
static QString recode(const QString &plain)
Returns an escaped version of the log which can be used in a HTML document.
Definition: filterlog.cpp:228
QByteArray trimmed() const
void setField(const QByteArray &name)
Sets the message header field name.
Definition: searchrule.cpp:496
Akonadi::SearchTerm::Condition akonadiComparator() const
Converts the rule function into the corresponding Akonadi query operator.
Definition: searchrule.cpp:526
bool isEmpty() const
void setContents(const QString &contents)
Set the contents of the rule.
Definition: searchrule.cpp:506
void setFunction(Function function)
Sets the filter function of the rule.
Definition: searchrule.cpp:486
static FilterLog * instance()
Returns the single global instance of the filter log.
Definition: filterlog.cpp:107
int indexIn(const QString &str, int offset, CaretMode caretMode) const
virtual bool isEmpty() const
Determines whether the rule is worth considering.
Definition: searchrulestring.cpp:74
const QString asString() const
Returns the rule as string for debugging purpose.
Definition: searchrule.cpp:516
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
virtual QString informationAboutNotValidRules() const
Definition: searchrulestring.cpp:252
QByteArray field() const
Returns the message header field name (without the trailing ':').
Definition: searchrule.cpp:501
bool isNegated() const
Helper that returns whether the rule has a negated function.
Definition: searchrule.cpp:567
virtual RequiredPart requiredPart() const
Returns the required part from the item that is needed for the search to operate. ...
Definition: searchrulestring.cpp:79
QString toLower() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const
Definition: searchrule.h:80
const SearchRuleString & operator=(const SearchRuleString &other)
Initializes this rule with an other rule.
Definition: searchrulestring.cpp:57
virtual void addQueryTerms(Akonadi::SearchTerm &groupTerm, bool &emptyIsNotAnError) const
Adds query terms to the given term group.
Definition: searchrulestring.cpp:199
virtual bool matches(const Akonadi::Item &item) const
Tries to match the rule against the KMime::Message in the given item.
Definition: searchrulestring.cpp:110
typedef ConstIterator
SearchRuleString(const QByteArray &field=QByteArray(), Function function=FuncContains, const QString &contents=QString())
Creates new new string search rule.
Definition: searchrulestring.cpp:45
void add(const QString &entry, ContentType type)
Adds the given log entry under the given content type to the log.
Definition: filterlog.cpp:164
Definition: searchrule.h:81
const_iterator constEnd() const
const_iterator constBegin() const
int compare(const QString &other) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.