MailCommon::SearchRuleStatus

Search for usage in LXR

MailCommon::SearchRuleStatus Class Reference

#include <searchrulestatus.h>

Inheritance diagram for MailCommon::SearchRuleStatus:

Public Member Functions

 SearchRuleStatus (Akonadi::MessageStatus status, Function function=FuncContains)
 
 SearchRuleStatus (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
 
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 SearchRuleoperator= (const SearchRule &other)
 
QDataStreamoperator>> (QDataStream &) const
 
void setContents (const QString &contents)
 
void setField (const QByteArray &name)
 
void setFunction (Function function)
 
void writeConfig (KConfigGroup &group, int index) const
 

Static Public Member Functions

static Akonadi::MessageStatus statusFromEnglishName (const QString &)
 
- 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)
 

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 }
 
- Protected Member Functions inherited from MailCommon::SearchRule
Akonadi::SearchTerm::Condition akonadiComparator () const
 
bool isNegated () const
 

Detailed Description

This class represents a search to be performed against the status of a message.

The status is represented by a bitfield.

This class represents a search pattern rule operating on message status.

Definition at line 23 of file searchrulestatus.h.

Constructor & Destructor Documentation

◆ SearchRuleStatus() [1/2]

SearchRuleStatus::SearchRuleStatus ( const QByteArray & field = QByteArray(),
Function function = FuncContains,
const QString & contents = QString() )
explicit

Definition at line 44 of file searchrulestatus.cpp.

◆ SearchRuleStatus() [2/2]

SearchRuleStatus::SearchRuleStatus ( Akonadi::MessageStatus status,
Function function = FuncContains )
explicit

Definition at line 52 of file searchrulestatus.cpp.

Member Function Documentation

◆ addQueryTerms()

void SearchRuleStatus::addQueryTerms ( Akonadi::SearchTerm & groupTerm,
bool & emptyIsNotAnError ) const
overridevirtual

Adds query terms to the given term group.

Reimplemented from MailCommon::SearchRule.

Definition at line 116 of file searchrulestatus.cpp.

◆ informationAboutNotValidRules()

QString SearchRuleStatus::informationAboutNotValidRules ( ) const
nodiscardoverridevirtual

Reimplemented from MailCommon::SearchRule.

Definition at line 69 of file searchrulestatus.cpp.

◆ isEmpty()

bool SearchRuleStatus::isEmpty ( ) const
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 75 of file searchrulestatus.cpp.

◆ matches()

bool SearchRuleStatus::matches ( const Akonadi::Item & item) const
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 80 of file searchrulestatus.cpp.

◆ requiredPart()

SearchRule::RequiredPart SearchRuleStatus::requiredPart ( ) const
nodiscardoverridevirtual

Returns the required part from the item that is needed for the search to operate.

See RequiredPart

Implements MailCommon::SearchRule.

Definition at line 111 of file searchrulestatus.cpp.

◆ statusFromEnglishName()

Akonadi::MessageStatus SearchRuleStatus::statusFromEnglishName ( const QString & aStatusString)
static

Definition at line 58 of file searchrulestatus.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.