nsIWebBrowserChrome.idl 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 <[email protected]>
  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. #include "nsISupports.idl"
  40. interface nsIWebBrowser;
  41. interface nsIDocShellTreeItem;
  42. /**
  43. * nsIWebBrowserChrome corresponds to the top-level, outermost window
  44. * containing an embedded Gecko web browser.
  45. *
  46. * @status FROZEN
  47. */
  48. [scriptable, uuid(BA434C60-9D52-11d3-AFB0-00A024FFC08C)]
  49. interface nsIWebBrowserChrome : nsISupports
  50. {
  51. const unsigned long STATUS_SCRIPT = 0x00000001;
  52. const unsigned long STATUS_SCRIPT_DEFAULT = 0x00000002;
  53. const unsigned long STATUS_LINK = 0x00000003;
  54. /**
  55. * Called when the status text in the chrome needs to be updated.
  56. * @param statusType indicates what is setting the text
  57. * @param status status string. null is an acceptable value meaning
  58. * no status.
  59. */
  60. void setStatus(in unsigned long statusType, in wstring status);
  61. /**
  62. * The currently loaded WebBrowser. The browser chrome may be
  63. * told to set the WebBrowser object to a new object by setting this
  64. * attribute. In this case the implementer is responsible for taking the
  65. * new WebBrowser object and doing any necessary initialization or setup
  66. * as if it had created the WebBrowser itself. This includes positioning
  67. * setting up listeners etc.
  68. */
  69. attribute nsIWebBrowser webBrowser;
  70. /**
  71. * Definitions for the chrome flags
  72. */
  73. const unsigned long CHROME_DEFAULT = 0x00000001;
  74. const unsigned long CHROME_WINDOW_BORDERS = 0x00000002;
  75. const unsigned long CHROME_WINDOW_CLOSE = 0x00000004;
  76. const unsigned long CHROME_WINDOW_RESIZE = 0x00000008;
  77. const unsigned long CHROME_MENUBAR = 0x00000010;
  78. const unsigned long CHROME_TOOLBAR = 0x00000020;
  79. const unsigned long CHROME_LOCATIONBAR = 0x00000040;
  80. const unsigned long CHROME_STATUSBAR = 0x00000080;
  81. const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100;
  82. const unsigned long CHROME_SCROLLBARS = 0x00000200;
  83. const unsigned long CHROME_TITLEBAR = 0x00000400;
  84. const unsigned long CHROME_EXTRA = 0x00000800;
  85. // createBrowserWindow specific flags
  86. const unsigned long CHROME_WITH_SIZE = 0x00001000;
  87. const unsigned long CHROME_WITH_POSITION = 0x00002000;
  88. // special cases
  89. const unsigned long CHROME_WINDOW_MIN = 0x00004000;
  90. const unsigned long CHROME_WINDOW_POPUP = 0x00008000;
  91. const unsigned long CHROME_WINDOW_RAISED = 0x02000000;
  92. const unsigned long CHROME_WINDOW_LOWERED = 0x04000000;
  93. const unsigned long CHROME_CENTER_SCREEN = 0x08000000;
  94. const unsigned long CHROME_DEPENDENT = 0x10000000;
  95. // Note: The modal style bit just affects the way the window looks and does
  96. // mean it's actually modal.
  97. const unsigned long CHROME_MODAL = 0x20000000;
  98. const unsigned long CHROME_OPENAS_DIALOG = 0x40000000;
  99. const unsigned long CHROME_OPENAS_CHROME = 0x80000000;
  100. const unsigned long CHROME_ALL = 0x00000ffe;
  101. /**
  102. * The chrome flags for this browser chrome. The implementation should
  103. * reflect the value of this attribute by hiding or showing its chrome
  104. * appropriately.
  105. */
  106. attribute unsigned long chromeFlags;
  107. /**
  108. * Asks the implementer to destroy the window associated with this
  109. * WebBrowser object.
  110. */
  111. void destroyBrowserWindow();
  112. /**
  113. * Tells the chrome to size itself such that the browser will be the
  114. * specified size.
  115. * @param aCX new width of the browser
  116. * @param aCY new height of the browser
  117. */
  118. void sizeBrowserTo(in long aCX, in long aCY);
  119. /**
  120. * Shows the window as a modal window.
  121. * @return (the function error code) the status value specified by
  122. * in exitModalEventLoop.
  123. */
  124. void showAsModal();
  125. /**
  126. * Is the window modal (that is, currently executing a modal loop)?
  127. * @return true if it's a modal window
  128. */
  129. boolean isWindowModal();
  130. /**
  131. * Exit a modal event loop if we're in one. The implementation
  132. * should also exit out of the loop if the window is destroyed.
  133. * @param aStatus - the result code to return from showAsModal
  134. */
  135. void exitModalEventLoop(in nsresult aStatus);
  136. };