Akonadi

itemqueryhelper.h
1/*
2 SPDX-FileCopyrightText: 2009 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "entities.h"
10
11namespace Akonadi
12{
13class Scope;
14
15namespace Server
16{
17class CommandContext;
18class QueryBuilder;
19
20/**
21 Helper methods to generate WHERE clauses for item queries based on the item set
22 used in the protocol.
23*/
24namespace ItemQueryHelper
25{
26/**
27 Add conditions to @p qb for the given item set @p set. If @p collection is valid,
28 only items in this collection are considered.
29*/
30void itemSetToQuery(const QList<PimItem::Id> &set, QueryBuilder &qb, const Collection &collection = Collection());
31
32/**
33 Convenience method, does essentially the same as the one above.
34*/
35void itemSetToQuery(const QList<PimItem::Id> &set, const CommandContext &context, QueryBuilder &qb);
36
37/**
38 Add conditions to @p qb for the given remote identifier @p rid.
39 The rid context is taken from @p context.
40*/
41void remoteIdToQuery(const QStringList &rids, const CommandContext &context, QueryBuilder &qb);
42void gidToQuery(const QStringList &gids, const CommandContext &context, QueryBuilder &qb);
43
44/**
45 Add conditions to @p qb for the given item operation scope @p scope.
46 The rid context is taken from @p context, if none is specified an exception is thrown.
47*/
48void scopeToQuery(const Scope &scope, const CommandContext &context, QueryBuilder &qb);
49}
50
51} // namespace Server
52} // namespace Akonadi
Represents a collection of PIM items.
Definition collection.h:62
Helper class to construct arbitrary SQL queries.
void remoteIdToQuery(const QStringList &rids, const CommandContext &context, QueryBuilder &qb)
Add conditions to qb for the given remote identifier rid.
void scopeToQuery(const Scope &scope, const CommandContext &context, QueryBuilder &qb)
Add conditions to qb for the given item operation scope scope.
void itemSetToQuery(const QList< PimItem::Id > &set, QueryBuilder &qb, const Collection &collection=Collection())
Add conditions to qb for the given item set set.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.