nsIMimeConverter 编辑

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:35 次

字数:7626

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文