You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
191 lines
3.9 KiB
191 lines
3.9 KiB
15 years ago
|
/***************************************************************************
|
||
|
mailheader.h - description
|
||
|
-------------------
|
||
|
begin : Tue Oct 24 2000
|
||
|
copyright : (C) 2000 by Sven Carstens
|
||
|
email : s.carstens@gmx.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License as published by *
|
||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||
|
* (at your option) any later version. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#ifndef MAILHEADER_H
|
||
|
#define MAILHEADER_H
|
||
|
|
||
|
#include "mimeheader.h"
|
||
|
#include "mailaddress.h"
|
||
|
#include "mimeio.h"
|
||
|
#include "rfcdecoder.h"
|
||
|
|
||
|
/**
|
||
|
*@author Sven Carstens
|
||
|
*/
|
||
|
|
||
|
class mailHeader:public mimeHeader
|
||
|
{
|
||
|
public:
|
||
|
mailHeader ();
|
||
|
~mailHeader ();
|
||
|
|
||
|
virtual void addHdrLine (mimeHdrLine *);
|
||
|
virtual void outputHeader (mimeIO &);
|
||
|
|
||
|
void addTo (const mailAddress & _adr)
|
||
|
{
|
||
|
toAdr.append (new mailAddress (_adr));
|
||
|
}
|
||
|
void addCC (const mailAddress & _adr)
|
||
|
{
|
||
|
ccAdr.append (new mailAddress (_adr));
|
||
|
}
|
||
|
void addBCC (const mailAddress & _adr)
|
||
|
{
|
||
|
bccAdr.append (new mailAddress (_adr));
|
||
|
}
|
||
|
|
||
|
void setFrom (const mailAddress & _adr)
|
||
|
{
|
||
|
fromAdr = _adr;
|
||
|
}
|
||
|
void setSender (const mailAddress & _adr)
|
||
|
{
|
||
|
senderAdr = _adr;
|
||
|
}
|
||
|
void setReturnPath (const mailAddress & _adr)
|
||
|
{
|
||
|
returnpathAdr = _adr;
|
||
|
}
|
||
|
void setReplyTo (const mailAddress & _adr)
|
||
|
{
|
||
|
replytoAdr = _adr;
|
||
|
}
|
||
|
|
||
15 years ago
|
const TQCString& getMessageId ()
|
||
15 years ago
|
{
|
||
|
return messageID;
|
||
|
}
|
||
15 years ago
|
void setMessageId (const TQCString & _str)
|
||
15 years ago
|
{
|
||
|
messageID = _str;
|
||
|
}
|
||
|
|
||
15 years ago
|
const TQCString& getInReplyTo ()
|
||
15 years ago
|
{
|
||
|
return inReplyTo;
|
||
|
}
|
||
15 years ago
|
void setInReplyTo (const TQCString & _str)
|
||
15 years ago
|
{
|
||
|
inReplyTo = _str;
|
||
|
}
|
||
|
|
||
15 years ago
|
const TQCString& getReferences ()
|
||
15 years ago
|
{
|
||
|
return references;
|
||
|
}
|
||
15 years ago
|
void setReferences (const TQCString & _str)
|
||
15 years ago
|
{
|
||
|
references = _str;
|
||
|
}
|
||
|
|
||
|
/**
|
||
13 years ago
|
* set a unicode subject
|
||
15 years ago
|
*/
|
||
15 years ago
|
void setSubject (const TQString & _str)
|
||
15 years ago
|
{
|
||
|
_subject = rfcDecoder::encodeRFC2047String(_str).latin1();
|
||
|
}
|
||
|
/**
|
||
|
* set a encoded subject
|
||
|
*/
|
||
15 years ago
|
void setSubjectEncoded (const TQCString & _str)
|
||
15 years ago
|
{
|
||
|
_subject = _str.simplifyWhiteSpace();
|
||
|
}
|
||
|
|
||
|
/**
|
||
13 years ago
|
* get the unicode subject
|
||
15 years ago
|
*/
|
||
15 years ago
|
const TQString getSubject ()
|
||
15 years ago
|
{
|
||
|
return rfcDecoder::decodeRFC2047String(_subject);
|
||
|
}
|
||
|
/**
|
||
|
* get the encoded subject
|
||
|
*/
|
||
15 years ago
|
const TQCString& getSubjectEncoded ()
|
||
15 years ago
|
{
|
||
|
return _subject;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* set the date
|
||
|
*/
|
||
15 years ago
|
void setDate (const TQCString & _str)
|
||
15 years ago
|
{
|
||
|
mDate = _str;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* get the date
|
||
|
*/
|
||
15 years ago
|
const TQCString& date ()
|
||
15 years ago
|
{
|
||
|
return mDate;
|
||
|
}
|
||
|
|
||
15 years ago
|
static int parseAddressList (const char *, TQPtrList < mailAddress > *);
|
||
|
static TQCString getAddressStr (TQPtrList < mailAddress > *);
|
||
|
TQPtrList < mailAddress > &to ()
|
||
15 years ago
|
{
|
||
|
return toAdr;
|
||
|
}
|
||
15 years ago
|
TQPtrList < mailAddress > &cc ()
|
||
15 years ago
|
{
|
||
|
return ccAdr;
|
||
|
}
|
||
15 years ago
|
TQPtrList < mailAddress > &bcc ()
|
||
15 years ago
|
{
|
||
|
return bccAdr;
|
||
|
}
|
||
|
#ifdef KMAIL_COMPATIBLE
|
||
15 years ago
|
TQString subject ()
|
||
15 years ago
|
{
|
||
|
return getSubject ();
|
||
|
}
|
||
|
const mailAddress & from ()
|
||
|
{
|
||
|
return fromAdr;
|
||
|
}
|
||
|
const mailAddress & replyTo ()
|
||
|
{
|
||
|
return replytoAdr;
|
||
|
}
|
||
|
void readConfig (void)
|
||
|
{;
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQPtrList < mailAddress > toAdr;
|
||
|
TQPtrList < mailAddress > ccAdr;
|
||
|
TQPtrList < mailAddress > bccAdr;
|
||
15 years ago
|
mailAddress fromAdr;
|
||
|
mailAddress senderAdr;
|
||
|
mailAddress returnpathAdr;
|
||
|
mailAddress replytoAdr;
|
||
15 years ago
|
TQCString _subject;
|
||
|
TQCString mDate;
|
||
15 years ago
|
int gmt_offset;
|
||
15 years ago
|
TQCString messageID;
|
||
|
TQCString inReplyTo;
|
||
|
TQCString references;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|