nsIMsgWindow

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

Attribute Type Description
windowCommands nsIMsgWindowCommands This allows the backend code to send commands to the UI, such as clearMsgPane.
statusFeedback nsIMsgStatusFeedback This allows the backend code to send status feedback to the UI.
msgHeaderSink nsIMsgHeaderSink This allows the backend code to send message header information to the UI.
transactionManager nsITransactionManager This is used to track undo/redo transactions.
openFolder nsIMsgFolder This is used to track the folder currently open in the UI.
rootDocShell nsIDocShell This is used to track the chrome window's nsIDocShell object. You don't normally need to set this, instead set the domWindow property instead.
messageWindowDocShell nsIDocShell Readonly: This retrieves the nsIDocShell object for the message pane. You should not store this in a global variable.
notificationCallbacks nsIInterfaceRequestor These are currently used to set notification callbacks on protocol channels to handle things like bad cert exceptions.
promptDialog nsIPrompt Readonly: This is the equivalent of calling GetInterface on the rootDocShell object.
mailCharacterSet ACString This is used to track the character set of the currently displayed message. If set to an alias, the actual character set is returned.
charsetOverride boolean Remember the message's charset was overridden, so it can be inherited (e.g for quoting).
stopped boolean Check 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.
domWindow nsIDOMWindow The 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

Document Tags and Contributors

 Contributors to this page: Sheppy, jswisher, Neil, Wjjohnst
 Last updated by: Sheppy,