kmail

kmmsginfo.h
00001 /*
00002  * kmail: KDE mail client
00003  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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 TQCString& str, bool toUtf8);
00037 
00038 
00040   virtual void init(const TQCString& subject, const TQCString& from,
00041                     const TQCString& to, time_t date,
00042             KMMsgStatus status, const TQCString& xmark,
00043                     const TQCString& replyToId,
00044                     const TQCString& replyToAuxId,
00045                     const TQCString& msgId,
00046             KMMsgEncryptionState encryptionState,
00047             KMMsgSignatureState signatureState,
00048             KMMsgMDNSentState mdnSentState,
00049                     const TQCString& prefCharset,
00050             off_t folderOffset=0, size_t msgSize=0,
00051             size_t msgSizeServer = 0, ulong UID = 0);
00052 
00054   virtual void init(const TQCString& subject, const TQCString& from,
00055                     const TQCString& to, time_t date,
00056             KMMsgStatus status, const TQCString& xmark,
00057                     const TQCString& replyToId,
00058                     const TQCString& replyToAuxId,
00059                     const TQCString& msgId,
00060             const TQCString& fileName,
00061             KMMsgEncryptionState encryptionState,
00062             KMMsgSignatureState signatureState,
00063             KMMsgMDNSentState mdnSentState,
00064             const TQCString& prefCharset,
00065                     size_t msgSize=0,
00066             size_t msgSizeServer = 0, ulong UID = 0);
00067 
00069   virtual TQString subject(void) const;
00070   virtual TQString fromStrip(void) const;
00071   virtual TQString from() const;
00072   virtual TQString toStrip(void) const;
00073   virtual TQString to() const;
00074   virtual TQString xmark(void) const;
00075   virtual TQString replyToIdMD5(void) const;
00076   virtual TQString replyToAuxIdMD5() const;
00077   virtual TQString strippedSubjectMD5() const;
00078   virtual bool subjectIsPrefixed() const;
00079   virtual TQString msgIdMD5(void) const;
00080   virtual TQString fileName(void) const;
00081   virtual KMMsgStatus status(void) const;
00082   virtual KMMsgEncryptionState encryptionState() const;
00083   virtual KMMsgSignatureState signatureState() const;
00084   virtual KMMsgMDNSentState mdnSentState() const;
00085   virtual off_t folderOffset(void) const;
00086   virtual size_t msgSize(void) const;
00087   virtual size_t msgSizeServer(void) const;
00088   virtual time_t date(void) const;
00089   virtual ulong UID(void) const;
00090   void setMsgSize(size_t sz);
00091   void setMsgSizeServer(size_t sz);
00092   void setFolderOffset(off_t offs);
00093   void setFileName(const TQString& file);
00094   virtual void setStatus(const KMMsgStatus status, int idx = -1);
00095   virtual void setDate(time_t aUnixTime);
00096   virtual void setSubject(const TQString&);
00097   virtual void setXMark(const TQString&);
00098   virtual void setReplyToIdMD5(const TQString&);
00099   virtual void setReplyToAuxIdMD5( const TQString& );
00100   virtual void initStrippedSubjectMD5();
00101   virtual void setMsgIdMD5(const TQString&);
00102   virtual void setEncryptionState( const KMMsgEncryptionState, int idx = -1 );
00103   virtual void setSignatureState( const KMMsgSignatureState, int idx = -1 );
00104   virtual void setMDNSentState( const KMMsgMDNSentState, int idx = -1 );
00105   virtual void setUID(ulong);
00106   virtual void setFrom( const TQString &from );
00107   virtual void setTo( const TQString &to );
00108 
00110   virtual void setStatus(const char* s1, const char* s2=0) { KMMsgBase::setStatus(s1, s2); }
00111   virtual void setDate(const char* s1) { KMMsgBase::setDate(s1); }
00112 
00113   virtual bool dirty(void) const;
00114 
00116   KMMsgInfo& operator=(const KMMessage&);
00117 
00118 private:
00119   // Currently unused
00120   KMMsgInfo& operator=(const KMMsgInfo&);
00121   KMMsgInfo(const KMMsgInfo&);
00122 
00123   // WARNING: Do not add new member variables to the class. Add them to kd
00124   class KMMsgInfoPrivate;
00125   KMMsgInfoPrivate *kd;
00126 };
00127 
00128 typedef KMMsgInfo* KMMsgInfoPtr;
00129 
00130 #endif /*kmmsginfo_h*/