DOMWindow.hx 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. /*
  2. * Copyright (C)2005-2013 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated, do not edit!
  23. package js.html;
  24. /** <p>This section provides a brief reference for all of the methods, properties, and events available through the DOM <code>window</code> object. The <code>window</code> object implements the <code>Window</code> interface, which in turn inherits from the <code><a class="external" rel="external" href="http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView" title="http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView" target="_blank">AbstractView</a></code> interface. Some additional global functions, namespaces objects, and constructors, not typically associated with the window, but available on it, are listed in the <a title="https://developer.mozilla.org/en/JavaScript/Reference" rel="internal" href="https://developer.mozilla.org/en/JavaScript/Reference">JavaScript Reference</a>.</p>
  25. <p>The <code>window</code> object represents the window itself. The <code>document</code> property of a <code>window</code> points to the <a title="en/DOM/document" rel="internal" href="/api/js/html/Document">DOM document</a> loaded in that window. A window for a given document can be obtained using the <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/document.defaultView">document.defaultView</a></code>
  26. property.</p>
  27. <p>In a tabbed browser, such as Firefox, each tab contains its own <code>window</code> object (and if you're writing an extension, the browser window itself is a separate window too - see <a title="en/Working_with_windows_in_chrome_code#Content_windows" rel="internal" href="https://developer.mozilla.org/en/Working_with_windows_in_chrome_code#Content_windows">Working with windows in chrome code</a> for more information). That is, the <code>window</code> object is not shared between tabs in the same window. Some methods, namely <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.resizeTo">window.resizeTo</a></code>
  28. and <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.resizeBy">window.resizeBy</a></code>
  29. apply to the whole window and not to the specific tab the <code>window</code> object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.</p><br><br>
  30. Documentation for this class was provided by <a href="https://developer.mozilla.org/en/DOM/window">MDN</a>. */
  31. @:native("Window")
  32. extern class DOMWindow extends EventTarget
  33. {
  34. static inline var PERSISTENT : Int = 1;
  35. static inline var TEMPORARY : Int = 0;
  36. /** An <code><a rel="custom" href="https://developer.mozilla.org/en/nsIDOMOfflineResourceList">nsIDOMOfflineResourceList</a></code>
  37. object providing access to the offline resources for the window. */
  38. var applicationCache(default,null) : DOMApplicationCache;
  39. var clientInformation(default,null) : Navigator;
  40. /** <dd>This property indicates whether the current window is closed or not.</dd> <dt><a title="en/Components_object" rel="internal" href="https://developer.mozilla.org/en/Components_object">window.Components</a></dt> <dd>The entry point to many <a title="en/XPCOM" rel="internal" href="https://developer.mozilla.org/en/XPCOM">XPCOM</a> features. Some properties, e.g. <a title="en/Components.classes" rel="internal" href="https://developer.mozilla.org/en/Components.classes">classes</a>, are only available to sufficiently privileged code.</dd> */
  41. var closed(default,null) : Bool;
  42. var console(default,null) : Console;
  43. /** Returns the browser crypto object. */
  44. var crypto(default,null) : Crypto;
  45. /** Gets/sets the status bar text for the given window. */
  46. var defaultStatus : String;
  47. var defaultstatus : String;
  48. var devicePixelRatio(default,null) : Float;
  49. /** Returns a reference to the document that the window contains. */
  50. var document(default,null) : Document;
  51. var event(default,null) : Event;
  52. /** Returns the element in which the window is embedded, or null if the window is not embedded. */
  53. var frameElement(default,null) : Element;
  54. /** Returns an array of the subframes in the current window. */
  55. var frames(default,null) : DOMWindow;
  56. /** Returns a reference to the history object. */
  57. var history(default,null) : History;
  58. var indexedDB(default,null) : js.html.idb.Factory;
  59. /** Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar. */
  60. var innerHeight(default,null) : Int;
  61. /** Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar. */
  62. var innerWidth(default,null) : Int;
  63. /** Returns the number of frames in the window. See also <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.frames">window.frames</a></code>
  64. . */
  65. var length(default,null) : Int;
  66. /** Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it. Getter throws DOMException. */
  67. var localStorage(default,null) : Storage;
  68. /** Gets/sets the location, or current URL, of the window object. */
  69. var location : Location;
  70. /** Returns the locationbar object, whose visibility can be toggled in the window. */
  71. var locationbar(default,null) : BarInfo;
  72. /** Returns the menubar object, whose visibility can be toggled in the window. */
  73. var menubar(default,null) : BarInfo;
  74. /** Gets/sets the name of the window. */
  75. var name : String;
  76. /** Returns a reference to the navigator object. */
  77. var navigator(default,null) : Navigator;
  78. var notifications(default,null) : NotificationCenter;
  79. var offscreenBuffering(default,null) : Bool;
  80. /** An event handler property for abort events on the window. */
  81. var onabort : EventListener;
  82. var onanimationend : EventListener;
  83. var onanimationiteration : EventListener;
  84. var onanimationstart : EventListener;
  85. /** An event handler property for before-unload events on the window. */
  86. var onbeforeunload : EventListener;
  87. /** An event handler property for blur events on the window. */
  88. var onblur : EventListener;
  89. var oncanplay : EventListener;
  90. var oncanplaythrough : EventListener;
  91. /** An event handler property for change events on the window. */
  92. var onchange : EventListener;
  93. /** An event handler property for click events on the window. */
  94. var onclick : EventListener;
  95. /** An event handler property for right-click events on the window. */
  96. var oncontextmenu : EventListener;
  97. var ondblclick : EventListener;
  98. var ondevicemotion : EventListener;
  99. var ondeviceorientation : EventListener;
  100. var ondrag : EventListener;
  101. var ondragend : EventListener;
  102. var ondragenter : EventListener;
  103. var ondragleave : EventListener;
  104. var ondragover : EventListener;
  105. var ondragstart : EventListener;
  106. var ondrop : EventListener;
  107. var ondurationchange : EventListener;
  108. var onemptied : EventListener;
  109. var onended : EventListener;
  110. /** An event handler property for errors raised on the window. */
  111. var onerror : EventListener;
  112. /** An event handler property for focus events on the window. */
  113. var onfocus : EventListener;
  114. /** An event handler property for hash change events on the window; called when the part of the URL after the hash mark ("#") changes. */
  115. var onhashchange : EventListener;
  116. var oninput : EventListener;
  117. var oninvalid : EventListener;
  118. /** An event handler property for keydown events on the window. */
  119. var onkeydown : EventListener;
  120. /** An event handler property for keypress events on the window. */
  121. var onkeypress : EventListener;
  122. /** An event handler property for keyup events on the window. */
  123. var onkeyup : EventListener;
  124. /** An event handler property for window loading. */
  125. var onload : EventListener;
  126. var onloadeddata : EventListener;
  127. var onloadedmetadata : EventListener;
  128. var onloadstart : EventListener;
  129. var onmessage : EventListener;
  130. /** An event handler property for mousedown events on the window. */
  131. var onmousedown : EventListener;
  132. /** An event handler property for mousemove events on the window. */
  133. var onmousemove : EventListener;
  134. /** An event handler property for mouseout events on the window. */
  135. var onmouseout : EventListener;
  136. /** An event handler property for mouseover events on the window. */
  137. var onmouseover : EventListener;
  138. /** An event handler property for mouseup events on the window. */
  139. var onmouseup : EventListener;
  140. var onmousewheel : EventListener;
  141. var onoffline : EventListener;
  142. var ononline : EventListener;
  143. /** An event handler property for pagehide events on the window. */
  144. var onpagehide : EventListener;
  145. /** An event handler property for pageshow events on the window. */
  146. var onpageshow : EventListener;
  147. var onpause : EventListener;
  148. var onplay : EventListener;
  149. var onplaying : EventListener;
  150. /** An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object. */
  151. var onpopstate : EventListener;
  152. var onprogress : EventListener;
  153. var onratechange : EventListener;
  154. /** An event handler property for reset events on the window. */
  155. var onreset : EventListener;
  156. /** An event handler property for window resizing. */
  157. var onresize : EventListener;
  158. /** An event handler property for window scrolling. */
  159. var onscroll : EventListener;
  160. var onsearch : EventListener;
  161. var onseeked : EventListener;
  162. var onseeking : EventListener;
  163. /** An event handler property for window selection. */
  164. var onselect : EventListener;
  165. var onstalled : EventListener;
  166. var onstorage : EventListener;
  167. /** An event handler property for submits on window forms. */
  168. var onsubmit : EventListener;
  169. var onsuspend : EventListener;
  170. var ontimeupdate : EventListener;
  171. var ontouchcancel : EventListener;
  172. var ontouchend : EventListener;
  173. var ontouchmove : EventListener;
  174. var ontouchstart : EventListener;
  175. var ontransitionend : EventListener;
  176. /** An event handler property for unload events on the window. */
  177. var onunload : EventListener;
  178. var onvolumechange : EventListener;
  179. var onwaiting : EventListener;
  180. /** Returns a reference to the window that opened this current window. */
  181. var opener(default,null) : DOMWindow;
  182. /** Gets the height of the outside of the browser window. */
  183. var outerHeight(default,null) : Int;
  184. /** Gets the width of the outside of the browser window. */
  185. var outerWidth(default,null) : Int;
  186. var pagePopupController(default,null) : PagePopupController;
  187. /** An alias for <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.scrollX">window.scrollX</a></code>
  188. . */
  189. var pageXOffset(default,null) : Int;
  190. /** An alias for <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.scrollY">window.scrollY</a></code> */
  191. var pageYOffset(default,null) : Int;
  192. /** Returns a reference to the parent of the current window or subframe. */
  193. var parent(default,null) : DOMWindow;
  194. var performance(default,null) : Performance;
  195. /** Returns the personalbar object, whose visibility can be toggled in the window. */
  196. var personalbar(default,null) : BarInfo;
  197. /** Returns a reference to the screen object associated with the window. */
  198. var screen(default,null) : Screen;
  199. var screenLeft(default,null) : Int;
  200. var screenTop(default,null) : Int;
  201. /** Returns the horizontal distance of the left border of the user's browser from the left side of the screen. */
  202. var screenX(default,null) : Int;
  203. /** Returns the vertical distance of the top border of the user's browser from the top side of the screen. */
  204. var screenY(default,null) : Int;
  205. /** Returns the number of pixels that the document has already been scrolled horizontally. */
  206. var scrollX(default,null) : Int;
  207. /** Returns the number of pixels that the document has already been scrolled vertically. */
  208. var scrollY(default,null) : Int;
  209. /** Returns the scrollbars object, whose visibility can be toggled in the window. */
  210. var scrollbars(default,null) : BarInfo;
  211. /** Returns an object reference to the window object itself. */
  212. var self(default,null) : DOMWindow;
  213. /** A storage object for storing data within a single page session. Getter throws DOMException. */
  214. var sessionStorage(default,null) : Storage;
  215. /** Gets/sets the text in the statusbar at the bottom of the browser. */
  216. var status : String;
  217. /** Returns the statusbar object, whose visibility can be toggled in the window. */
  218. var statusbar(default,null) : BarInfo;
  219. var storageInfo(default,null) : StorageInfo;
  220. var styleMedia(default,null) : StyleMedia;
  221. /** Returns the toolbar object, whose visibility can be toggled in the window. */
  222. var toolbar(default,null) : BarInfo;
  223. /** <dd>Returns a reference to the topmost window in the window hierarchy. This property is read only.</dd> <dt><code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.URL">window.URL</a></code>
  224. <span title="(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
  225. ">Requires Gecko 2.0</span>
  226. </dt> <dd>A DOM&nbsp;URL&nbsp;object, which provides the <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.URL.createObjectURL">window.URL.createObjectURL()</a></code>
  227. and <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.URL.revokeObjectURL">window.URL.revokeObjectURL()</a></code>
  228. methods.</dd> */
  229. var top(default,null) : DOMWindow;
  230. /** <dd>Returns a reference to the current window.</dd> <dt>window[0], window[1], etc.</dt> <dd>Returns a reference to the <code>window</code> object in the frames. See <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/window.frames">window.frames</a></code>
  231. for more details.</dd> */
  232. var window(default,null) : DOMWindow;
  233. function alert( message : String ) : Void;
  234. function atob( ?string : String ) : String;
  235. function blur() : Void;
  236. function btoa( ?string : String ) : String;
  237. @:overload( function( id : Int ) :Void {} )
  238. function cancelAnimationFrame( id : Int ) : Void;
  239. function cancelRequestAnimationFrame( id : Int ) : Void;
  240. function captureEvents() : Void;
  241. function clearInterval( handle : Int ) : Void;
  242. function clearTimeout( handle : Int ) : Void;
  243. function close() : Void;
  244. function confirm( message : String ) : Bool;
  245. function convertPointFromNodeToPage( node : Node, p : Point ) : Point;
  246. function convertPointFromPageToNode( node : Node, p : Point ) : Point;
  247. function find( string : String, caseSensitive : Bool, backwards : Bool, wrap : Bool, wholeWord : Bool, searchInFrames : Bool, showDialog : Bool ) : Bool;
  248. function focus() : Void;
  249. function getComputedStyle( element : Element, ?pseudoElement : String ) : CSSStyleDeclaration;
  250. function getMatchedCSSRules( element : Element, ?pseudoElement : String ) : CSSRuleList;
  251. function getSelection() : DOMSelection;
  252. function matchMedia( query : String ) : MediaQueryList;
  253. function moveBy( x : Float, y : Float ) : Void;
  254. function moveTo( x : Float, y : Float ) : Void;
  255. function open( url : String, name : String, ?options : String ) : DOMWindow;
  256. function openDatabase( name : String, version : String, displayName : String, estimatedSize : Int, ?creationCallback : js.html.sql.DatabaseCallback ) : js.html.sql.Database;
  257. /** Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first, in a secure manner. Throws DOMException. */
  258. @:overload( function( message : Dynamic, targetOrigin : String ) :Void {} )
  259. function postMessage( message : Dynamic, targetOrigin : String, messagePorts : Array<Dynamic> ) : Void;
  260. function print() : Void;
  261. function prompt( message : String, ?defaultValue : String ) : String;
  262. function releaseEvents() : Void;
  263. @:overload( function( callback_ : RequestAnimationFrameCallback ) :Int {} )
  264. function requestAnimationFrame( callback_ : RequestAnimationFrameCallback ) : Int;
  265. function requestFileSystem( type : Int, size : Int, successCallback : js.html.fs.FileSystemCallback, ?errorCallback : js.html.fs.ErrorCallback ) : Void;
  266. function resizeBy( x : Float, y : Float ) : Void;
  267. function resizeTo( width : Float, height : Float ) : Void;
  268. function resolveLocalFileSystemURL( url : String, successCallback : js.html.fs.EntryCallback, ?errorCallback : js.html.fs.ErrorCallback ) : Void;
  269. function scroll( x : Int, y : Int ) : Void;
  270. function scrollBy( x : Int, y : Int ) : Void;
  271. function scrollTo( x : Int, y : Int ) : Void;
  272. function setInterval( handler : Void->Void, timeout : Int ) : Int;
  273. function setTimeout( handler : Void->Void, timeout : Int ) : Int;
  274. function showModalDialog( url : String, ?dialogArgs : Dynamic, ?featureArgs : String ) : Dynamic;
  275. function stop() : Void;
  276. }