akonadi
itemfetchscope.h
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:
00076 ItemFetchScope();
00077
00081 ItemFetchScope( const ItemFetchScope &other );
00082
00086 ~ItemFetchScope();
00087
00091 ItemFetchScope &operator=( const ItemFetchScope &other );
00092
00098 QSet<QByteArray> payloadParts() const;
00099
00107 void fetchPayloadPart( const QByteArray &part, bool fetch = true );
00108
00114 bool fullPayload() const;
00115
00121 void fetchFullPayload( bool fetch = true );
00122
00130 QSet<QByteArray> attributes() const;
00131
00138 void fetchAttribute( const QByteArray &type, bool fetch = true );
00139
00145 template <typename T> inline void fetchAttribute( bool fetch = true )
00146 {
00147 T dummy;
00148 fetchAttribute( dummy.type(), fetch );
00149 }
00150
00156 bool allAttributes() const;
00157
00163 void fetchAllAttributes( bool fetch = true );
00164
00171 bool cacheOnly() const;
00172
00180 void setCacheOnly( bool cacheOnly );
00181
00185 bool isEmpty() const;
00186
00187 private:
00188
00189 QSharedDataPointer<ItemFetchScopePrivate> d;
00190
00191 };
00192
00193 }
00194
00195 #endif