1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/embedding/browser/webBrowser/nsIWebBrowserChrome.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,148 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; 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 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIWebBrowser; 1.13 +interface nsIDocShellTreeItem; 1.14 + 1.15 +/** 1.16 + * nsIWebBrowserChrome corresponds to the top-level, outermost window 1.17 + * containing an embedded Gecko web browser. 1.18 + */ 1.19 + 1.20 +[scriptable, uuid(E8C414C4-DC38-4BA3-AB4E-EC4CBBE22907)] 1.21 +interface nsIWebBrowserChrome : nsISupports 1.22 +{ 1.23 + const unsigned long STATUS_SCRIPT = 0x00000001; 1.24 + const unsigned long STATUS_LINK = 0x00000003; 1.25 + 1.26 + /** 1.27 + * Called when the status text in the chrome needs to be updated. 1.28 + * @param statusType indicates what is setting the text 1.29 + * @param status status string. null is an acceptable value meaning 1.30 + * no status. 1.31 + */ 1.32 + void setStatus(in unsigned long statusType, in wstring status); 1.33 + 1.34 + /** 1.35 + * The currently loaded WebBrowser. The browser chrome may be 1.36 + * told to set the WebBrowser object to a new object by setting this 1.37 + * attribute. In this case the implementer is responsible for taking the 1.38 + * new WebBrowser object and doing any necessary initialization or setup 1.39 + * as if it had created the WebBrowser itself. This includes positioning 1.40 + * setting up listeners etc. 1.41 + */ 1.42 + attribute nsIWebBrowser webBrowser; 1.43 + 1.44 + /** 1.45 + * Definitions for the chrome flags 1.46 + */ 1.47 + const unsigned long CHROME_DEFAULT = 0x00000001; 1.48 + const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; 1.49 + const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; 1.50 + const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; 1.51 + const unsigned long CHROME_MENUBAR = 0x00000010; 1.52 + const unsigned long CHROME_TOOLBAR = 0x00000020; 1.53 + const unsigned long CHROME_LOCATIONBAR = 0x00000040; 1.54 + const unsigned long CHROME_STATUSBAR = 0x00000080; 1.55 + const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; 1.56 + const unsigned long CHROME_SCROLLBARS = 0x00000200; 1.57 + const unsigned long CHROME_TITLEBAR = 0x00000400; 1.58 + const unsigned long CHROME_EXTRA = 0x00000800; 1.59 + 1.60 + // createBrowserWindow specific flags 1.61 + const unsigned long CHROME_WITH_SIZE = 0x00001000; 1.62 + const unsigned long CHROME_WITH_POSITION = 0x00002000; 1.63 + 1.64 + // special cases 1.65 + const unsigned long CHROME_WINDOW_MIN = 0x00004000; 1.66 + const unsigned long CHROME_WINDOW_POPUP = 0x00008000; 1.67 + 1.68 + // whether to open a new private window. CHROME_NON_PRIVATE_WINDOW 1.69 + // forces the opened window to be non-private, and overrides 1.70 + // CHROME_PRIVATE_WINDOW if it's set. CHROME_PRIVATE_WINDOW 1.71 + // forces the opened window to be private. If neither of these 1.72 + // flags are specified, the opened window will inherit the privacy 1.73 + // status of its opener. If there is no opener window, the new 1.74 + // window will be non-private. 1.75 + // 1.76 + // CHROME_PRIVATE_LIFETIME causes the docshell to affect private-browsing 1.77 + // session lifetime. This flag is currently respected only for remote 1.78 + // docshells. 1.79 + const unsigned long CHROME_PRIVATE_WINDOW = 0x00010000; 1.80 + const unsigned long CHROME_NON_PRIVATE_WINDOW = 0x00020000; 1.81 + const unsigned long CHROME_PRIVATE_LIFETIME = 0x00040000; 1.82 + 1.83 + // Whether this was opened by nsGlobalWindow::ShowModalDialog. 1.84 + const unsigned long CHROME_MODAL_CONTENT_WINDOW = 0x00080000; 1.85 + 1.86 + // Whether this window should use remote (out-of-process) tabs. 1.87 + const unsigned long CHROME_REMOTE_WINDOW = 0x00100000; 1.88 + 1.89 + // Prevents new window animations on Mac OS X Lion. Ignored on other 1.90 + // platforms. 1.91 + const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000; 1.92 + 1.93 + const unsigned long CHROME_WINDOW_RAISED = 0x02000000; 1.94 + const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; 1.95 + const unsigned long CHROME_CENTER_SCREEN = 0x08000000; 1.96 + 1.97 + // Make the new window dependent on the parent. This flag is only 1.98 + // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be 1.99 + // dependent. 1.100 + const unsigned long CHROME_DEPENDENT = 0x10000000; 1.101 + 1.102 + // Note: The modal style bit just affects the way the window looks and does 1.103 + // mean it's actually modal. 1.104 + const unsigned long CHROME_MODAL = 0x20000000; 1.105 + const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; 1.106 + const unsigned long CHROME_OPENAS_CHROME = 0x80000000; 1.107 + 1.108 + const unsigned long CHROME_ALL = 0x00000ffe; 1.109 + 1.110 + /** 1.111 + * The chrome flags for this browser chrome. The implementation should 1.112 + * reflect the value of this attribute by hiding or showing its chrome 1.113 + * appropriately. 1.114 + */ 1.115 + attribute unsigned long chromeFlags; 1.116 + 1.117 + /** 1.118 + * Asks the implementer to destroy the window associated with this 1.119 + * WebBrowser object. 1.120 + */ 1.121 + void destroyBrowserWindow(); 1.122 + 1.123 + /** 1.124 + * Tells the chrome to size itself such that the browser will be the 1.125 + * specified size. 1.126 + * @param aCX new width of the browser 1.127 + * @param aCY new height of the browser 1.128 + */ 1.129 + void sizeBrowserTo(in long aCX, in long aCY); 1.130 + 1.131 + /** 1.132 + * Shows the window as a modal window. 1.133 + * @return (the function error code) the status value specified by 1.134 + * in exitModalEventLoop. 1.135 + */ 1.136 + void showAsModal(); 1.137 + 1.138 + /** 1.139 + * Is the window modal (that is, currently executing a modal loop)? 1.140 + * @return true if it's a modal window 1.141 + */ 1.142 + boolean isWindowModal(); 1.143 + 1.144 + /** 1.145 + * Exit a modal event loop if we're in one. The implementation 1.146 + * should also exit out of the loop if the window is destroyed. 1.147 + * @param aStatus - the result code to return from showAsModal 1.148 + */ 1.149 + void exitModalEventLoop(in nsresult aStatus); 1.150 +}; 1.151 +