kmail Library API Documentation

cachedimapjob.h

00001 /* -*- mode: C++; c-file-style: "gnu" -*- 00002 * 00003 * This file is part of KMail, the KDE mail client. 00004 * Copyright (c) 2002-2003 Bo Thorsen <bo@sonofthor.dk> 00005 * 2002-2003 Steffen Hansen <hansen@kde.org> 00006 * 2002-2003 Zack Rusin <zack@kde.org> 00007 * 00008 * KMail is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU General Public License, version 2, as 00010 * published by the Free Software Foundation. 00011 * 00012 * KMail is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * In addition, as a special exception, the copyright holders give 00022 * permission to link the code of this program with any edition of 00023 * the Qt library by Trolltech AS, Norway (or with modified versions 00024 * of Qt that use the same license as Qt), and distribute linked 00025 * combinations including the two. You must obey the GNU General 00026 * Public License in all respects for all of the code used other than 00027 * Qt. If you modify this file, you may extend this exception to 00028 * your version of the file, but you are not obligated to do so. If 00029 * you do not wish to do so, delete this exception statement from 00030 * your version. 00031 * 00032 * In addition, as a special exception, the copyright holders give 00033 * permission to link the code of this program with any edition of 00034 * the Qt library by Trolltech AS, Norway (or with modified versions 00035 * of Qt that use the same license as Qt), and distribute linked 00036 * combinations including the two. You must obey the GNU General 00037 * Public License in all respects for all of the code used other than 00038 * Qt. If you modify this file, you may extend this exception to 00039 * your version of the file, but you are not obligated to do so. If 00040 * you do not wish to do so, delete this exception statement from 00041 * your version. 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) {} // for QValueList only 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 // Get messages 00075 CachedImapJob( const QValueList<MsgForDownload>& msgs, 00076 JobType type = tGetMessage, KMFolderCachedImap* folder = 0 ); 00077 // Put messages 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 // Add sub folders 00083 CachedImapJob( const QValueList<KMFolderCachedImap*>& folders, 00084 JobType type = tAddSubfolders, 00085 KMFolderCachedImap* folder = 0 ); 00086 // Rename folder 00087 CachedImapJob( const QString& string1, JobType type, 00088 KMFolderCachedImap* folder ); 00089 // Delete folders or messages 00090 CachedImapJob( const QStringList& foldersOrMsgs, JobType type, 00091 KMFolderCachedImap* folder ); 00092 // Other jobs (list messages,expunge folder, check uid validity) 00093 CachedImapJob( JobType type, KMFolderCachedImap* folder ); 00094 00095 virtual ~CachedImapJob(); 00096 00097 void setParentFolder( const KMFolderCachedImap* parent ); 00098 00099 protected: 00100 virtual void execute(); 00101 void expungeFolder(); 00102 void checkUidValidity(); 00103 void renameFolder( const QString &newName ); 00104 void listMessages(); 00105 00106 protected slots: 00107 virtual void slotGetNextMessage( KIO::Job *job = 0 ); 00108 virtual void slotAddNextSubfolder( KIO::Job *job = 0 ); 00109 virtual void slotPutNextMessage(); 00110 virtual void slotPutMessageDataReq( KIO::Job *job, QByteArray &data ); 00111 virtual void slotPutMessageResult( KIO::Job *job ); 00112 virtual void slotPutMessageInfoData(KIO::Job *, const QString &data); 00113 virtual void slotExpungeResult( KIO::Job *job ); 00114 virtual void slotDeleteNextFolder( KIO::Job *job = 0 ); 00115 virtual void slotCheckUidValidityResult( KIO::Job *job ); 00116 virtual void slotRenameFolderResult( KIO::Job *job ); 00117 virtual void slotListMessagesResult( KIO::Job * job ); 00118 void slotDeleteNextMessages( KIO::Job* job = 0 ); 00119 void slotProcessedSize( KIO::Job *, KIO::filesize_t processed ); 00120 00121 private: 00122 KMFolderCachedImap *mFolder; 00123 KMAcctCachedImap *mAccount; 00124 QValueList<KMFolderCachedImap*> mFolderList; 00125 QValueList<MsgForDownload> mMsgsForDownload; 00126 QValueList<unsigned long> mSerNumMsgList; 00127 ulong mSentBytes; // previous messages 00128 ulong mTotalBytes; 00129 QStringList mFoldersOrMessages; // Folder deletion: path list. Message deletion: sets of uids 00130 KMMessage* mMsg; 00131 QString mString; // Used as uids and as rename target 00132 KMFolderCachedImap *mParentFolder; 00133 }; 00134 00135 } 00136 00137 #endif
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 1 15:19:14 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003