job_p.h
00001 /* 00002 Copyright (c) 2007 Tobias Koenig <tokoe@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_JOB_P_H 00021 #define AKONADI_JOB_P_H 00022 00023 #include "session.h" 00024 #include "item.h" 00025 00026 namespace Akonadi { 00027 00031 class JobPrivate 00032 { 00033 public: 00034 JobPrivate( Job *parent ) 00035 : q_ptr( parent ), 00036 mCurrentSubJob( 0 ), 00037 mWriteFinished( false ), 00038 mStarted( false ) 00039 { 00040 } 00041 00042 virtual ~JobPrivate() 00043 { 00044 } 00045 00046 void init( QObject *parent ); 00047 00048 void handleResponse( const QByteArray &tag, const QByteArray &data ); 00049 void startQueued(); 00050 void lostConnection(); 00051 void slotSubJobAboutToStart( Akonadi::Job* ); 00052 void startNext(); 00053 void signalCreationToJobTracker(); 00054 void delayedEmitResult(); 00058 QByteArray newTag(); 00059 00063 QByteArray tag() const; 00064 00068 void writeData( const QByteArray &data ); 00069 00074 void itemRevisionChanged( Akonadi::Item::Id itemId, int oldRevision, int newRevision ); 00075 00079 void updateItemRevision( Akonadi::Item::Id itemId, int oldRevision, int newRevision ); 00080 00085 virtual void doUpdateItemRevision( Akonadi::Item::Id, int oldRevision, int newRevision ); 00086 00087 Job *q_ptr; 00088 Q_DECLARE_PUBLIC( Job ) 00089 00090 Job *mParentJob; 00091 Job *mCurrentSubJob; 00092 QByteArray mTag; 00093 Session* mSession; 00094 bool mWriteFinished; 00095 bool mStarted; 00096 }; 00097 00098 } 00099 00100 #endif