nsIDOMWindow.idl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Netscape Communications Corporation.
  19. * Portions created by the Initial Developer are Copyright (C) 2000
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. * Vidur Apparao <[email protected]> (original author)
  24. * Johnny Stenback <[email protected]>
  25. *
  26. * Alternatively, the contents of this file may be used under the terms of
  27. * either of the GNU General Public License Version 2 or later (the "GPL"),
  28. * or 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 "domstubs.idl"
  40. interface nsISelection;
  41. /**
  42. * The nsIDOMWindow interface is the primary interface for a DOM
  43. * window object. It represents a single window object that may
  44. * contain child windows if the document in the window contains a
  45. * HTML frameset document or if the document contains iframe elements.
  46. *
  47. * This interface is not officially defined by any standard bodies, it
  48. * originates from the defacto DOM Level 0 standard.
  49. *
  50. * @status FROZEN
  51. */
  52. [scriptable, uuid(a6cf906b-15b3-11d2-932e-00805f8add32)]
  53. interface nsIDOMWindow : nsISupports
  54. {
  55. /**
  56. * Accessor for the document in this window.
  57. */
  58. readonly attribute nsIDOMDocument document;
  59. /**
  60. * Accessor for this window's parent window, or the window itself if
  61. * there is no parent, or if the parent is of different type
  62. * (i.e. this does not cross chrome-content boundaries).
  63. */
  64. readonly attribute nsIDOMWindow parent;
  65. /**
  66. * Accessor for the root of this hierarchy of windows. This root may
  67. * be the window itself if there is no parent, or if the parent is
  68. * of different type (i.e. this does not cross chrome-content
  69. * boundaries).
  70. *
  71. * This property is "replaceable" in JavaScript */
  72. readonly attribute nsIDOMWindow top;
  73. /**
  74. * Accessor for the object that controls whether or not scrollbars
  75. * are shown in this window.
  76. *
  77. * This attribute is "replaceable" in JavaScript
  78. */
  79. readonly attribute nsIDOMBarProp scrollbars;
  80. /**
  81. * Accessor for the child windows in this window.
  82. */
  83. [noscript] readonly attribute nsIDOMWindowCollection frames;
  84. /**
  85. * Set/Get the name of this window.
  86. *
  87. * This attribute is "replaceable" in JavaScript
  88. */
  89. attribute DOMString name;
  90. /**
  91. * Set/Get the document scale factor as a multiplier on the default
  92. * size. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED
  93. * error may be returned by implementations not supporting
  94. * zoom. Implementations not supporting zoom should return 1.0 all
  95. * the time for the Get operation. 1.0 is equals normal size,
  96. * i.e. no zoom.
  97. */
  98. [noscript] attribute float textZoom;
  99. /**
  100. * Accessor for the current x scroll position in this window in
  101. * pixels.
  102. *
  103. * This attribute is "replaceable" in JavaScript
  104. */
  105. readonly attribute long scrollX;
  106. /**
  107. * Accessor for the current y scroll position in this window in
  108. * pixels.
  109. *
  110. * This attribute is "replaceable" in JavaScript
  111. */
  112. readonly attribute long scrollY;
  113. /**
  114. * Method for scrolling this window to an absolute pixel offset.
  115. */
  116. void scrollTo(in long xScroll, in long yScroll);
  117. /**
  118. * Method for scrolling this window to a pixel offset relative to
  119. * the current scroll position.
  120. */
  121. void scrollBy(in long xScrollDif, in long yScrollDif);
  122. /**
  123. * Method for accessing this window's selection object.
  124. */
  125. nsISelection getSelection();
  126. /**
  127. * Method for scrolling this window by a number of lines.
  128. */
  129. void scrollByLines(in long numLines);
  130. /**
  131. * Method for scrolling this window by a number of pages.
  132. */
  133. void scrollByPages(in long numPages);
  134. /**
  135. * Method for sizing this window to the content in the window.
  136. */
  137. void sizeToContent();
  138. };