Akonadi::CollectionFetchScope
#include <collectionfetchscope.h>
Public Types | |
enum | AncestorRetrieval { None , Parent , All } |
enum | ListFilter { NoFilter , Display , Sync , Index , Enabled } |
Detailed Description
Specifies which parts of a collection should be fetched from the Akonadi storage.
When collections are fetched from the server either by using CollectionFetchJob explicitly or when it is being used internally by other classes, e.g. Akonadi::Monitor, the scope of the fetch operation can be tailored to the application's current needs.
Note that CollectionFetchScope always includes fetching collection attributes.
There are two supported ways of changing the currently active CollectionFetchScope of classes:
- in-place: modify the CollectionFetchScope object the other class holds as a member
- replace: replace the other class' member with a new scope object
Example: modifying a CollectionFetchJob's scope in-place
Example: replacing
a CollectionFetchJob's scope
This class is implicitly shared.
- Since
- 4.4
Definition at line 55 of file collectionfetchscope.h.
Member Enumeration Documentation
◆ AncestorRetrieval
Describes the ancestor retrieval depth.
Enumerator | |
---|---|
None | No ancestor retrieval at all (the default) |
Parent | Only retrieve the immediate parent collection. |
All | Retrieve all ancestors, up to Collection::root() |
Definition at line 61 of file collectionfetchscope.h.
◆ ListFilter
Describes the list filter.
- Since
- 4.14
Definition at line 95 of file collectionfetchscope.h.
Constructor & Destructor Documentation
◆ CollectionFetchScope() [1/2]
Akonadi::CollectionFetchScope::CollectionFetchScope | ( | ) |
Creates an empty collection fetch scope.
Using an empty scope will only fetch the very basic meta data of collections, e.g. local id, remote id and content mimetypes.
Definition at line 55 of file collectionfetchscope.cpp.
◆ CollectionFetchScope() [2/2]
Akonadi::CollectionFetchScope::CollectionFetchScope | ( | const CollectionFetchScope & | other | ) |
Creates a new collection fetch scope from an other
.
Definition at line 60 of file collectionfetchscope.cpp.
◆ ~CollectionFetchScope()
Akonadi::CollectionFetchScope::~CollectionFetchScope | ( | ) |
Destroys the collection fetch scope.
Definition at line 65 of file collectionfetchscope.cpp.
Member Function Documentation
◆ ancestorFetchScope() [1/2]
CollectionFetchScope & Akonadi::CollectionFetchScope::ancestorFetchScope | ( | ) |
Returns the fetch scope for ancestor retrieval.
Definition at line 181 of file collectionfetchscope.cpp.
◆ ancestorFetchScope() [2/2]
|
nodiscard |
Returns the fetch scope for ancestor retrieval.
Definition at line 173 of file collectionfetchscope.cpp.
◆ ancestorRetrieval()
|
nodiscard |
Returns the ancestor retrieval depth.
- See also
- setAncestorRetrieval()
Definition at line 113 of file collectionfetchscope.cpp.
◆ attributes()
|
nodiscard |
Returns all explicitly fetched attributes.
- See also
- fetchAttribute()
Definition at line 133 of file collectionfetchscope.cpp.
◆ contentMimeTypes()
|
nodiscard |
Returns the content mimetypes filter.
- See also
- setContentMimeTypes()
Definition at line 103 of file collectionfetchscope.cpp.
◆ fetchAttribute() [1/2]
|
inline |
Sets whether the attribute of the requested type should be fetched.
- Parameters
-
fetch true
if the attribute should be fetched,false
otherwise.
Definition at line 220 of file collectionfetchscope.h.
◆ fetchAttribute() [2/2]
void Akonadi::CollectionFetchScope::fetchAttribute | ( | const QByteArray & | type, |
bool | fetch = true ) |
Sets whether the attribute of the given type
should be fetched.
- Parameters
-
type The attribute type to fetch. fetch true
if the attribute should be fetched,false
otherwise.
Definition at line 138 of file collectionfetchscope.cpp.
◆ fetchIdOnly()
|
nodiscard |
Sets whether only the id of the tags should be retrieved or the complete tag.
- See also
- tagFetchScope()
- Since
- 4.15
Definition at line 153 of file collectionfetchscope.cpp.
◆ ignoreRetrievalErrors()
|
nodiscard |
Returns whether retrieval errors should be ignored.
- See also
- setIgnoreRetrievalErrors()
- Since
- KF6
Definition at line 163 of file collectionfetchscope.cpp.
◆ includeStatistics()
|
nodiscard |
Returns whether collection statistics should be included in the retrieved results.
- See also
- setIncludeStatistics()
Definition at line 83 of file collectionfetchscope.cpp.
◆ isEmpty()
|
nodiscard |
Returns true
if there is nothing to fetch.
Definition at line 78 of file collectionfetchscope.cpp.
◆ listFilter()
|
nodiscard |
Returns the list filter.
- See also
- setListFilter()
- Since
- 4.14
Definition at line 123 of file collectionfetchscope.cpp.
◆ operator=()
CollectionFetchScope & Akonadi::CollectionFetchScope::operator= | ( | const CollectionFetchScope & | other | ) |
Assigns the other
to this scope and returns a reference to this scope.
Definition at line 69 of file collectionfetchscope.cpp.
◆ resource()
|
nodiscard |
Returns the resource identifier that is used as filter.
- See also
- setResource()
Definition at line 93 of file collectionfetchscope.cpp.
◆ setAncestorFetchScope()
void Akonadi::CollectionFetchScope::setAncestorFetchScope | ( | const CollectionFetchScope & | scope | ) |
Sets the fetch scope for ancestor retrieval.
- See also
- setAncestorRetrieval()
Definition at line 168 of file collectionfetchscope.cpp.
◆ setAncestorRetrieval()
void Akonadi::CollectionFetchScope::setAncestorRetrieval | ( | AncestorRetrieval | ancestorDepth | ) |
Sets how many levels of ancestor collections should be included in the retrieval.
Only the ID and the remote ID of the ancestor collections are fetched. If you want more information about the ancestor collections, like their name, you will need to do an additional CollectionFetchJob for them.
- Parameters
-
ancestorDepth The desired ancestor retrieval depth.
Definition at line 118 of file collectionfetchscope.cpp.
◆ setContentMimeTypes()
void Akonadi::CollectionFetchScope::setContentMimeTypes | ( | const QStringList & | mimeTypes | ) |
Sets a content mimetypes filter, that is only collections that contain at least one of the given mimetypes (or their parents) are retrieved.
- Parameters
-
mimeTypes A list of mime types
Definition at line 108 of file collectionfetchscope.cpp.
◆ setFetchIdOnly()
void Akonadi::CollectionFetchScope::setFetchIdOnly | ( | bool | fetchIdOnly | ) |
Sets whether only the id or the complete tag should be fetched.
The default is false
.
- Since
- 4.15
Definition at line 148 of file collectionfetchscope.cpp.
◆ setIgnoreRetrievalErrors()
void Akonadi::CollectionFetchScope::setIgnoreRetrievalErrors | ( | bool | enabled | ) |
Ignore retrieval errors while fetching collections, and always deliver what is available.
This flag is useful to fetch a list of collections, where some might no longer be available.
- Since
- KF6
Definition at line 158 of file collectionfetchscope.cpp.
◆ setIncludeStatistics()
void Akonadi::CollectionFetchScope::setIncludeStatistics | ( | bool | include | ) |
Sets whether collection statistics should be included in the retrieved results.
- Parameters
-
include true
to include collection statistics,false
otherwise (the default).
Definition at line 88 of file collectionfetchscope.cpp.
◆ setListFilter()
void Akonadi::CollectionFetchScope::setListFilter | ( | CollectionFetchScope::ListFilter | listFilter | ) |
Sets a filter for the collections to be listed.
Note that collections that do not match the filter are included if required to complete the tree.
- Since
- 4.14
Definition at line 128 of file collectionfetchscope.cpp.
◆ setResource()
void Akonadi::CollectionFetchScope::setResource | ( | const QString & | resource | ) |
Sets a resource filter, that is only collections owned by the specified resource are retrieved.
- Parameters
-
resource The resource identifier.
Definition at line 98 of file collectionfetchscope.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.