Akonadi::SearchTerm Class

class Akonadi::SearchTerm
Header: #include <Akonadi/SearchQuery>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore)
Inherited By:

Akonadi::ContactSearchTerm, Akonadi::EmailSearchTerm, and Akonadi::IncidenceSearchTerm

Public Functions

SearchTerm(Akonadi::SearchTerm::Relation relation = SearchTerm::RelAnd)
SearchTerm(const QString &key, const QVariant &value, Akonadi::SearchTerm::Condition condition = SearchTerm::CondEqual)
void addSubTerm(const Akonadi::SearchTerm &term)
Akonadi::SearchTerm::Condition condition() const
bool isNegated() const
QString key() const
Akonadi::SearchTerm::Relation relation() const
void setIsNegated(bool negated)
QList<Akonadi::SearchTerm> subTerms() 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.

Member Function Documentation

[explicit] SearchTerm::SearchTerm(Akonadi::SearchTerm::Relation relation = SearchTerm::RelAnd)

Constructs a term where all subterms will be in given relation

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

Constructs an end term

void SearchTerm::addSubTerm(const Akonadi::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.

Akonadi::SearchTerm::Condition SearchTerm::condition() const

Returns relation between key and value.

bool SearchTerm::isNegated() const

Returns whether the entire term is negated.

See also setIsNegated().

QString SearchTerm::key() const

Returns key of this end term.

Akonadi::SearchTerm::Relation SearchTerm::relation() const

Returns relation in which all subterms are.

void SearchTerm::setIsNegated(bool negated)

Sets whether the entire term is negated.

See also isNegated().

QList<Akonadi::SearchTerm> SearchTerm::subTerms() const

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

QVariant SearchTerm::value() const

Returns value of this end term.