kmail
kmfoldermbox.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef kmfoldermbox_h
00021 #define kmfoldermbox_h
00022
00023 #include "kmfolderindex.h"
00024 #include "mboxjob.h"
00025
00026 #include <sys/types.h>
00027
00028 namespace KMail {
00029 class FolderJob;
00030 class MboxJob;
00031 class AttachmentStrategy;
00032 }
00033 using KMail::FolderJob;
00034 using KMail::MboxJob;
00035 using KMail::AttachmentStrategy;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 class KMFolderMbox : public KMFolderIndex
00048 {
00049 Q_OBJECT
00050 friend class ::KMail::MboxJob;
00051 public:
00052
00053
00057 KMFolderMbox(KMFolder* folder, const char* name=0);
00058 virtual ~KMFolderMbox();
00059
00061 virtual KMFolderType folderType() const { return KMFolderTypeMbox; }
00062
00064 virtual QCString& getMsgString(int idx, QCString& mDest);
00065 DwString getDwString(int idx);
00066
00073 virtual int addMsg( KMMessage* msg, int* index_return = 0 );
00074
00080 virtual int open();
00081
00084 virtual void close(bool force=FALSE);
00085
00086 virtual int canAccess();
00087
00089 virtual void sync();
00090
00092 virtual int create();
00093
00096 virtual int compact( bool silent );
00097
00100 int compact( unsigned int startIndex, int nbMessages, FILE* tmpFile, off_t& offs, bool& done );
00101
00103 virtual bool isReadOnly() const { return mReadOnly; }
00104
00106 bool isLocked() const { return mFilesLocked; }
00107
00108 void setLockType( LockType ltype=FCNTL );
00109
00110 void setProcmailLockFileName( const QString& );
00111
00112 static QByteArray escapeFrom( const DwString & str );
00113
00114 virtual IndexStatus indexStatus();
00115
00116 protected:
00117 virtual FolderJob* doCreateJob( KMMessage *msg, FolderJob::JobType jt, KMFolder *folder,
00118 QString partSpecifier, const AttachmentStrategy *as ) const;
00119 virtual FolderJob* doCreateJob( QPtrList<KMMessage>& msgList, const QString& sets,
00120 FolderJob::JobType jt, KMFolder *folder ) const;
00123 virtual KMMessage* readMsg(int idx);
00124
00128 virtual int createIndexFromContents();
00129
00132 virtual int lock();
00133
00136 virtual int unlock();
00137
00141 virtual int removeContents();
00142
00146 virtual int expungeContents();
00147
00148 private:
00149 FILE *mStream;
00150 bool mFilesLocked;
00151 bool mReadOnly;
00152 LockType mLockType;
00153 QString mProcmailLockFileName;
00154 };
00155
00156 #endif // kmfoldermbox_h
|