nsIMsgWindow 编辑

mailnews/base/public/nsIMsgWindow.idlScriptable Please add a summary to this article. Inherits from: nsISupports Last changed in Gecko 8 (Firefox 8 / Thunderbird 8 / SeaMonkey 2.5)

Implemented by: @mozilla.org/messenger/msgwindow;1. To create an instance, use:

 msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"]
                       .createInstance(Components.interfaces.nsIMsgWindow);

In Thunderbird the default message window is stored in the global variable msgWindow.

Method overview

void displayHTMLInMessagePane(in AString title, in AString body, in boolean clearMsgHdr);
void StopUrls();
void closeWindow();

Attributes

AttributeTypeDescription
windowCommandsnsIMsgWindowCommandsThis allows the backend code to send commands to the UI, such as clearMsgPane.
statusFeedbacknsIMsgStatusFeedbackThis allows the backend code to send status feedback to the UI.
msgHeaderSinknsIMsgHeaderSinkThis allows the backend code to send message header information to the UI.
transactionManagernsITransactionManagerThis is used to track undo/redo transactions.
openFoldernsIMsgFolderThis is used to track the folder currently open in the UI.
rootDocShellnsIDocShellThis is used to track the chrome window's nsIDocShell object. You don't normally need to set this, instead set the domWindow property instead.
messageWindowDocShellnsIDocShellReadonly: This retrieves the nsIDocShell object for the message pane. You should not store this in a global variable.
notificationCallbacksnsIInterfaceRequestorThese are currently used to set notification callbacks on protocol channels to handle things like bad cert exceptions.
promptDialognsIPromptReadonly: This is the equivalent of calling GetInterface on the rootDocShell object.
mailCharacterSetACStringThis is used to track the character set of the currently displayed message. If set to an alias, the actual character set is returned.
charsetOverridebooleanRemember the message's charset was overridden, so it can be inherited (e.g for quoting).
stoppedbooleanCheck if a running url been stopped. If you are checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it.
domWindownsIDOMWindowThe message window's global chrome window object. Set this to initialize the rootDocShell.

Methods

displayHTMLInMessagePane()

Loads the specified HTML in the message pane. This is equivalent to calling LoadURI on the nsIWebNavigation object with a data: URL specifying the HTML.

void displayHTMLInMessagePane(in AString title,
                              in AString body,
                              in boolean clearMsgHdr);
Parameters
title
Not used.
body
The HTML to display in the message pane. Note that the HTML is wrapped in <html> and <body> tags for you.
clearMsgHdr
Whether or not the existing message pane and header should be cleared before the HTML is displayed.

StopUrls()

This is equivalent to calling Stop(nsIWebNavigation::STOP_NETWORK) on the nsIWebNavigation object.

 void StopUrls();

closeWindow()

When the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. For some reason XPConnect is still hanging onto the message window even though all of our objects have let go of it. This forces a release. It clears out the content listener, the windowCommands, the statusFeedback and the docShell objects.

 void closeWindow();

Remarks

See also

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

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

发布评论

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

词条统计

浏览:126 次

字数:7726

最后编辑:7 年前

编辑次数:0 次

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