Public Member Functions | Public Attributes

nsIMimeConverter Interface Reference

Encode/decode mail headers (via libmime). More...

import "nsIMimeConverter.idl";

List of all members.

Public Member Functions

string encodeMimePartIIStr (in string header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedWordSize)
 Encode an ASCII string into RFC2047 form, but don't use this...
string encodeMimePartIIStr_UTF8 (in AUTF8String header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedWordSize)
 Encode a UTF-8 CString into RFC 2047 form ("=?" charset "?" encoding "?" encoded-text "?=", where encoding is either "B" for BASE64 (RFC 2045) or "Q" for quoted-printable-ish (RFC 2045)).
string decodeMimeHeaderToCharPtr (in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations)
 Decode a MIME header to UTF-8 if conversion is required.
AString decodeMimeHeader (in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations)
 Decode a MIME header to UTF-16.
MimeEncoderDataPtr B64EncoderInit (in MimeConverterOutputCallback output_fn, in voidPtr closure)
MimeEncoderDataPtr QPEncoderInit (in MimeConverterOutputCallback output_fn, in voidPtr closure)
void EncoderDestroy (in MimeEncoderDataPtr data, in boolean abort_p)
long EncoderWrite (in MimeEncoderDataPtr data, in string buffer, in long size)

Public Attributes

const long MIME_ENCODED_WORD_SIZE = 72
 Suggested byte length limit for use when calling encodeMimePartIIStr(_UTF8).
const long MAX_CHARSET_NAME_LENGTH = 64

Detailed Description

Encode/decode mail headers (via libmime).


Member Function Documentation

MimeEncoderDataPtr nsIMimeConverter::B64EncoderInit ( in MimeConverterOutputCallback  output_fn,
in voidPtr  closure 
)
AString nsIMimeConverter::decodeMimeHeader ( in string  header,
in string  default_charset,
in boolean  override_charset,
in boolean  eatContinuations 
)

Decode a MIME header to UTF-16.

Parameters:
header A (possibly encoded) header to decode.
default_charset The charset to apply to un-labeled non-UTF-8 data.
override_charset If true, default_charset is used instead of any charset labeling other than UTF-8.
eatContinuations If true, unfold headers.
Returns:
UTF-16 encoded value as an AString.
string nsIMimeConverter::decodeMimeHeaderToCharPtr ( in string  header,
in string  default_charset,
in boolean  override_charset,
in boolean  eatContinuations 
)

Decode a MIME header to UTF-8 if conversion is required.

Marked as noscript because the return value may contain non-ASCII characters.

Parameters:
header A (possibly encoded) header to decode.
default_charset The charset to apply to un-labeled non-UTF-8 data.
override_charset If true, default_charset is used instead of any charset labeling other than UTF-8.
eatContinuations If true, unfold headers.
Returns:
UTF-8 encoded value if conversion was required, nsnull if no conversion was required.
string nsIMimeConverter::encodeMimePartIIStr ( in string  header,
in boolean  structured,
in string  mailCharset,
in long  fieldnamelen,
in long  encodedWordSize 
)

Encode an ASCII string into RFC2047 form, but don't use this...

use encodeMimePartIIStr_UTF8 for scripting purposes. (The header argument could easily contain non-ASCII characters.)

All this routine does is convert header to unicode, then call the UTF8 version anyways.

string nsIMimeConverter::encodeMimePartIIStr_UTF8 ( in AUTF8String  header,
in boolean  structured,
in string  mailCharset,
in long  fieldnamelen,
in long  encodedWordSize 
)

Encode a UTF-8 CString into RFC 2047 form ("=?" charset "?" encoding "?" encoded-text "?=", where encoding is either "B" for BASE64 (RFC 2045) or "Q" for quoted-printable-ish (RFC 2045)).

Parameters:
header UTF-8 header to encode.
structured Is the header's field-body a "structured" field? (Encoded words are only allowed in comment/phrase portions of structured field bodies.)
mailCharset Charset name to convert (as an ASCII C string).
fieldnamelen Header field name lengt (ex: "From: " = 6)
encodedWordSize Byte length limit of the output, usually 72. (Use MIME_ENCODED_WORD_SIZE.)
Returns:
The encoded buffer (as a C string).
void nsIMimeConverter::EncoderDestroy ( in MimeEncoderDataPtr  data,
in boolean  abort_p 
)
long nsIMimeConverter::EncoderWrite ( in MimeEncoderDataPtr  data,
in string  buffer,
in long  size 
)
MimeEncoderDataPtr nsIMimeConverter::QPEncoderInit ( in MimeConverterOutputCallback  output_fn,
in voidPtr  closure 
)

Member Data Documentation

Suggested byte length limit for use when calling encodeMimePartIIStr(_UTF8).


The documentation for this interface was generated from the following file: