16 #ifndef __KMIME_HEADERS_OBS_H__
17 #define __KMIME_HEADERS_OBS_H__
19 #if defined(KMIME_NEW_STYPE_CLASSTREE)
20 #error You cannot use this file with the new header classes!
23 #include <tdemacros.h>
31 MessageID(Content *p,
const TQCString &s) : Base(p) { from7BitString(s); }
32 MessageID(Content *p,
const TQString &s) : Base(p) { fromUnicodeString(s, Latin1); }
35 virtual void from7BitString(
const TQCString &s);
36 virtual TQCString as7BitString(
bool incType=
true);
37 virtual void fromUnicodeString(
const TQString &s,
const TQCString&);
38 virtual TQString asUnicodeString();
39 virtual void clear() { m_id.resize(0); }
40 virtual bool isEmpty() {
return (m_id.isEmpty()); }
41 virtual const char* type() {
return "Message-Id"; }
43 void generate(
const TQCString &fqdn);
60 virtual const char* type() {
return "Supersedes"; }
71 AddressField(Content *p,
const TQCString &s) : Base(p) { from7BitString(s); }
72 AddressField(Content *p,
const TQString &s,
const TQCString &cs) : Base(p) { fromUnicodeString(s, cs); }
76 AddressField& operator=(
const AddressField &a) { n_ame=a.n_ame; e_mail=a.e_mail.copy(); e_ncCS=a.e_ncCS;
return (*
this); }
78 virtual void from7BitString(
const TQCString &s);
79 virtual TQCString as7BitString(
bool incType=
true);
80 virtual void fromUnicodeString(
const TQString &s,
const TQCString &cs);
81 virtual TQString asUnicodeString();
82 virtual void clear() { n_ame.truncate(0); e_mail.resize(0); }
83 virtual bool isEmpty() {
return (e_mail.isEmpty() && n_ame.isEmpty()); }
85 bool hasName() {
return ( !n_ame.isEmpty() ); }
86 bool hasEmail() {
return ( !e_mail.isEmpty() ); }
87 TQString name() {
return n_ame; }
88 TQCString nameAs7Bit();
89 TQCString email() {
return e_mail; }
90 void setName(
const TQString &s) { n_ame=s; }
91 void setNameFrom7Bit(
const TQCString &s);
92 void setEmail(
const TQCString &s) { e_mail=s; }
98 typedef TQPtrList<AddressField> ObsAddressList;
107 From(Content *p,
const TQString &s,
const TQCString &cs) :
AddressField(p,s,cs) {}
110 virtual const char* type() {
return "From"; }
124 virtual const char* type() {
return "Reply-To"; }
144 virtual const char* type() {
return "Mail-Copies-To"; }
149 class TDE_EXPORT
To :
public Base {
152 To() : Base(),a_ddrList(0) {}
153 To(Content *p) : Base(p),a_ddrList(0) {}
154 To(Content *p,
const TQCString &s) : Base(p),a_ddrList(0) { from7BitString(s); }
155 To(Content *p,
const TQString &s,
const TQCString &cs) : Base(p),a_ddrList(0) { fromUnicodeString(s,cs); }
156 ~
To() {
delete a_ddrList; }
158 virtual void from7BitString(
const TQCString &s);
159 virtual TQCString as7BitString(
bool incType=
true);
160 virtual void fromUnicodeString(
const TQString &s,
const TQCString &cs);
161 virtual TQString asUnicodeString();
162 virtual void clear() {
delete a_ddrList; a_ddrList=0; }
163 virtual bool isEmpty() {
return (!a_ddrList || a_ddrList->isEmpty()
164 || a_ddrList->first()->isEmpty()); }
165 virtual const char* type() {
return "To"; }
168 void emails(TQStrList *l);
169 void names(TQStringList *l);
170 void displayNames(TQStringList *l);
173 ObsAddressList *a_ddrList;
179 class TDE_EXPORT
CC :
public To {
183 CC(Content *p) :
To(p) {}
184 CC(Content *p,
const TQCString &s) :
To(p,s) {}
185 CC(Content *p,
const TQString &s,
const TQCString &cs) :
To(p,s,cs) {}
188 virtual const char* type() {
return "CC"; }
198 BCC(Content *p) :
To(p) {}
199 BCC(Content *p,
const TQCString &s) :
To(p,s) {}
200 BCC(Content *p,
const TQString &s,
const TQCString &cs) :
To(p,s,cs) {}
203 virtual const char* type() {
return "BCC"; }
213 References(Content *p,
const TQCString &s) : Base(p),p_os(-1) { from7BitString(s); }
214 References(Content *p,
const TQString &s) : Base(p),p_os(-1) { fromUnicodeString(s, Latin1); }
217 virtual void from7BitString(
const TQCString &s);
218 virtual TQCString as7BitString(
bool incType=
true);
219 virtual void fromUnicodeString(
const TQString &s,
const TQCString&);
220 virtual TQString asUnicodeString();
221 virtual void clear() { r_ef.resize(0); p_os=0; }
222 virtual bool isEmpty() {
return (r_ef.isEmpty()); }
223 virtual const char* type() {
return "References"; }
228 TQCString at(
unsigned int i);
229 void append(
const TQCString &s);
241 ContentType() : Base(),m_imeType(
"invalid/invalid"),c_ategory(CCsingle) {}
242 ContentType(Content *p) : Base(p),m_imeType(
"invalid/invalid"),c_ategory(CCsingle) {}
243 ContentType(Content *p,
const TQCString &s) : Base(p) { from7BitString(s); }
244 ContentType(Content *p,
const TQString &s) : Base(p) { fromUnicodeString(s, Latin1); }
247 virtual void from7BitString(
const TQCString &s);
248 virtual TQCString as7BitString(
bool incType=
true);
249 virtual void fromUnicodeString(
const TQString &s,
const TQCString&);
250 virtual TQString asUnicodeString();
251 virtual void clear() { m_imeType.resize(0); p_arams.resize(0); }
252 virtual bool isEmpty() {
return (m_imeType.isEmpty()); }
253 virtual const char* type() {
return "Content-Type"; }
257 TQCString mimeType() {
return m_imeType; }
258 TQCString mediaType();
260 void setMimeType(
const TQCString &s);
261 bool isMediatype(
const char *s);
262 bool isSubtype(
const char *s);
272 void setCharset(
const TQCString &s);
273 TQCString boundary();
274 void setBoundary(
const TQCString &s);
276 void setName(
const TQString &s,
const TQCString &cs);
278 void setId(
const TQCString &s);
281 void setPartialParams(
int total,
int number);
284 contentCategory category() {
return c_ategory; }
285 void setCategory(contentCategory c) { c_ategory=c; }
288 TQCString getParameter(
const char *name);
289 void setParameter(
const TQCString &name,
const TQCString &value,
bool doubleQuotes=
false);
290 TQCString m_imeType, p_arams;
291 contentCategory c_ategory;
300 CTEncoding() : Base(),c_te(CE7Bit),d_ecoded(
true) {}
301 CTEncoding(Content *p) : Base(p),c_te(CE7Bit),d_ecoded(
true) {}
302 CTEncoding(Content *p,
const TQCString &s) : Base(p) { from7BitString(s); }
303 CTEncoding(Content *p,
const TQString &s) : Base(p) { fromUnicodeString(s, Latin1); }
306 virtual void from7BitString(
const TQCString &s);
307 virtual TQCString as7BitString(
bool incType=
true);
308 virtual void fromUnicodeString(
const TQString &s,
const TQCString&);
309 virtual TQString asUnicodeString();
310 virtual void clear() { d_ecoded=
true; c_te=CE7Bit; }
311 virtual const char* type() {
return "Content-Transfer-Encoding"; }
313 contentEncoding cte() {
return c_te; }
314 void setCte(contentEncoding e) { c_te=e; }
315 bool decoded() {
return d_ecoded; }
316 void setDecoded(
bool d=
true) { d_ecoded=d; }
317 bool needToEncode() {
return (d_ecoded && (c_te==CEquPr || c_te==CEbase64)); }
320 contentEncoding c_te;
332 CDisposition(Content *p,
const TQCString &s) : Base(p) { from7BitString(s); }
333 CDisposition(Content *p,
const TQString &s,
const TQCString &cs) : Base(p) { fromUnicodeString(s, cs); }
336 virtual void from7BitString(
const TQCString &s);
337 virtual TQCString as7BitString(
bool incType=
true);
338 virtual void fromUnicodeString(
const TQString &s,
const TQCString &cs);
339 virtual TQString asUnicodeString();
340 virtual void clear() { f_ilename.truncate(0); d_isp=CDinline; }
341 virtual const char* type() {
return "Content-Disposition"; }
343 contentDisposition disposition() {
return d_isp; }
344 void setDisposition(contentDisposition d) { d_isp=d; }
345 bool isAttachment() {
return (d_isp==CDattachment); }
347 TQString filename() {
return f_ilename; }
348 void setFilename(
const TQString &s) { f_ilename=s; }
351 contentDisposition d_isp;
362 CDescription( Content * p ) : Generics::GUnstructured( p ) {}
364 : Generics::GUnstructured( p, s ) {};
365 CDescription( Content * p,
const TQString & s,
const TQCString & cs )
366 : Generics::GUnstructured( p, s, cs ) {}
369 virtual const char* type() {
return "Content-Description"; }
This class encapsulates an address-field, containing an email-address and a real name.
Represents a "BCC" header.
Represents a "CC" header.
Represents a "Content-Description" header.
Represents a "Content-Disposition" header.
Represents a "Content-Transfer-Encoding" header.
Represents a "Content-Type" header.
Represent a "From" header.
Represents a "Mail-Copies-To" header http://www.newsreaders.com/misc/mail-copies-to....
Represents a "Message-Id" header.
Represents a "References" header.
Represents a "Reply-To" header.
Represents a "Supersedes" header.
Represents a "To" header.