Akonadi

handlerhelper.h
1 /***************************************************************************
2  * Copyright (C) 2006 by Tobias Koenig <[email protected]> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License as *
6  * published by the Free Software Foundation; either version 2 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Library General Public *
15  * License along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 
20 #ifndef AKONADIHANDLERHELPER_H
21 #define AKONADIHANDLERHELPER_H
22 
23 #include "entities.h"
24 
25 #include <QByteArray>
26 #include <QString>
27 #include <QStack>
28 
29 namespace Akonadi
30 {
31 
32 class Scope;
33 class ImapSet;
34 
35 namespace Protocol
36 {
37 class Ancestor;
38 class CachePolicy;
39 class FetchCollectionsResponse;
40 class TagFetchScope;
41 class FetchTagsResponse;
42 using FetchTagsResponsePtr = QSharedPointer<FetchTagsResponse>;
43 class FetchRelationsResponse;
44 using FetchRelationsResponsePtr = QSharedPointer<FetchRelationsResponse>;
45 }
46 
47 namespace Server
48 {
49 
50 class CommandContext;
51 class Connection;
52 class AkonadiServer;
53 
58 {
59 public:
63  static Collection collectionFromIdOrName(const QByteArray &id);
64 
68  static QString pathForCollection(const Collection &col);
69 
74  static Protocol::CachePolicy cachePolicyResponse(const Collection &col);
75 
81  static Protocol::FetchCollectionsResponse fetchCollectionsResponse(AkonadiServer &akonadi, const Collection &col);
82 
88  static Protocol::FetchCollectionsResponse fetchCollectionsResponse(AkonadiServer &akonadi,
89  const Collection &col,
90  const CollectionAttribute::List &attributeList,
91  bool includeStatistics = false,
92  int ancestorDepth = 0,
93  const QStack<Collection> &ancestors = QStack<Collection>(),
95  const QStringList &mimeTypes = QStringList());
96 
100  static QVector<Protocol::Ancestor> ancestorsResponse(int ancestorDepth,
101  const QStack<Collection> &ancestors,
103 
104  static Protocol::FetchTagsResponse fetchTagsResponse(const Tag &tag,
105  const Protocol::TagFetchScope &tagFetchScope,
106  Connection *connection = nullptr);
107 
108  static Protocol::FetchRelationsResponse fetchRelationsResponse(const Relation &relation);
109 
114  static Flag::List resolveFlags(const QSet<QByteArray> &flagNames);
115 
120  static Tag::List resolveTagsByUID(const ImapSet &tags);
121 
122  static Tag::List resolveTagsByGID(const QStringList &tagsGIDs);
123 
124  static Tag::List resolveTagsByRID(const QStringList &tagsRIDs, const CommandContext &context);
125 
126  static Collection collectionFromScope(const Scope &scope, const CommandContext &context);
127 
128  static Tag::List tagsFromScope(const Scope &scope, const CommandContext &context);
129 };
130 
131 } // namespace Server
132 } // namespace Akonadi
133 
134 #endif
An Akonadi Relation.
Definition: relation.h:52
Represents a collection of PIM items.
Definition: collection.h:76
Helper functions for command handlers.
Definition: handlerhelper.h:57
Definition: item.h:44
Helper integration between Akonadi and Qt.
An Akonadi Tag.
Definition: tag.h:39
An Connection represents one connection of a client to the server.
Definition: connection.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 23:08:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.