nsIXULWindow 编辑

xpfe/appshell/nsIXULWindow.idlScriptable Please add a summary to this article. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

An nsIXULWindow is created as part of the creation of a top-level chrome window. When the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer service. This signals the application in case it needs to quit.

Method overview

void addChildWindow(in nsIXULWindow aChild);
void applyChromeFlags(); Native code only!
void assumeChromeFlagsAreFrozen();
void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert);
nsIXULWindow createNewWindow(in PRInt32 aChromeFlags, in nsIAppShell aAppShell);
nsIDocShellTreeItem getContentShellById(in wstring ID);
void removeChildWindow(in nsIXULWindow aChild);
void showModal();

Attributes

AttributeTypeDescription
chromeFlagsPRUint32chromeFlags are from nsIWebBrowserChrome.
contextFlagsPRUint32contextFlags are from nsIWindowCreator2.
docShellnsIDocShellThe docshell owning the XUL for this window. Read only.
intrinsicallySizedbooleanIndicates if this window is instrinsically sized.
primaryContentShellnsIDocShellTreeItem

The primary content shell.

Note: That this is a docshell tree item and therefore can not be assured of what object it is. It could be an editor, a docshell, or a browser object. Or down the road any other object that supports being a DocShellTreeItem Query accordingly to determine the capabilities. Read only.
XULBrowserWindownsIXULBrowserWindow Provides access to the XULBrowserWindow object offering a way for the browser to update the user interface of the enclosing XUL window.
zLevelunsigned longOne of the Z level constants below. On some platforms, windows with a higher zLevel will be kept above windows with a lower zLevel.

Constants

ConstantValueDescription
lowestZ0 
loweredZ4The Z level of an independent window opened with the "alwaysLowered" chrome flag.
normalZ5The default Z level of an independent window.
raisedZ6The Z level of an independent window opened with the "alwaysRaised" chrome flag.
highestZ9 

Methods

addChildWindow()

Tell this window that it has picked up a child XUL window.Note that XUL windows do not currently track child XUL windows.

void addChildWindow(
  in nsIXULWindow aChild
);
Parameters
aChild
The child window being added.
Native code only!

applyChromeFlags

Back-door method to force application of chrome flags at a particular time. Do NOT call this unless you know what you are doing! In particular, calling this when this XUL window does not yet have a document in its docshell could cause problems.

void applyChromeFlags();
Parameters

None.

assumeChromeFlagsAreFrozen()

Begin assuming chromeFlags do not change hereafter, and assert if they do change. The state change is one-way and idempotent.

void assumeChromeFlagsAreFrozen();
Parameters

None.

center()

Move the window to a centered position.

void center(
  in nsIXULWindow aRelative,
  in boolean aScreen,
  in boolean aAlert
);
Parameters
aRelative
If not null, the window relative to which the window is moved. See aScreen parameter for details.
aScreen
true to center the window relative to the screen containing aRelative if aRelative is not null. If aRelative is null then relative to the screen of the opener window if it was initialized by passing it to nsWebShellWindow::Initialize. Failing that relative to the main screen. false to center it relative to aRelative itself (aRelative must be set in this case.)
aAlert
true to move the window to an alert position, generally centered horizontally and 1/3 down from the top.

createNewWindow()

Create a new window.

nsIXULWindow createNewWindow(
  in PRInt32 aChromeFlags,
  in nsIAppShell aAppShell
);
Parameters
aChromeFlags
See nsIWebBrowserChrome.
aAppShell
The app shell passed to nsIAppShellService's CreateTopLevelWindow method.
Return value

The newly minted window. In the case of a content window, the function creates a browser window and waits for it to load. You can then load a document into the window's primary content shell.

getContentShellById()

The content shell specified by the supplied id.

Note: That this is a docshell tree item and therefore can not be assured of what object it is. It could be an editor, a docshell, or a browser object. Or down the road any other object that supports being a DocShellTreeItem Query accordingly to determine the capabilities.
nsIDocShellTreeItem getContentShellById(
  in wstring ID
);
Parameters
ID
The ID of the content shell, which is the same as the "type" attribute on the containing frame element.
Return value

The tree item corresponding to the given ID, if any.

removeChildWindow()

Tell this window that it has lost a child XUL window. Note that XUL windows do not currently track child XUL windows.

void removeChildWindow(
  in nsIXULWindow aChild
);
Parameters
aChild
The child window being removed.

showModal()

Shows the window as a modal window. That is, ensures that it is visible and runs a local event loop, exiting only once the window has been closed.

void showModal();
Parameters

None.

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

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

发布评论

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

词条统计

浏览:29 次

字数:10924

最后编辑:7 年前

编辑次数:0 次

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