kioslaves

mailheader.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           mailheader.h  -  description
00003                              -------------------
00004     begin                : Tue Oct 24 2000
00005     copyright            : (C) 2000 by Sven Carstens
00006     email                : s.carstens@gmx.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MAILHEADER_H
00019 #define MAILHEADER_H
00020 
00021 #include "mimeheader.h"
00022 #include "mailaddress.h"
00023 #include "mimeio.h"
00024 #include "rfcdecoder.h"
00025 
00030 class mailHeader:public mimeHeader
00031 {
00032 public:
00033   mailHeader ();
00034   ~mailHeader ();
00035 
00036   virtual void addHdrLine (mimeHdrLine *);
00037   virtual void outputHeader (mimeIO &);
00038 
00039   void addTo (const mailAddress & _adr)
00040   {
00041     toAdr.append (new mailAddress (_adr));
00042   }
00043   void addCC (const mailAddress & _adr)
00044   {
00045     ccAdr.append (new mailAddress (_adr));
00046   }
00047   void addBCC (const mailAddress & _adr)
00048   {
00049     bccAdr.append (new mailAddress (_adr));
00050   }
00051 
00052   void setFrom (const mailAddress & _adr)
00053   {
00054     fromAdr = _adr;
00055   }
00056   void setSender (const mailAddress & _adr)
00057   {
00058     senderAdr = _adr;
00059   }
00060   void setReturnPath (const mailAddress & _adr)
00061   {
00062     returnpathAdr = _adr;
00063   }
00064   void setReplyTo (const mailAddress & _adr)
00065   {
00066     replytoAdr = _adr;
00067   }
00068 
00069   const QCString& getMessageId ()
00070   {
00071     return messageID;
00072   }
00073   void setMessageId (const QCString & _str)
00074   {
00075     messageID = _str;
00076   }
00077 
00078   const QCString& getInReplyTo ()
00079   {
00080     return inReplyTo;
00081   }
00082   void setInReplyTo (const QCString & _str)
00083   {
00084     inReplyTo = _str;
00085   }
00086 
00087   const QCString& getReferences ()
00088   {
00089     return references;
00090   }
00091   void setReferences (const QCString & _str)
00092   {
00093     references = _str;
00094   }
00095 
00099   void setSubject (const QString & _str)
00100   {
00101     _subject = rfcDecoder::encodeRFC2047String(_str).latin1();
00102   }
00106   void setSubjectEncoded (const QCString & _str)
00107   {
00108     _subject = _str.simplifyWhiteSpace();
00109   }
00110 
00114   const QString getSubject ()
00115   {
00116     return rfcDecoder::decodeRFC2047String(_subject);
00117   }
00121   const QCString& getSubjectEncoded ()
00122   {
00123     return _subject;
00124   }
00125 
00129   void setDate (const QCString & _str)
00130   {
00131     mDate = _str;
00132   }
00133 
00137   const QCString& date ()
00138   {
00139     return mDate;
00140   }
00141 
00142   static int parseAddressList (const char *, QPtrList < mailAddress > *);
00143   static QCString getAddressStr (QPtrList < mailAddress > *);
00144   QPtrList < mailAddress > &to ()
00145   {
00146     return toAdr;
00147   }
00148   QPtrList < mailAddress > &cc ()
00149   {
00150     return ccAdr;
00151   }
00152   QPtrList < mailAddress > &bcc ()
00153   {
00154     return bccAdr;
00155   }
00156 #ifdef KMAIL_COMPATIBLE
00157   QString subject ()
00158   {
00159     return getSubject ();
00160   }
00161   const mailAddress & from ()
00162   {
00163     return fromAdr;
00164   }
00165   const mailAddress & replyTo ()
00166   {
00167     return replytoAdr;
00168   }
00169   void readConfig (void)
00170   {;
00171   }
00172 #endif
00173 
00174 private:
00175   QPtrList < mailAddress > toAdr;
00176   QPtrList < mailAddress > ccAdr;
00177   QPtrList < mailAddress > bccAdr;
00178   mailAddress fromAdr;
00179   mailAddress senderAdr;
00180   mailAddress returnpathAdr;
00181   mailAddress replytoAdr;
00182   QCString _subject;
00183   QCString mDate;
00184   int gmt_offset;
00185   QCString messageID;
00186   QCString inReplyTo;
00187   QCString references;
00188 };
00189 
00190 #endif