akonadi
itemfetchjob.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_ITEMFETCHJOB_H 00021 #define AKONADI_ITEMFETCHJOB_H 00022 00023 #include <akonadi/item.h> 00024 #include <akonadi/job.h> 00025 00026 namespace Akonadi { 00027 00028 class Collection; 00029 class ItemFetchJobPrivate; 00030 class ItemFetchScope; 00031 00082 class AKONADI_EXPORT ItemFetchJob : public Job 00083 { 00084 Q_OBJECT 00085 public: 00092 explicit ItemFetchJob( const Collection &collection, QObject *parent = 0 ); 00093 00105 explicit ItemFetchJob( const Item &item, QObject *parent = 0 ); 00106 00119 explicit ItemFetchJob( const Item::List &items, QObject *parent = 0 ); 00120 00124 virtual ~ItemFetchJob(); 00125 00132 Item::List items() const; 00133 00145 void setFetchScope( ItemFetchScope &fetchScope ); // KDE5: remove 00146 00159 void setFetchScope( const ItemFetchScope &fetchScope ); 00160 00173 ItemFetchScope &fetchScope(); 00174 00182 void setCollection( const Collection &collection ); 00183 00184 Q_SIGNALS: 00194 void itemsReceived( const Akonadi::Item::List &items ); 00195 00196 protected: 00197 virtual void doStart(); 00198 virtual void doHandleResponse( const QByteArray &tag, const QByteArray &data ); 00199 00200 private: 00201 Q_DECLARE_PRIVATE( ItemFetchJob ) 00202 00203 //@cond PRIVATE 00204 Q_PRIVATE_SLOT( d_func(), void selectDone( KJob* ) ) 00205 Q_PRIVATE_SLOT( d_func(), void timeout() ) 00206 //@endcond 00207 }; 00208 00209 } 00210 00211 #endif