akonadi
job.h
00001 /* 00002 Copyright (c) 2006 Tobias Koenig <tokoe@kde.org> 00003 2006 Marc Mutz <mutz@kde.org> 00004 2006 - 2007 Volker Krause <vkrause@kde.org> 00005 00006 This library is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU Library General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or (at your 00009 option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00014 License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to the 00018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. 00020 */ 00021 00022 #ifndef AKONADI_JOB_H 00023 #define AKONADI_JOB_H 00024 00025 #include "akonadi_export.h" 00026 00027 #include <kcompositejob.h> 00028 00029 class QString; 00030 00031 namespace Akonadi { 00032 00033 class JobPrivate; 00034 class Session; 00035 class SessionPrivate; 00036 00086 class AKONADI_EXPORT Job : public KCompositeJob 00087 { 00088 Q_OBJECT 00089 00090 friend class Session; 00091 friend class SessionPrivate; 00092 00093 public: 00097 typedef QList<Job*> List; 00098 00104 enum Error 00105 { 00106 ConnectionFailed = UserDefinedError, 00107 ProtocolVersionMismatch, 00108 UserCanceled, 00109 Unknown, 00110 UserError = UserDefinedError + 42 00111 }; 00112 00122 explicit Job( QObject *parent = 0 ); 00123 00127 virtual ~Job(); 00128 00133 void start(); 00134 00139 virtual QString errorString() const; 00140 00141 Q_SIGNALS: 00147 void aboutToStart( Akonadi::Job *job ); 00148 00157 void writeFinished( Akonadi::Job *job ); 00158 00159 protected: 00165 virtual void doStart() = 0; 00166 00175 virtual void doHandleResponse( const QByteArray &tag, const QByteArray &data ); 00176 00185 virtual bool addSubjob( KJob* job ); 00186 00192 virtual bool removeSubjob( KJob* job ); 00193 00197 virtual bool doKill(); 00198 00203 void emitWriteFinished(); 00204 00205 protected Q_SLOTS: 00206 virtual void slotResult( KJob* job ); 00207 00208 protected: 00209 //@cond PRIVATE 00210 Job( JobPrivate *dd, QObject *parent ); 00211 JobPrivate* const d_ptr; 00212 //@endcond 00213 00214 private: 00215 Q_DECLARE_PRIVATE( Job ) 00216 00217 //@cond PRIVATE 00218 Q_PRIVATE_SLOT( d_func(), void slotSubJobAboutToStart( Akonadi::Job* ) ) 00219 Q_PRIVATE_SLOT( d_func(), void startNext() ) 00220 Q_PRIVATE_SLOT( d_func(), void signalCreationToJobTracker() ) 00221 Q_PRIVATE_SLOT( d_func(), void delayedEmitResult() ) 00222 //@endcond 00223 }; 00224 00225 } 00226 00227 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:52:57 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:52:57 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.