Akonadi

collectionfetchhandler.h
1 /*
2  Copyright (c) 2007 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_COLLECTIONFETCHHANDLER_H_
21 #define AKONADI_COLLECTIONFETCHHANDLER_H_
22 
23 #include "entities.h"
24 #include "handler.h"
25 
26 template <typename T> class QStack;
27 
28 namespace Akonadi
29 {
30 namespace Server
31 {
32 
64 {
65 public:
66  CollectionFetchHandler(AkonadiServer &akonadi);
67  ~CollectionFetchHandler() override = default;
68 
69  bool parseStream() override;
70 
71 private:
72  void listCollection(const Collection &root,
73  const QStack<Collection> &ancestors,
74  const QStringList &mimeTypes,
75  const CollectionAttribute::List &attributes);
76  QStack<Collection> ancestorsForCollection(const Collection &col);
77  void retrieveCollections(const Collection &topParent, int depth);
78  bool checkFilterCondition(const Collection &col) const;
79  bool checkChildrenForMimeTypes(const QHash<qint64, Collection> &collectionsMap,
80  const QHash<qint64, qint64> &parentMap,
81  const Collection &col);
82  CollectionAttribute::List getAttributes(const Collection &colId,
83  const QSet<QByteArray> &filter = QSet<QByteArray>());
84  void retrieveAttributes(const QVariantList &collectionIds);
85 
86  Resource mResource;
87  QVector<MimeType::Id> mMimeTypes;
88  int mAncestorDepth = 0;
89  bool mIncludeStatistics = false;
90  bool mEnabledCollections = false;
91  bool mCollectionsToDisplay = false;
92  bool mCollectionsToSynchronize = false;
93  bool mCollectionsToIndex = false;
94  QSet<QByteArray> mAncestorAttributes;
95  QMap<qint64 /*id*/, Collection> mCollections;
96  QHash<qint64 /*id*/, Collection> mAncestors;
97  QMultiHash<qint64 /*collectionId*/, CollectionAttribute /*mimetypeId*/> mCollectionAttributes;
98 };
99 
100 } // namespace Server
101 } // namespace Akonadi
102 
103 #endif
The handler interfaces describes an entity capable of handling an AkonadiIMAP command.
Definition: handler.h:48
Representation of a record in the CollectionAttribute table.
Definition: entities.h:2254
Definition: item.h:44
Helper integration between Akonadi and Qt.
bool parseStream() override
Parse and handle the IMAP message using the streaming parser.
Representation of a record in the Resource table.
Definition: entities.h:246
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 Sat May 30 2020 22:46:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.