|
1 /* -*- Mode: C++; tab-width: 2; 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 /* Private "control" methods on the Window Watcher. These are annoying |
|
8 bookkeeping methods, not part of the public (embedding) interface. |
|
9 */ |
|
10 |
|
11 #include "nsISupports.idl" |
|
12 |
|
13 interface nsIDOMWindow; |
|
14 interface nsISimpleEnumerator; |
|
15 interface nsIWebBrowserChrome; |
|
16 interface nsIDocShellTreeItem; |
|
17 interface nsIArray; |
|
18 |
|
19 [uuid(00788A84-152F-4BD8-A814-FD8EB545DB29)] |
|
20 |
|
21 interface nsPIWindowWatcher : nsISupports |
|
22 { |
|
23 /** A window has been created. Add it to our list. |
|
24 @param aWindow the window to add |
|
25 @param aChrome the corresponding chrome window. The DOM window |
|
26 and chrome will be mapped together, and the corresponding |
|
27 chrome can be retrieved using the (not private) |
|
28 method getChromeForWindow. If null, any extant mapping |
|
29 will be cleared. |
|
30 */ |
|
31 void addWindow(in nsIDOMWindow aWindow, in nsIWebBrowserChrome aChrome); |
|
32 |
|
33 /** A window has been closed. Remove it from our list. |
|
34 @param aWindow the window to remove |
|
35 */ |
|
36 void removeWindow(in nsIDOMWindow aWindow); |
|
37 |
|
38 /** Like the public interface's open(), but can handle openDialog-style |
|
39 arguments and calls which shouldn't result in us navigating the window. |
|
40 |
|
41 @param aParent parent window, if any. Null if no parent. If it is |
|
42 impossible to get to an nsIWebBrowserChrome from aParent, this |
|
43 method will effectively act as if aParent were null. |
|
44 @param aURL url to which to open the new window. Must already be |
|
45 escaped, if applicable. can be null. |
|
46 @param aName window name from JS window.open. can be null. If a window |
|
47 with this name already exists, the openWindow call may just load |
|
48 aUrl in it (if aUrl is not null) and return it. |
|
49 @param aFeatures window features from JS window.open. can be null. |
|
50 @param aCalledFromScript true if we were called from script. |
|
51 @param aDialog use dialog defaults (see nsIDOMWindow::openDialog) |
|
52 @param aNavigate true if we should navigate the new window to the |
|
53 specified URL. |
|
54 @param aArgs Window argument |
|
55 @return the new window |
|
56 |
|
57 @note This method may examine the JS context stack for purposes of |
|
58 determining the security context to use for the search for a given |
|
59 window named aName. |
|
60 @note This method should try to set the default charset for the new |
|
61 window to the default charset of the document in the calling window |
|
62 (which is determined based on the JS stack and the value of |
|
63 aParent). This is not guaranteed, however. |
|
64 */ |
|
65 nsIDOMWindow openWindow2(in nsIDOMWindow aParent, in string aUrl, |
|
66 in string aName, in string aFeatures, |
|
67 in boolean aCalledFromScript, in boolean aDialog, |
|
68 in boolean aNavigate, in nsISupports aArgs); |
|
69 |
|
70 /** |
|
71 * Find a named docshell tree item amongst all windows registered |
|
72 * with the window watcher. This may be a subframe in some window, |
|
73 * for example. |
|
74 * |
|
75 * @param aName the name of the window. Must not be null. |
|
76 * @param aRequestor the tree item immediately making the request. |
|
77 * We should make sure to not recurse down into its findItemWithName |
|
78 * method. |
|
79 * @param aOriginalRequestor the original treeitem that made the request. |
|
80 * Used for security checks. |
|
81 * @return the tree item with aName as the name, or null if there |
|
82 * isn't one. "Special" names, like _self, _top, etc, will be |
|
83 * treated specially only if aRequestor is null; in that case they |
|
84 * will be resolved relative to the first window the windowwatcher |
|
85 * knows about. |
|
86 * @see findItemWithName methods on nsIDocShellTreeItem and |
|
87 * nsIDocShellTreeOwner |
|
88 */ |
|
89 nsIDocShellTreeItem findItemWithName(in wstring aName, |
|
90 in nsIDocShellTreeItem aRequestor, |
|
91 in nsIDocShellTreeItem aOriginalRequestor); |
|
92 }; |
|
93 |