Akonadi

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

KDE's Doxygen guidelines are available online.