xpfe/appshell/public/nsIXULWindow.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:c2af9fdabcd3
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #include "nsISupports.idl"
8
9 /**
10 * The nsIXULWindow
11 *
12 * When the window is destroyed, it will fire a "xul-window-destroyed"
13 * notification through the global observer service.
14 */
15
16 interface nsIDocShell;
17 interface nsIDocShellTreeItem;
18 interface nsIXULBrowserWindow;
19
20 [scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)]
21 interface nsIXULWindow : nsISupports
22 {
23 /**
24 * The docshell owning the XUL for this window.
25 */
26 readonly attribute nsIDocShell docShell;
27
28 /**
29 * Indicates if this window is instrinsically sized.
30 */
31 attribute boolean intrinsicallySized;
32
33 /**
34 * The primary content shell.
35 *
36 * Note that this is a docshell tree item and therefore can not be assured of
37 * what object it is. It could be an editor, a docshell, or a browser object.
38 * Or down the road any other object that supports being a DocShellTreeItem
39 * Query accordingly to determine the capabilities.
40 */
41 readonly attribute nsIDocShellTreeItem primaryContentShell;
42
43 /**
44 * The content shell specified by the supplied id.
45 *
46 * Note that this is a docshell tree item and therefore can not be assured of
47 * what object it is. It could be an editor, a docshell, or a browser object.
48 * Or down the road any other object that supports being a DocShellTreeItem
49 * Query accordingly to determine the capabilities.
50 */
51 nsIDocShellTreeItem getContentShellById(in wstring ID);
52
53 /**
54 * Tell this window that it has picked up a child XUL window
55 * @param aChild the child window being added
56 */
57 void addChildWindow(in nsIXULWindow aChild);
58
59 /**
60 * Tell this window that it has lost a child XUL window
61 * @param aChild the child window being removed
62 */
63 void removeChildWindow(in nsIXULWindow aChild);
64
65 /**
66 * Move the window to a centered position.
67 * @param aRelative If not null, the window relative to which the window is
68 * moved. See aScreen parameter for details.
69 * @param aScreen PR_TRUE to center the window relative to the screen
70 * containing aRelative if aRelative is not null. If
71 * aRelative is null then relative to the screen of the
72 * opener window if it was initialized by passing it to
73 * nsWebShellWindow::Initialize. Failing that relative to
74 * the main screen.
75 * PR_FALSE to center it relative to aRelative itself.
76 * @param aAlert PR_TRUE to move the window to an alert position,
77 * generally centered horizontally and 1/3 down from the top.
78 */
79 void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert);
80
81 /**
82 * Shows the window as a modal window. That is, ensures that it is visible
83 * and runs a local event loop, exiting only once the window has been closed.
84 */
85 void showModal();
86
87 const unsigned long lowestZ = 0;
88 const unsigned long loweredZ = 4; /* "alwaysLowered" attribute */
89 const unsigned long normalZ = 5;
90 const unsigned long raisedZ = 6; /* "alwaysRaised" attribute */
91 const unsigned long highestZ = 9;
92
93 attribute unsigned long zLevel;
94
95 /**
96 * contextFlags are from nsIWindowCreator2
97 */
98 attribute uint32_t contextFlags;
99
100 attribute uint32_t chromeFlags;
101
102 /**
103 * Begin assuming |chromeFlags| don't change hereafter, and assert
104 * if they do change. The state change is one-way and idempotent.
105 */
106 void assumeChromeFlagsAreFrozen();
107
108 /**
109 * Create a new window.
110 * @param aChromeFlags see nsIWebBrowserChrome
111 * @return the newly minted window
112 */
113 nsIXULWindow createNewWindow(in int32_t aChromeFlags);
114
115 attribute nsIXULBrowserWindow XULBrowserWindow;
116
117 /**
118 * Back-door method to force application of chrome flags at a particular
119 * time. Do NOT call this unless you know what you're doing! In particular,
120 * calling this when this XUL window doesn't yet have a document in its
121 * docshell could cause problems.
122 */
123 [noscript] void applyChromeFlags();
124 };

mercurial