/gecko_sdk/idl/nsIWebBrowserChrome.idl
IDL | 159 lines | 42 code | 20 blank | 97 comment | 0 complexity | c8992dfef723a4f689e1d84f4a35bf27 MD5 | raw file
1/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 3 * ***** BEGIN LICENSE BLOCK ***** 4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 * 6 * The contents of this file are subject to the Mozilla Public License Version 7 * 1.1 (the "License"); you may not use this file except in compliance with 8 * the License. You may obtain a copy of the License at 9 * http://www.mozilla.org/MPL/ 10 * 11 * Software distributed under the License is distributed on an "AS IS" basis, 12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 13 * for the specific language governing rights and limitations under the 14 * License. 15 * 16 * The Original Code is the Mozilla browser. 17 * 18 * The Initial Developer of the Original Code is 19 * Netscape Communications, Inc. 20 * Portions created by the Initial Developer are Copyright (C) 1999 21 * the Initial Developer. All Rights Reserved. 22 * 23 * Contributor(s): 24 * Travis Bogard <travis@netscape.com> 25 * 26 * Alternatively, the contents of this file may be used under the terms of 27 * either the GNU General Public License Version 2 or later (the "GPL"), or 28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 29 * in which case the provisions of the GPL or the LGPL are applicable instead 30 * of those above. If you wish to allow use of your version of this file only 31 * under the terms of either the GPL or the LGPL, and not to allow others to 32 * use your version of this file under the terms of the MPL, indicate your 33 * decision by deleting the provisions above and replace them with the notice 34 * and other provisions required by the GPL or the LGPL. If you do not delete 35 * the provisions above, a recipient may use your version of this file under 36 * the terms of any one of the MPL, the GPL or the LGPL. 37 * 38 * ***** END LICENSE BLOCK ***** */ 39 40#include "nsISupports.idl" 41 42interface nsIWebBrowser; 43interface nsIDocShellTreeItem; 44 45/** 46 * nsIWebBrowserChrome corresponds to the top-level, outermost window 47 * containing an embedded Gecko web browser. 48 * 49 * @status FROZEN 50 */ 51 52[scriptable, uuid(BA434C60-9D52-11d3-AFB0-00A024FFC08C)] 53interface nsIWebBrowserChrome : nsISupports 54{ 55 const unsigned long STATUS_SCRIPT = 0x00000001; 56 const unsigned long STATUS_SCRIPT_DEFAULT = 0x00000002; 57 const unsigned long STATUS_LINK = 0x00000003; 58 59 /** 60 * Called when the status text in the chrome needs to be updated. 61 * @param statusType indicates what is setting the text 62 * @param status status string. null is an acceptable value meaning 63 * no status. 64 */ 65 void setStatus(in unsigned long statusType, in wstring status); 66 67 /** 68 * The currently loaded WebBrowser. The browser chrome may be 69 * told to set the WebBrowser object to a new object by setting this 70 * attribute. In this case the implementer is responsible for taking the 71 * new WebBrowser object and doing any necessary initialization or setup 72 * as if it had created the WebBrowser itself. This includes positioning 73 * setting up listeners etc. 74 */ 75 attribute nsIWebBrowser webBrowser; 76 77 /** 78 * Definitions for the chrome flags 79 */ 80 const unsigned long CHROME_DEFAULT = 0x00000001; 81 const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; 82 const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; 83 const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; 84 const unsigned long CHROME_MENUBAR = 0x00000010; 85 const unsigned long CHROME_TOOLBAR = 0x00000020; 86 const unsigned long CHROME_LOCATIONBAR = 0x00000040; 87 const unsigned long CHROME_STATUSBAR = 0x00000080; 88 const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; 89 const unsigned long CHROME_SCROLLBARS = 0x00000200; 90 const unsigned long CHROME_TITLEBAR = 0x00000400; 91 const unsigned long CHROME_EXTRA = 0x00000800; 92 93 // createBrowserWindow specific flags 94 const unsigned long CHROME_WITH_SIZE = 0x00001000; 95 const unsigned long CHROME_WITH_POSITION = 0x00002000; 96 97 // special cases 98 const unsigned long CHROME_WINDOW_MIN = 0x00004000; 99 const unsigned long CHROME_WINDOW_POPUP = 0x00008000; 100 101 const unsigned long CHROME_WINDOW_RAISED = 0x02000000; 102 const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; 103 const unsigned long CHROME_CENTER_SCREEN = 0x08000000; 104 105 // Make the new window dependent on the parent. This flag is only 106 // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be 107 // dependent. 108 const unsigned long CHROME_DEPENDENT = 0x10000000; 109 110 // Note: The modal style bit just affects the way the window looks and does 111 // mean it's actually modal. 112 const unsigned long CHROME_MODAL = 0x20000000; 113 const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; 114 const unsigned long CHROME_OPENAS_CHROME = 0x80000000; 115 116 const unsigned long CHROME_ALL = 0x00000ffe; 117 118 /** 119 * The chrome flags for this browser chrome. The implementation should 120 * reflect the value of this attribute by hiding or showing its chrome 121 * appropriately. 122 */ 123 attribute unsigned long chromeFlags; 124 125 /** 126 * Asks the implementer to destroy the window associated with this 127 * WebBrowser object. 128 */ 129 void destroyBrowserWindow(); 130 131 /** 132 * Tells the chrome to size itself such that the browser will be the 133 * specified size. 134 * @param aCX new width of the browser 135 * @param aCY new height of the browser 136 */ 137 void sizeBrowserTo(in long aCX, in long aCY); 138 139 /** 140 * Shows the window as a modal window. 141 * @return (the function error code) the status value specified by 142 * in exitModalEventLoop. 143 */ 144 void showAsModal(); 145 146 /** 147 * Is the window modal (that is, currently executing a modal loop)? 148 * @return true if it's a modal window 149 */ 150 boolean isWindowModal(); 151 152 /** 153 * Exit a modal event loop if we're in one. The implementation 154 * should also exit out of the loop if the window is destroyed. 155 * @param aStatus - the result code to return from showAsModal 156 */ 157 void exitModalEventLoop(in nsresult aStatus); 158}; 159