1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/components/windowwatcher/public/nsPIWindowWatcher.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,93 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +/* Private "control" methods on the Window Watcher. These are annoying 1.11 + bookkeeping methods, not part of the public (embedding) interface. 1.12 +*/ 1.13 + 1.14 +#include "nsISupports.idl" 1.15 + 1.16 +interface nsIDOMWindow; 1.17 +interface nsISimpleEnumerator; 1.18 +interface nsIWebBrowserChrome; 1.19 +interface nsIDocShellTreeItem; 1.20 +interface nsIArray; 1.21 + 1.22 +[uuid(00788A84-152F-4BD8-A814-FD8EB545DB29)] 1.23 + 1.24 +interface nsPIWindowWatcher : nsISupports 1.25 +{ 1.26 + /** A window has been created. Add it to our list. 1.27 + @param aWindow the window to add 1.28 + @param aChrome the corresponding chrome window. The DOM window 1.29 + and chrome will be mapped together, and the corresponding 1.30 + chrome can be retrieved using the (not private) 1.31 + method getChromeForWindow. If null, any extant mapping 1.32 + will be cleared. 1.33 + */ 1.34 + void addWindow(in nsIDOMWindow aWindow, in nsIWebBrowserChrome aChrome); 1.35 + 1.36 + /** A window has been closed. Remove it from our list. 1.37 + @param aWindow the window to remove 1.38 + */ 1.39 + void removeWindow(in nsIDOMWindow aWindow); 1.40 + 1.41 + /** Like the public interface's open(), but can handle openDialog-style 1.42 + arguments and calls which shouldn't result in us navigating the window. 1.43 + 1.44 + @param aParent parent window, if any. Null if no parent. If it is 1.45 + impossible to get to an nsIWebBrowserChrome from aParent, this 1.46 + method will effectively act as if aParent were null. 1.47 + @param aURL url to which to open the new window. Must already be 1.48 + escaped, if applicable. can be null. 1.49 + @param aName window name from JS window.open. can be null. If a window 1.50 + with this name already exists, the openWindow call may just load 1.51 + aUrl in it (if aUrl is not null) and return it. 1.52 + @param aFeatures window features from JS window.open. can be null. 1.53 + @param aCalledFromScript true if we were called from script. 1.54 + @param aDialog use dialog defaults (see nsIDOMWindow::openDialog) 1.55 + @param aNavigate true if we should navigate the new window to the 1.56 + specified URL. 1.57 + @param aArgs Window argument 1.58 + @return the new window 1.59 + 1.60 + @note This method may examine the JS context stack for purposes of 1.61 + determining the security context to use for the search for a given 1.62 + window named aName. 1.63 + @note This method should try to set the default charset for the new 1.64 + window to the default charset of the document in the calling window 1.65 + (which is determined based on the JS stack and the value of 1.66 + aParent). This is not guaranteed, however. 1.67 + */ 1.68 + nsIDOMWindow openWindow2(in nsIDOMWindow aParent, in string aUrl, 1.69 + in string aName, in string aFeatures, 1.70 + in boolean aCalledFromScript, in boolean aDialog, 1.71 + in boolean aNavigate, in nsISupports aArgs); 1.72 + 1.73 + /** 1.74 + * Find a named docshell tree item amongst all windows registered 1.75 + * with the window watcher. This may be a subframe in some window, 1.76 + * for example. 1.77 + * 1.78 + * @param aName the name of the window. Must not be null. 1.79 + * @param aRequestor the tree item immediately making the request. 1.80 + * We should make sure to not recurse down into its findItemWithName 1.81 + * method. 1.82 + * @param aOriginalRequestor the original treeitem that made the request. 1.83 + * Used for security checks. 1.84 + * @return the tree item with aName as the name, or null if there 1.85 + * isn't one. "Special" names, like _self, _top, etc, will be 1.86 + * treated specially only if aRequestor is null; in that case they 1.87 + * will be resolved relative to the first window the windowwatcher 1.88 + * knows about. 1.89 + * @see findItemWithName methods on nsIDocShellTreeItem and 1.90 + * nsIDocShellTreeOwner 1.91 + */ 1.92 + nsIDocShellTreeItem findItemWithName(in wstring aName, 1.93 + in nsIDocShellTreeItem aRequestor, 1.94 + in nsIDocShellTreeItem aOriginalRequestor); 1.95 +}; 1.96 +