michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIWebBrowser; michael@0: interface nsIDocShellTreeItem; michael@0: michael@0: /** michael@0: * nsIWebBrowserChrome corresponds to the top-level, outermost window michael@0: * containing an embedded Gecko web browser. michael@0: */ michael@0: michael@0: [scriptable, uuid(E8C414C4-DC38-4BA3-AB4E-EC4CBBE22907)] michael@0: interface nsIWebBrowserChrome : nsISupports michael@0: { michael@0: const unsigned long STATUS_SCRIPT = 0x00000001; michael@0: const unsigned long STATUS_LINK = 0x00000003; michael@0: michael@0: /** michael@0: * Called when the status text in the chrome needs to be updated. michael@0: * @param statusType indicates what is setting the text michael@0: * @param status status string. null is an acceptable value meaning michael@0: * no status. michael@0: */ michael@0: void setStatus(in unsigned long statusType, in wstring status); michael@0: michael@0: /** michael@0: * The currently loaded WebBrowser. The browser chrome may be michael@0: * told to set the WebBrowser object to a new object by setting this michael@0: * attribute. In this case the implementer is responsible for taking the michael@0: * new WebBrowser object and doing any necessary initialization or setup michael@0: * as if it had created the WebBrowser itself. This includes positioning michael@0: * setting up listeners etc. michael@0: */ michael@0: attribute nsIWebBrowser webBrowser; michael@0: michael@0: /** michael@0: * Definitions for the chrome flags michael@0: */ michael@0: const unsigned long CHROME_DEFAULT = 0x00000001; michael@0: const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; michael@0: const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; michael@0: const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; michael@0: const unsigned long CHROME_MENUBAR = 0x00000010; michael@0: const unsigned long CHROME_TOOLBAR = 0x00000020; michael@0: const unsigned long CHROME_LOCATIONBAR = 0x00000040; michael@0: const unsigned long CHROME_STATUSBAR = 0x00000080; michael@0: const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; michael@0: const unsigned long CHROME_SCROLLBARS = 0x00000200; michael@0: const unsigned long CHROME_TITLEBAR = 0x00000400; michael@0: const unsigned long CHROME_EXTRA = 0x00000800; michael@0: michael@0: // createBrowserWindow specific flags michael@0: const unsigned long CHROME_WITH_SIZE = 0x00001000; michael@0: const unsigned long CHROME_WITH_POSITION = 0x00002000; michael@0: michael@0: // special cases michael@0: const unsigned long CHROME_WINDOW_MIN = 0x00004000; michael@0: const unsigned long CHROME_WINDOW_POPUP = 0x00008000; michael@0: michael@0: // whether to open a new private window. CHROME_NON_PRIVATE_WINDOW michael@0: // forces the opened window to be non-private, and overrides michael@0: // CHROME_PRIVATE_WINDOW if it's set. CHROME_PRIVATE_WINDOW michael@0: // forces the opened window to be private. If neither of these michael@0: // flags are specified, the opened window will inherit the privacy michael@0: // status of its opener. If there is no opener window, the new michael@0: // window will be non-private. michael@0: // michael@0: // CHROME_PRIVATE_LIFETIME causes the docshell to affect private-browsing michael@0: // session lifetime. This flag is currently respected only for remote michael@0: // docshells. michael@0: const unsigned long CHROME_PRIVATE_WINDOW = 0x00010000; michael@0: const unsigned long CHROME_NON_PRIVATE_WINDOW = 0x00020000; michael@0: const unsigned long CHROME_PRIVATE_LIFETIME = 0x00040000; michael@0: michael@0: // Whether this was opened by nsGlobalWindow::ShowModalDialog. michael@0: const unsigned long CHROME_MODAL_CONTENT_WINDOW = 0x00080000; michael@0: michael@0: // Whether this window should use remote (out-of-process) tabs. michael@0: const unsigned long CHROME_REMOTE_WINDOW = 0x00100000; michael@0: michael@0: // Prevents new window animations on Mac OS X Lion. Ignored on other michael@0: // platforms. michael@0: const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000; michael@0: michael@0: const unsigned long CHROME_WINDOW_RAISED = 0x02000000; michael@0: const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; michael@0: const unsigned long CHROME_CENTER_SCREEN = 0x08000000; michael@0: michael@0: // Make the new window dependent on the parent. This flag is only michael@0: // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be michael@0: // dependent. michael@0: const unsigned long CHROME_DEPENDENT = 0x10000000; michael@0: michael@0: // Note: The modal style bit just affects the way the window looks and does michael@0: // mean it's actually modal. michael@0: const unsigned long CHROME_MODAL = 0x20000000; michael@0: const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; michael@0: const unsigned long CHROME_OPENAS_CHROME = 0x80000000; michael@0: michael@0: const unsigned long CHROME_ALL = 0x00000ffe; michael@0: michael@0: /** michael@0: * The chrome flags for this browser chrome. The implementation should michael@0: * reflect the value of this attribute by hiding or showing its chrome michael@0: * appropriately. michael@0: */ michael@0: attribute unsigned long chromeFlags; michael@0: michael@0: /** michael@0: * Asks the implementer to destroy the window associated with this michael@0: * WebBrowser object. michael@0: */ michael@0: void destroyBrowserWindow(); michael@0: michael@0: /** michael@0: * Tells the chrome to size itself such that the browser will be the michael@0: * specified size. michael@0: * @param aCX new width of the browser michael@0: * @param aCY new height of the browser michael@0: */ michael@0: void sizeBrowserTo(in long aCX, in long aCY); michael@0: michael@0: /** michael@0: * Shows the window as a modal window. michael@0: * @return (the function error code) the status value specified by michael@0: * in exitModalEventLoop. michael@0: */ michael@0: void showAsModal(); michael@0: michael@0: /** michael@0: * Is the window modal (that is, currently executing a modal loop)? michael@0: * @return true if it's a modal window michael@0: */ michael@0: boolean isWindowModal(); michael@0: michael@0: /** michael@0: * Exit a modal event loop if we're in one. The implementation michael@0: * should also exit out of the loop if the window is destroyed. michael@0: * @param aStatus - the result code to return from showAsModal michael@0: */ michael@0: void exitModalEventLoop(in nsresult aStatus); michael@0: }; michael@0: