kmail

KMSearchRuleNumerical Class Reference

#include <kmsearchpattern.h>

Inheritance diagram for KMSearchRuleNumerical:
KMSearchRule

Public Member Functions

 KMSearchRuleNumerical (const TQCString &field=0, Function function=FuncContains, const TQString &contents=TQString())
 
virtual bool isEmpty () const
 
virtual bool matches (const KMMessage *msg) const
 
bool matchesInternal (long numericalValue, long numericalMsgContents, const TQString &msgContents) const
 
- Public Member Functions inherited from KMSearchRule
 KMSearchRule (const TQCString &field=0, Function=FuncContains, const TQString &contents=TQString())
 
 KMSearchRule (const KMSearchRule &other)
 
const KMSearchRuleoperator= (const KMSearchRule &other)
 
virtual bool matches (const DwString &str, KMMessage &msg, const DwBoyerMoore *headerField=0, int headerLen=-1) const
 
virtual bool requiresBody () const
 
void writeConfig (TDEConfig *config, int aIdx) const
 
Function function () const
 
void setFunction (Function aFunction)
 
TQCString field () const
 
void setField (const TQCString &field)
 
TQString contents () const
 
void setContents (const TQString &aContents)
 
const TQString asString () const
 

Additional Inherited Members

- Public Types inherited from KMSearchRule
enum  Function {
  FuncNone = -1 , FuncContains =0 , FuncContainsNot , FuncEquals ,
  FuncNotEqual , FuncRegExp , FuncNotRegExp , FuncIsGreater ,
  FuncIsLessOrEqual , FuncIsLess , FuncIsGreaterOrEqual , FuncIsInAddressbook ,
  FuncIsNotInAddressbook , FuncIsInCategory , FuncIsNotInCategory , FuncHasAttachment ,
  FuncHasNoAttachment
}
 
- Static Public Member Functions inherited from KMSearchRule
static KMSearchRulecreateInstance (const TQCString &field=0, Function function=FuncContains, const TQString &contents=TQString())
 
static KMSearchRulecreateInstance (const TQCString &field, const char *function, const TQString &contents)
 
static KMSearchRulecreateInstance (const KMSearchRule &other)
 
static KMSearchRulecreateInstanceFromConfig (const TDEConfig *config, int aIdx)
 

Detailed Description

This class represents a search to be performed against a numerical value, such as the age of the message in days or its size.

This class represents a search pattern rule operating on numerical values.

Definition at line 193 of file kmsearchpattern.h.

Member Function Documentation

◆ isEmpty()

bool KMSearchRuleNumerical::isEmpty ( ) const
virtual

Determine whether the rule is worth considering.

It isn't if either the field is not set or the contents is empty. KFilter should make sure that it's rule list contains only non-empty rules, as matches doesn't check this.

Implements KMSearchRule.

Definition at line 529 of file kmsearchpattern.cpp.

◆ matches()

bool KMSearchRuleNumerical::matches ( const KMMessage msg) const
virtual

Tries to match the rule against the given KMMessage.

Returns
TRUE if the rule matched, FALSE otherwise. Must be implemented by subclasses.

Implements KMSearchRule.

Definition at line 538 of file kmsearchpattern.cpp.

◆ matchesInternal()

bool KMSearchRuleNumerical::matchesInternal ( long  numericalValue,
long  numericalMsgContents,
const TQString &  msgContents 
) const

Helper for the main matches() method.

Does the actual comparing.

Definition at line 567 of file kmsearchpattern.cpp.


The documentation for this class was generated from the following files: