00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef kmmsginfo_h
00021 #define kmmsginfo_h
00022
00023 #include <config.h>
00024 #include <sys/types.h>
00025 #include "kmmsgbase.h"
00026
00027 class KMMessage;
00028
00029 class KMMsgInfo: public KMMsgBase
00030 {
00031 public:
00032 KMMsgInfo(KMFolder* parent, off_t off=0, short len=0);
00033 virtual ~KMMsgInfo();
00034
00036 void compat_fromOldIndexString(const QCString& str, bool toUtf8);
00037
00038
00040 virtual void init(const QCString& subject, const QCString& from,
00041 const QCString& to, time_t date,
00042 KMMsgStatus status, const QCString& xmark,
00043 const QCString& replyToId,
00044 const QCString& replyToAuxId,
00045 const QCString& msgId,
00046 KMMsgEncryptionState encryptionState,
00047 KMMsgSignatureState signatureState,
00048 KMMsgMDNSentState mdnSentState,
00049 const QCString& prefCharset,
00050 off_t folderOffset=0, size_t msgSize=0,
00051 size_t msgSizeServer = 0, ulong UID = 0);
00052
00054 virtual void init(const QCString& subject, const QCString& from,
00055 const QCString& to, time_t date,
00056 KMMsgStatus status, const QCString& xmark,
00057 const QCString& replyToId,
00058 const QCString& replyToAuxId,
00059 const QCString& msgId,
00060 const QCString& fileName,
00061 KMMsgEncryptionState encryptionState,
00062 KMMsgSignatureState signatureState,
00063 KMMsgMDNSentState mdnSentState,
00064 const QCString& prefCharset,
00065 size_t msgSize=0,
00066 size_t msgSizeServer = 0, ulong UID = 0);
00067
00069 virtual QString subject(void) const;
00070 virtual QString fromStrip(void) const;
00071 virtual QString toStrip(void) const;
00072 virtual QString xmark(void) const;
00073 virtual QString replyToIdMD5(void) const;
00074 virtual QString replyToAuxIdMD5() const;
00075 virtual QString strippedSubjectMD5() const;
00076 virtual bool subjectIsPrefixed() const;
00077 virtual QString msgIdMD5(void) const;
00078 virtual QString fileName(void) const;
00079 virtual KMMsgStatus status(void) const;
00080 virtual KMMsgEncryptionState encryptionState() const;
00081 virtual KMMsgSignatureState signatureState() const;
00082 virtual KMMsgMDNSentState mdnSentState() const;
00083 virtual off_t folderOffset(void) const;
00084 virtual size_t msgSize(void) const;
00085 virtual size_t msgSizeServer(void) const;
00086 virtual time_t date(void) const;
00087 virtual ulong UID(void) const;
00088 void setMsgSize(size_t sz);
00089 void setMsgSizeServer(size_t sz);
00090 void setFolderOffset(off_t offs);
00091 void setFileName(const QString& file);
00092 virtual void setStatus(const KMMsgStatus status, int idx = -1);
00093 virtual void setDate(time_t aUnixTime);
00094 virtual void setSubject(const QString&);
00095 virtual void setXMark(const QString&);
00096 virtual void setReplyToIdMD5(const QString&);
00097 virtual void setReplyToAuxIdMD5( const QString& );
00098 virtual void initStrippedSubjectMD5();
00099 virtual void setMsgIdMD5(const QString&);
00100 virtual void setEncryptionState( const KMMsgEncryptionState, int idx = -1 );
00101 virtual void setSignatureState( const KMMsgSignatureState, int idx = -1 );
00102 virtual void setMDNSentState( const KMMsgMDNSentState, int idx = -1 );
00103 virtual void setUID(ulong);
00104
00106 virtual void setStatus(const char* s1, const char* s2=0) { KMMsgBase::setStatus(s1, s2); }
00107 virtual void setDate(const char* s1) { KMMsgBase::setDate(s1); }
00108
00109 virtual bool dirty(void) const;
00110
00112 KMMsgInfo& operator=(const KMMessage&);
00113
00114 private:
00115
00116 KMMsgInfo& operator=(const KMMsgInfo&);
00117 KMMsgInfo(const KMMsgInfo&);
00118
00119
00120 class KMMsgInfoPrivate;
00121 KMMsgInfoPrivate *kd;
00122 };
00123
00124 typedef KMMsgInfo* KMMsgInfoPtr;
00125
00126 #endif