kmail
folderjob.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef FOLDERJOB_H
00032 #define FOLDERJOB_H
00033
00034 #include "kmmessage.h"
00035
00036 #include <qobject.h>
00037 #include <qptrlist.h>
00038 #include <qstring.h>
00039
00040 class KMFolder;
00041
00042 namespace KMail {
00043
00044 class FolderJob : public QObject
00045 {
00046 Q_OBJECT
00047
00048 public:
00049 enum JobType { tListMessages, tGetFolder, tCreateFolder, tExpungeFolder,
00050 tDeleteMessage, tGetMessage, tPutMessage, tAddSubfolders,
00051 tDeleteFolders, tCheckUidValidity, tRenameFolder,
00052 tCopyMessage, tMoveMessage, tOther };
00057 FolderJob( KMMessage *msg, JobType jt = tGetMessage, KMFolder *folder = 0,
00058 QString partSpecifier = QString::null );
00059
00065 FolderJob( const QPtrList<KMMessage>& msgList, const QString& sets,
00066 JobType jt = tGetMessage, KMFolder *folder = 0 );
00072 FolderJob( JobType jt );
00073 virtual ~FolderJob();
00074
00075 QPtrList<KMMessage> msgList() const;
00079 void start();
00080
00086 virtual void kill();
00087
00092 int error() const { return mErrorCode; }
00093
00097 bool isCancellable() const { return mCancellable; }
00098
00105 void setCancellable( bool b ) { mCancellable = b; }
00106
00107 void setPassiveDestructor( bool passive ) { mPassiveDestructor = passive; }
00108 bool passiveDestructor() { return mPassiveDestructor; }
00109
00110 signals:
00115 void messageRetrieved( KMMessage * );
00116
00120 void messageUpdated( KMMessage *, QString );
00121
00126 void messageStored( KMMessage * );
00127
00133 void messageCopied( QPtrList<KMMessage> );
00134
00140 void messageCopied( KMMessage * );
00141
00145 void finished();
00146
00153 void result( KMail::FolderJob* job );
00154
00160 void progress( unsigned long bytesDownloaded, unsigned long bytesTotal );
00161
00162 private:
00163 void init();
00164
00165 protected:
00170 virtual void execute()=0;
00171
00172 QPtrList<KMMessage> mMsgList;
00173 JobType mType;
00174 QString mSets;
00175 KMFolder* mSrcFolder;
00176 KMFolder* mDestFolder;
00177 QString mPartSpecifier;
00178 int mErrorCode;
00179
00180
00181 bool mPassiveDestructor;
00182 bool mStarted;
00183 bool mCancellable;
00184 };
00185
00186 }
00187
00188 #endif
|