akonadi
collectionfetchjob.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_COLLECTIONFETCHJOB_H
00021 #define AKONADI_COLLECTIONFETCHJOB_H
00022
00023 #include "akonadi_export.h"
00024 #include <akonadi/collection.h>
00025 #include <akonadi/job.h>
00026
00027 namespace Akonadi {
00028
00029 class CollectionFetchScope;
00030 class CollectionFetchJobPrivate;
00031
00052 class AKONADI_EXPORT CollectionFetchJob : public Job
00053 {
00054 Q_OBJECT
00055
00056 public:
00060 enum Type
00061 {
00062 Base,
00063 FirstLevel,
00064 Recursive
00065 };
00066
00079 explicit CollectionFetchJob( const Collection &collection, Type type = FirstLevel, QObject *parent = 0 );
00080
00088 explicit CollectionFetchJob( const Collection::List &collections, QObject *parent = 0 );
00089
00093 virtual ~CollectionFetchJob();
00094
00098 Collection::List collections() const;
00099
00106 KDE_DEPRECATED void setResource( const QString &resource );
00107
00112 KDE_DEPRECATED void includeUnsubscribed( bool include = true );
00113
00120 KDE_DEPRECATED void includeStatistics( bool include = true );
00121
00133 void setFetchScope( const CollectionFetchScope &fetchScope );
00134
00148 CollectionFetchScope &fetchScope();
00149
00150 Q_SIGNALS:
00156 void collectionsReceived( const Akonadi::Collection::List &collections );
00157
00158 protected:
00159 virtual void doStart();
00160 virtual void doHandleResponse( const QByteArray &tag, const QByteArray &data );
00161
00162 protected Q_SLOTS:
00163
00164 void slotResult( KJob* job );
00165
00166
00167 private:
00168 Q_DECLARE_PRIVATE( CollectionFetchJob )
00169
00170
00171 Q_PRIVATE_SLOT( d_func(), void timeout() )
00172
00173 };
00174
00175 }
00176
00177 #endif