akonadi
#include <collectionfetchscope.h>
Public Types | |
enum | AncestorRetrieval { None, Parent, All } |
enum | ListFilter { NoFilter, Display, Sync, Index, Enabled } |
Public Member Functions | |
CollectionFetchScope () | |
CollectionFetchScope (const CollectionFetchScope &other) | |
~CollectionFetchScope () | |
AncestorRetrieval | ancestorRetrieval () const |
QStringList | contentMimeTypes () const |
bool | includeStatistics () const |
AKONADI_DEPRECATED bool | includeUnsubscribed () const |
AKONADI_DEPRECATED bool | includeUnubscribed () const |
bool | isEmpty () const |
ListFilter | listFilter () const |
CollectionFetchScope & | operator= (const CollectionFetchScope &other) |
QString | resource () const |
void | setAncestorRetrieval (AncestorRetrieval ancestorDepth) |
void | setContentMimeTypes (const QStringList &mimeTypes) |
void | setIncludeStatistics (bool include) |
AKONADI_DEPRECATED void | setIncludeUnsubscribed (bool include) |
void | setListFilter (ListFilter) |
void | setResource (const QString &resource) |
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 68 of file collectionfetchscope.h.
Member Enumeration Documentation
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 74 of file collectionfetchscope.h.
Describes the list filter.
- Since
- 4.14
Definition at line 132 of file collectionfetchscope.h.
Constructor & Destructor Documentation
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 56 of file collectionfetchscope.cpp.
Akonadi::CollectionFetchScope::CollectionFetchScope | ( | const CollectionFetchScope & | other | ) |
Creates a new collection fetch scope from an other
.
Definition at line 61 of file collectionfetchscope.cpp.
Akonadi::CollectionFetchScope::~CollectionFetchScope | ( | ) |
Destroys the collection fetch scope.
Definition at line 66 of file collectionfetchscope.cpp.
Member Function Documentation
CollectionFetchScope::AncestorRetrieval Akonadi::CollectionFetchScope::ancestorRetrieval | ( | ) | const |
Returns the ancestor retrieval depth.
- See also
- setAncestorRetrieval()
Definition at line 133 of file collectionfetchscope.cpp.
QStringList Akonadi::CollectionFetchScope::contentMimeTypes | ( | ) | const |
Returns the content mimetypes filter.
- See also
- setContentMimeTypes()
Definition at line 123 of file collectionfetchscope.cpp.
bool Akonadi::CollectionFetchScope::includeStatistics | ( | ) | const |
Returns whether collection statistics should be included in the retrieved results.
- See also
- setIncludeStatistics()
Definition at line 103 of file collectionfetchscope.cpp.
bool Akonadi::CollectionFetchScope::includeUnsubscribed | ( | ) | const |
Returns whether unsubscribed collection should be included.
- See also
- setIncludeUnsubscribed()
- Since
- 4.5
- Deprecated:
- use listFilter() instead
Definition at line 89 of file collectionfetchscope.cpp.
bool Akonadi::CollectionFetchScope::includeUnubscribed | ( | ) | const |
Returns whether unsubscribed collection should be included.
Definition at line 84 of file collectionfetchscope.cpp.
bool Akonadi::CollectionFetchScope::isEmpty | ( | ) | const |
Returns true
if there is nothing to fetch.
Definition at line 79 of file collectionfetchscope.cpp.
CollectionFetchScope::ListFilter Akonadi::CollectionFetchScope::listFilter | ( | ) | const |
Returns the list filter.
- See also
- setListFilter()
- Since
- 4.14
Definition at line 143 of file collectionfetchscope.cpp.
CollectionFetchScope & Akonadi::CollectionFetchScope::operator= | ( | const CollectionFetchScope & | other | ) |
Assigns the other
to this scope and returns a reference to this scope.
Definition at line 70 of file collectionfetchscope.cpp.
QString Akonadi::CollectionFetchScope::resource | ( | ) | const |
Returns the resource identifier that is used as filter.
- See also
- setResource()
Definition at line 113 of file collectionfetchscope.cpp.
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 138 of file collectionfetchscope.cpp.
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 128 of file collectionfetchscope.cpp.
void Akonadi::CollectionFetchScope::setIncludeStatistics | ( | bool | include | ) |
Sets whether collection statistics should be included in the retrieved results.
- Parameters
-
include true
to include collction statistics,false
otherwise (the default).
Definition at line 108 of file collectionfetchscope.cpp.
void Akonadi::CollectionFetchScope::setIncludeUnsubscribed | ( | bool | include | ) |
Sets whether unsubscribed collections should be included in the collection listing.
- Parameters
-
include true
to include unsubscribed collections,false
otherwise (the default).
- Deprecated:
- use setListFilter() instead
Definition at line 94 of file collectionfetchscope.cpp.
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 148 of file collectionfetchscope.cpp.
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 118 of file collectionfetchscope.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.