nsIMimeConverter

by 3 contributors:

The nsIMimeConverter service allows you to convert headers into and out of MIME format.

 
 - 1 - Interface Name 
 - 2 - Source Location relative to @topsrc@/mozilla/ 
 - 3 - FROZEN/unfrozen/UNDER_REVIEW/EXPERIMENTAL 
 - 4 - Since [date/milestone] (in unfrozen case, last-changed-in) 
 - 5 - Scriptable? (yes/no) 

See MDC:Writing interface reference documentation for an elaborate guide on documenting interfaces on MDC.

web.html($0) is defined in wiki.template('tbsource', mediawiki.args([$1])). It is wiki.template(mediawiki.path('InterfaceStatus:Scriptable_' + $4, "en")) and wiki.template(mediawiki.path('InterfaceStatus:' + $2, "en"), mediawiki.args([$3])).

Inherits from: nsISupports

Implemented by: @mozilla.org/messenger/mimeconverter;1.

Method overview

 

string encodeMIMEPartIIStr(in string header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);
string encodeMIMEPartIIStr_UTF8(in AUTF8String header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);
string decodeMimeHeaderToCharPtr(in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);
AString decodeMimeHeader(in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);
MimeEncoderData *B64EncoderInit(in MimeConverterOutputCallback output_fn, in void *closure);
MimeEncoderData *QPEncoderInit(in MimeConverterOutputCallback output_fn, in void *closure);
void EncoderDestroy(in MimeEncoderData *data, in boolean abort_p);
long EncoderWrite(in MimeEncoderData *data, in string buffer, in long size);

 

Methods

encodeMimePartIIStr()

An variant of encodeMimePartIIStr_UTF8() which treats the header as written in the given charset. This should only be used by native code, as xpconnect translation causes it to not work properly.

string encodeMimePartIIStr(in string  header,
                           in boolean structured,
                           in string  mailCharset,
                           in long    fieldnamelen,
                           in long    encodedWordSize);
Parameters
propertyName
The name of the property to retrieve.
Return Value

The value of the property.

encodeMimePartIIStr_UTF8()

Encodes a string into a MIME-encoded form according to RFC 2047.

string encodeMimePartIIStr_UTF8(in AUTF8String header,
                                in boolean     structured,
                                in string      mailCharset,
                                in long        fieldnamelen,
                                in long        encodedWordSize);
Parameters
header
The string to encode into the MIME-encoded form.
structured
Whether or not this string may contain <> blocks which should not be encoded (e.g., the From and To headers).
mailCharset
The charset to encode into.
fieldnamelen
The length of the header field including the colon and space (": ").
encodedWordSize
The maximum line length of the encoded string.

decodeMimeHeaderToCharPtr()

 void setStringProperty(in string propertyName,
                        in string propertyValue);
Parameters
propertyName
The name of the property to set.
propertyValue
The value of the property.

decodeMimeHeader()

 string getStringProperty(in string propertyName);
Parameters
propertyName
The name of the property to retrieve.
Return Value

The value of the property.

B64EncoderInit()

Get an integer property. Usually you would use this to store you own properties.

 unsigned long getUint32Property(in string propertyName);
Parameters
propertyName
The name of the property to retrieve. Thunderbird stored Uint32 properties (not a complete list):
indexed
Used for Spotlight integration on OSX.
notAPhishMessage
Indicates whether phisihing filters have been run on a message yet.

 

Return Value

The value of the property.

QPEncoderInit()

 void setUint32Property(in string propertyName,
                        in unsigned long propertyVal);
Parameters
propertyName
The name of the property to set.
propertyVal
The value of the property.

EncoderDestroy()

Marks this header as read. Thunderbird provides a utility function which performs this for the currently selected message: MarkCurrentMessageAsRead().

 void markRead(in boolean read);
Parameters
read
If true, mark as read. If false mark as undread.

EncoderWrite()

 void markFlagged(in boolean flagged);
Parameters
flagged
If true, mark as flagged. If false remove flag.

Document Tags and Contributors

Contributors to this page: teoli, Oeekker, Jcranmer
Last updated by: Oeekker,