00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ITEMFETCHSCOPE_H
00021 #define ITEMFETCHSCOPE_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <QtCore/QSharedDataPointer>
00026
00027 class QStringList;
00028 template <typename T> class QSet;
00029
00030 namespace Akonadi {
00031
00032 class ItemFetchScopePrivate;
00033
00067 class AKONADI_EXPORT ItemFetchScope
00068 {
00069 public:
00074 enum AncestorRetrieval {
00075 None,
00076 Parent,
00077 All
00078 };
00079
00086 ItemFetchScope();
00087
00091 ItemFetchScope( const ItemFetchScope &other );
00092
00096 ~ItemFetchScope();
00097
00101 ItemFetchScope &operator=( const ItemFetchScope &other );
00102
00108 QSet<QByteArray> payloadParts() const;
00109
00117 void fetchPayloadPart( const QByteArray &part, bool fetch = true );
00118
00124 bool fullPayload() const;
00125
00132 void fetchFullPayload( bool fetch = true );
00133
00141 QSet<QByteArray> attributes() const;
00142
00149 void fetchAttribute( const QByteArray &type, bool fetch = true );
00150
00156 template <typename T> inline void fetchAttribute( bool fetch = true )
00157 {
00158 T dummy;
00159 fetchAttribute( dummy.type(), fetch );
00160 }
00161
00167 bool allAttributes() const;
00168
00175 void fetchAllAttributes( bool fetch = true );
00176
00183 bool cacheOnly() const;
00184
00192 void setCacheOnly( bool cacheOnly );
00193
00201 void setAncestorRetrieval( AncestorRetrieval ancestorDepth );
00202
00209 AncestorRetrieval ancestorRetrieval() const;
00210
00218 void setFetchModificationTime( bool retrieveMtime );
00219
00226 bool fetchModificationTime() const;
00227
00231 bool isEmpty() const;
00232
00233 private:
00234
00235 QSharedDataPointer<ItemFetchScopePrivate> d;
00236
00237 };
00238
00239 }
00240
00241 #endif