Akonadi

itemfetchscope.h
1 /*
2  SPDX-FileCopyrightText: 2008 Kevin Krammer <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef ITEMFETCHSCOPE_H
8 #define ITEMFETCHSCOPE_H
9 
10 #include "akonadicore_export.h"
11 
12 #include <QMetaType>
13 #include <QSet>
14 #include <QSharedDataPointer>
15 #include <QDateTime>
16 
17 template <typename T> class QSet;
18 
19 namespace Akonadi
20 {
21 
22 class ItemFetchScopePrivate;
23 class TagFetchScope;
24 
58 class AKONADICORE_EXPORT ItemFetchScope
59 {
60 public:
66  None,
68  All
69  };
70 
78 
82  ItemFetchScope(const ItemFetchScope &other);
83 
87  ~ItemFetchScope();
88 
92  ItemFetchScope &operator=(const ItemFetchScope &other);
93 
99  Q_REQUIRED_RESULT QSet<QByteArray> payloadParts() const;
100 
108  void fetchPayloadPart(const QByteArray &part, bool fetch = true);
109 
115  Q_REQUIRED_RESULT bool fullPayload() const;
116 
123  void fetchFullPayload(bool fetch = true);
124 
132  Q_REQUIRED_RESULT QSet<QByteArray> attributes() const;
133 
140  void fetchAttribute(const QByteArray &type, bool fetch = true);
141 
147  template <typename T> inline void fetchAttribute(bool fetch = true)
148  {
149  T dummy;
150  fetchAttribute(dummy.type(), fetch);
151  }
152 
158  Q_REQUIRED_RESULT bool allAttributes() const;
159 
166  void fetchAllAttributes(bool fetch = true);
167 
174  Q_REQUIRED_RESULT bool cacheOnly() const;
175 
183  void setCacheOnly(bool cacheOnly);
184 
192  void setCheckForCachedPayloadPartsOnly(bool check = true);
193 
201  Q_REQUIRED_RESULT bool checkForCachedPayloadPartsOnly() const;
202 
210  void setAncestorRetrieval(AncestorRetrieval ancestorDepth);
211 
218  Q_REQUIRED_RESULT AncestorRetrieval ancestorRetrieval() const;
219 
227  void setFetchModificationTime(bool retrieveMtime);
228 
235  Q_REQUIRED_RESULT bool fetchModificationTime() const;
236 
244  void setFetchGid(bool retrieveGID);
245 
252  Q_REQUIRED_RESULT bool fetchGid() const;
253 
265  void setIgnoreRetrievalErrors(bool enabled);
266 
273  Q_REQUIRED_RESULT bool ignoreRetrievalErrors() const;
274 
278  Q_REQUIRED_RESULT bool isEmpty() const;
279 
290  void setFetchChangedSince(const QDateTime &changedSince);
291 
295  Q_REQUIRED_RESULT QDateTime fetchChangedSince() const;
296 
308  void setFetchRemoteIdentification(bool retrieveRid);
309 
316  Q_REQUIRED_RESULT bool fetchRemoteIdentification() const;
317 
328  void setFetchTags(bool fetchTags);
329 
336  Q_REQUIRED_RESULT bool fetchTags() const;
337 
350  void setTagFetchScope(const TagFetchScope &fetchScope);
351 
367  TagFetchScope &tagFetchScope();
368 
379  Q_REQUIRED_RESULT TagFetchScope tagFetchScope() const;
380 
387  void setFetchVirtualReferences(bool fetchVRefs);
388 
395  Q_REQUIRED_RESULT bool fetchVirtualReferences() const;
396 
405  void setFetchRelations(bool fetchRelations);
406 
413  Q_REQUIRED_RESULT bool fetchRelations() const;
414 
415 private:
416  //@cond PRIVATE
418  //@endcond
419 };
420 
421 }
422 
423 Q_DECLARE_METATYPE(Akonadi::ItemFetchScope)
424 
425 #endif
No ancestor retrieval at all (the default)
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:22
AncestorRetrieval
Describes the ancestor retrieval depth.
Only retrieve the immediate parent collection.
void fetchAttribute(bool fetch=true)
Sets whether the attribute of the requested type should be fetched.
Specifies which parts of an item should be fetched from the Akonadi storage.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:15:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.