nsIXULWindow 编辑
xpfe/appshell/nsIXULWindow.idl
Scriptable 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
Attribute | Type | Description |
chromeFlags | PRUint32 | chromeFlags are from nsIWebBrowserChrome . |
contextFlags | PRUint32 | contextFlags are from nsIWindowCreator2 . |
docShell |
| The docshell owning the XUL for this window. Read only. |
intrinsicallySized | boolean | Indicates if this window is instrinsically sized. |
primaryContentShell |
| The primary content shell. Note: That this is adocshell 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. |
XULBrowserWindow |
| Provides access to the XULBrowserWindow object offering a way for the browser to update the user interface of the enclosing XUL window. |
zLevel | unsigned long | One of the Z level constants below. On some platforms, windows with a higher zLevel will be kept above windows with a lower zLevel. |
Constants
Constant | Value | Description |
lowestZ | 0 | |
loweredZ | 4 | The Z level of an independent window opened with the "alwaysLowered" chrome flag. |
normalZ | 5 | The default Z level of an independent window. |
raisedZ | 6 | The Z level of an independent window opened with the "alwaysRaised" chrome flag. |
highestZ | 9 |
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.
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. SeeaScreen
parameter for details. aScreen
true
tocenter
the window relative to the screen containingaRelative
ifaRelative
is notnull
. If aRelative isnull
then relative to the screen of the opener window if it was initialized by passing it tonsWebShellWindow::Initialize
. Failing that relative to the main screen.false
tocenter
it relative toaRelative
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
'sCreateTopLevelWindow
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 adocshell
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论