kmail
cachedimapjob.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
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef CACHEDIMAPJOB_H
00045 #define CACHEDIMAPJOB_H
00046
00047 #include "folderjob.h"
00048 #include <kio/job.h>
00049 #include <kio/global.h>
00050
00051 #include <qptrlist.h>
00052 #include <qvaluelist.h>
00053 #include <qcstring.h>
00054
00055 class KMFolderCachedImap;
00056 class KMAcctCachedImap;
00057 class KMMessage;
00058
00059 namespace KMail {
00060
00061 class CachedImapJob : public FolderJob {
00062 Q_OBJECT
00063 public:
00065 struct MsgForDownload {
00066 MsgForDownload() : uid(0),flags(0),size(0) {}
00067 MsgForDownload( ulong _uid, int _flags, ulong _size )
00068 : uid(_uid), flags(_flags), size(_size) {}
00069 ulong uid;
00070 int flags;
00071 ulong size;
00072 };
00073
00074
00075 CachedImapJob( const QValueList<MsgForDownload>& msgs,
00076 JobType type = tGetMessage, KMFolderCachedImap* folder = 0 );
00077
00078 CachedImapJob( const QPtrList<KMMessage>& msgs,
00079 JobType type, KMFolderCachedImap* folder=0 );
00080 CachedImapJob( const QValueList<unsigned long>& msgs,
00081 JobType type, KMFolderCachedImap* folder=0 );
00082
00083 CachedImapJob( const QValueList<KMFolderCachedImap*>& folders,
00084 JobType type = tAddSubfolders,
00085 KMFolderCachedImap* folder = 0 );
00086
00087 CachedImapJob( const QString& string1, JobType type,
00088 KMFolderCachedImap* folder );
00089
00090 CachedImapJob( const QStringList& foldersOrMsgs, JobType type,
00091 KMFolderCachedImap* folder );
00092
00093 CachedImapJob( JobType type, KMFolderCachedImap* folder );
00094
00095 virtual ~CachedImapJob();
00096
00097 void setParentFolder( const KMFolderCachedImap* parent );
00098
00099 signals:
00100
00101 void permanentFlags( int flags );
00102
00103 protected:
00104 virtual void execute();
00105 void expungeFolder();
00106 void checkUidValidity();
00107 void renameFolder( const QString &newName );
00108 void listMessages();
00109
00110 protected slots:
00111 virtual void slotGetNextMessage( KIO::Job *job = 0 );
00112 virtual void slotAddNextSubfolder( KIO::Job *job = 0 );
00113 virtual void slotPutNextMessage();
00114 virtual void slotPutMessageDataReq( KIO::Job *job, QByteArray &data );
00115 virtual void slotPutMessageResult( KIO::Job *job );
00116 virtual void slotPutMessageInfoData(KIO::Job *, const QString &data);
00117 virtual void slotExpungeResult( KIO::Job *job );
00118 virtual void slotDeleteNextFolder( KIO::Job *job = 0 );
00119 virtual void slotCheckUidValidityResult( KIO::Job *job );
00120 virtual void slotRenameFolderResult( KIO::Job *job );
00121 virtual void slotListMessagesResult( KIO::Job * job );
00122 void slotDeleteNextMessages( KIO::Job* job = 0 );
00123 void slotProcessedSize( KIO::Job *, KIO::filesize_t processed );
00124
00125 private:
00126 KMFolderCachedImap *mFolder;
00127 KMAcctCachedImap *mAccount;
00128 QValueList<KMFolderCachedImap*> mFolderList;
00129 QValueList<MsgForDownload> mMsgsForDownload;
00130 QValueList<unsigned long> mSerNumMsgList;
00131 ulong mSentBytes;
00132 ulong mTotalBytes;
00133 QStringList mFoldersOrMessages;
00134 KMMessage* mMsg;
00135 QString mString;
00136 KMFolderCachedImap *mParentFolder;
00137 };
00138
00139 }
00140
00141 #endif
|