Akonadi

collectionqueryhelper.h
1 /*
2  Copyright (c) 2009 Volker Krause <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_COLLECTIONQUERYHELPER_H
21 #define AKONADI_COLLECTIONQUERYHELPER_H
22 
23 #include "entities.h"
24 
25 #include <private/scope_p.h>
26 
27 namespace Akonadi
28 {
29 
30 namespace Server
31 {
32 
33 class CommandContext;
34 class QueryBuilder;
35 
39 namespace CollectionQueryHelper
40 {
41 
46 void remoteIdToQuery(const QStringList &rids, const CommandContext &context, QueryBuilder &qb);
47 
52 void scopeToQuery(const Scope &scope, const CommandContext &context, QueryBuilder &qb);
53 
57 bool hasAllowedName(const Collection &collection, const QString &name, Collection::Id parent);
58 
62 bool canBeMovedTo(const Collection &collection, const Collection &parent);
63 
67 Collection resolveHierarchicalRID(const QVector<Scope::HRID> &hridChain, Resource::Id resId);
68 
73 Collection singleCollectionFromScope(const Scope &scope, const CommandContext &context);
74 }
75 
76 } // namespace Server
77 } // namespace Akonadi
78 
79 #endif
qint64 Id
Describes the unique id type.
Definition: collection.h:82
Collection resolveHierarchicalRID(const QVector< 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. ...
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.
Collection singleCollectionFromScope(const Scope &scope, const CommandContext &context)
Returns an existing collection specified by the given scope.
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 collection operation scope scope.
Helper integration between Akonadi and Qt.
Helper class to construct arbitrary SQL queries.
Definition: querybuilder.h:45
Representation of a record in the Collection table.
Definition: entities.h:451
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 22:43:37 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.