Akonadi::SearchTerm

Akonadi::SearchTerm Class Reference

#include <searchquery.h>

Inheritance diagram for Akonadi::SearchTerm:

Public Types

enum  Condition {
  CondEqual, CondGreaterThan, CondGreaterOrEqual, CondLessThan,
  CondLessOrEqual, CondContains
}
 
enum  Relation { RelAnd, RelOr }
 

Public Member Functions

 SearchTerm (SearchTerm::Relation relation=SearchTerm::RelAnd)
 
 SearchTerm (const QString &key, const QVariant &value, SearchTerm::Condition condition=SearchTerm::CondEqual)
 
 SearchTerm (const SearchTerm &other)
 
void addSubTerm (const SearchTerm &term)
 
SearchTerm::Condition condition () const
 
bool isNegated () const
 
bool isNull () const
 
QString key () const
 
SearchTermoperator= (const SearchTerm &other)
 
bool operator== (const SearchTerm &other) const
 
SearchTerm::Relation relation () const
 
void setIsNegated (bool negated)
 
QList< SearchTermsubTerms () const
 
QVariant value () const
 

Detailed Description

Search term represents the actual condition within query.

SearchTerm can either have multiple subterms, or can be so-called endterm, when there are no more subterms, but instead the actual condition is specified, that is have key, value and relation between them.

Since
4.13

Definition at line 26 of file searchquery.h.

Constructor & Destructor Documentation

SearchTerm::SearchTerm ( SearchTerm::Relation  relation = SearchTerm::RelAnd)
explicit

Constructs a term where all subterms will be in given relation.

Definition at line 97 of file searchquery.cpp.

SearchTerm::SearchTerm ( const QString key,
const QVariant value,
SearchTerm::Condition  condition = SearchTerm::CondEqual 
)

Constructs an end term.

Definition at line 103 of file searchquery.cpp.

Member Function Documentation

void SearchTerm::addSubTerm ( const SearchTerm term)

Adds a new subterm to this term.

Subterms will be in relation as specified in SearchTerm constructor.

If there are subterms in a term, key, value and condition are ignored.

Definition at line 160 of file searchquery.cpp.

SearchTerm::Condition SearchTerm::condition ( ) const

Returns relation between key and value.

Definition at line 145 of file searchquery.cpp.

bool SearchTerm::isNegated ( ) const

Returns whether the entire term is negated.

Definition at line 155 of file searchquery.cpp.

QString SearchTerm::key ( ) const

Returns key of this end term.

Definition at line 135 of file searchquery.cpp.

SearchTerm::Relation SearchTerm::relation ( ) const

Returns relation in which all subterms are.

Definition at line 170 of file searchquery.cpp.

void SearchTerm::setIsNegated ( bool  negated)

Sets whether the entire term is negated.

Definition at line 150 of file searchquery.cpp.

QList< SearchTerm > SearchTerm::subTerms ( ) const

Returns all subterms, or an empty list if this is an end term.

Definition at line 165 of file searchquery.cpp.

QVariant SearchTerm::value ( ) const

Returns value of this end term.

Definition at line 140 of file searchquery.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 11 2020 23:16:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.