Akonadi

collectionqueryhelper.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
11#include "private/scope_p.h"
12
13namespace Akonadi
14{
15namespace Server
16{
17class CommandContext;
18class QueryBuilder;
19
20/**
21 Helper methods to generate WHERE clauses for collection queries based on a Scope object.
22*/
23namespace CollectionQueryHelper
24{
25/**
26 Add conditions to @p qb for the given remote identifier @p rid.
27 The rid context is taken from @p context.
28*/
29void remoteIdToQuery(const QStringList &rids, const CommandContext &context, QueryBuilder &qb);
30
31/**
32 Add conditions to @p qb for the given collection operation scope @p scope.
33 The rid context is taken from @p context, if none is specified an exception is thrown.
34*/
35void scopeToQuery(const Scope &scope, const CommandContext &context, QueryBuilder &qb);
36
37/**
38 Checks if a collection could exist in the given parent folder with the given name.
39*/
40bool hasAllowedName(const Collection &collection, const QString &name, Collection::Id parent);
41
42/**
43 Checks if a collection could be moved from its current parent into the given one.
44*/
45bool canBeMovedTo(const Collection &collection, const Collection &parent);
46
47/**
48 Retrieve the collection referred to by the given hierarchical RID chain.
49*/
50Collection resolveHierarchicalRID(const QList<Scope::HRID> &hridChain, Resource::Id resId);
51}
52
53} // namespace Server
54} // namespace Akonadi
Represents a collection of PIM items.
Definition collection.h:62
qint64 Id
Describes the unique id type.
Definition collection.h:79
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.
bool hasAllowedName(const Collection &collection, const QString &name, Collection::Id parent)
Checks if a collection could exist in the given parent folder with the given name.
void scopeToQuery(const Scope &scope, const CommandContext &context, QueryBuilder &qb)
Add conditions to qb for the given collection operation scope scope.
Collection resolveHierarchicalRID(const QList< Scope::HRID > &hridChain, Resource::Id resId)
Retrieve the collection referred to by the given hierarchical RID chain.
bool canBeMovedTo(const Collection &collection, const Collection &parent)
Checks if a collection could be moved from its current parent into the given one.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:49:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.