• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

mailcommon

  • MailCommon
  • SearchRuleNumerical
Public Member Functions | List of all members
MailCommon::SearchRuleNumerical Class Reference

#include <searchpattern.h>

Inheritance diagram for MailCommon::SearchRuleNumerical:
Inheritance graph
[legend]

Public Member Functions

 SearchRuleNumerical (const QByteArray &field=0, Function function=FuncContains, const QString &contents=QString())
 
virtual void addQueryTerms (Nepomuk2::Query::GroupTerm &groupTerm, bool &emptyIsNotAnError) const
 
virtual bool isEmpty () const
 
virtual bool matches (const Akonadi::Item &item) const
 
bool matchesInternal (long numericalValue, long numericalContents, const QString &contents) const
 
virtual RequiredPart requiredPart () const
 
- Public Member Functions inherited from MailCommon::SearchRule
 SearchRule (const QByteArray &field=0, 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 &requires, 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
}
 
typedef boost::shared_ptr
< SearchRule > 
Ptr
 
enum  RequiredPart { Envelope = 0, Header, CompleteMessage }
 
- Static Public Member Functions inherited from MailCommon::SearchRule
static SearchRule::Ptr createInstance (const QByteArray &field=0, Function function=FuncContains, const QString &contents=QString())
 
static SearchRule::Ptr createInstance (const QByteArray &field, const char *function, const QString &contents)
 
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
void addAndNegateTerm (const Nepomuk2::Query::Term &term, Nepomuk2::Query::GroupTerm &termGroup) const
 
bool isNegated () const
 
Nepomuk2::Query::ComparisonTerm::Comparator nepomukComparator () const
 
QString quote (const QString &content) 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 387 of file searchpattern.h.

Constructor & Destructor Documentation

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

Creates new numerical search rule.

Parameters
fieldThe field to search in.
functionThe function to use for searching.
contentsThe contents to search for.

Definition at line 1153 of file searchpattern.cpp.

Member Function Documentation

void SearchRuleNumerical::addQueryTerms ( Nepomuk2::Query::GroupTerm &  groupTerm,
bool &  emptyIsNotAnError 
) const
virtual

Adds query terms to the given term group.

Implements MailCommon::SearchRule.

Definition at line 1257 of file searchpattern.cpp.

bool SearchRuleNumerical::isEmpty ( ) const
virtual

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 1160 of file searchpattern.cpp.

bool SearchRuleNumerical::matches ( const Akonadi::Item &  item) const
virtual

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 1168 of file searchpattern.cpp.

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 1203 of file searchpattern.cpp.

SearchRule::RequiredPart SearchRuleNumerical::requiredPart ( ) const
virtual

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

See RequiredPart

Implements MailCommon::SearchRule.

Definition at line 1197 of file searchpattern.cpp.


The documentation for this class was generated from the following files:
  • searchpattern.h
  • searchpattern.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal