collectionfetchjob.h

00001 /*
00002     Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
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     //@cond PRIVATE
00164     void slotResult( KJob* job );
00165     //@endcond
00166 
00167   private:
00168     Q_DECLARE_PRIVATE( CollectionFetchJob )
00169 
00170     //@cond PRIVATE
00171     Q_PRIVATE_SLOT( d_func(), void timeout() )
00172     //@endcond
00173 };
00174 
00175 }
00176 
00177 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys