nsIDOMWindow.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/dom/public/idl/base/nsIDOMWindow.idl
  3. */
  4. #ifndef __gen_nsIDOMWindow_h__
  5. #define __gen_nsIDOMWindow_h__
  6. #ifndef __gen_domstubs_h__
  7. #include "domstubs.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsISelection; /* forward declaration */
  14. /* starting interface: nsIDOMWindow */
  15. #define NS_IDOMWINDOW_IID_STR "a6cf906b-15b3-11d2-932e-00805f8add32"
  16. #define NS_IDOMWINDOW_IID \
  17. {0xa6cf906b, 0x15b3, 0x11d2, \
  18. { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
  19. class NS_NO_VTABLE nsIDOMWindow : public nsISupports {
  20. public:
  21. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMWINDOW_IID)
  22. /**
  23. * The nsIDOMWindow interface is the primary interface for a DOM
  24. * window object. It represents a single window object that may
  25. * contain child windows if the document in the window contains a
  26. * HTML frameset document or if the document contains iframe elements.
  27. *
  28. * This interface is not officially defined by any standard bodies, it
  29. * originates from the defacto DOM Level 0 standard.
  30. *
  31. * @status FROZEN
  32. */
  33. /**
  34. * Accessor for the document in this window.
  35. */
  36. /* readonly attribute nsIDOMDocument document; */
  37. NS_IMETHOD GetDocument(nsIDOMDocument * *aDocument) = 0;
  38. /**
  39. * Accessor for this window's parent window, or the window itself if
  40. * there is no parent, or if the parent is of different type
  41. * (i.e. this does not cross chrome-content boundaries).
  42. */
  43. /* readonly attribute nsIDOMWindow parent; */
  44. NS_IMETHOD GetParent(nsIDOMWindow * *aParent) = 0;
  45. /**
  46. * Accessor for the root of this hierarchy of windows. This root may
  47. * be the window itself if there is no parent, or if the parent is
  48. * of different type (i.e. this does not cross chrome-content
  49. * boundaries).
  50. *
  51. * This property is "replaceable" in JavaScript */
  52. /* readonly attribute nsIDOMWindow top; */
  53. NS_IMETHOD GetTop(nsIDOMWindow * *aTop) = 0;
  54. /**
  55. * Accessor for the object that controls whether or not scrollbars
  56. * are shown in this window.
  57. *
  58. * This attribute is "replaceable" in JavaScript
  59. */
  60. /* readonly attribute nsIDOMBarProp scrollbars; */
  61. NS_IMETHOD GetScrollbars(nsIDOMBarProp * *aScrollbars) = 0;
  62. /**
  63. * Accessor for the child windows in this window.
  64. */
  65. /* [noscript] readonly attribute nsIDOMWindowCollection frames; */
  66. NS_IMETHOD GetFrames(nsIDOMWindowCollection * *aFrames) = 0;
  67. /**
  68. * Set/Get the name of this window.
  69. *
  70. * This attribute is "replaceable" in JavaScript
  71. */
  72. /* attribute DOMString name; */
  73. NS_IMETHOD GetName(nsAString & aName) = 0;
  74. NS_IMETHOD SetName(const nsAString & aName) = 0;
  75. /**
  76. * Set/Get the document scale factor as a multiplier on the default
  77. * size. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED
  78. * error may be returned by implementations not supporting
  79. * zoom. Implementations not supporting zoom should return 1.0 all
  80. * the time for the Get operation. 1.0 is equals normal size,
  81. * i.e. no zoom.
  82. */
  83. /* [noscript] attribute float textZoom; */
  84. NS_IMETHOD GetTextZoom(float *aTextZoom) = 0;
  85. NS_IMETHOD SetTextZoom(float aTextZoom) = 0;
  86. /**
  87. * Accessor for the current x scroll position in this window in
  88. * pixels.
  89. *
  90. * This attribute is "replaceable" in JavaScript
  91. */
  92. /* readonly attribute long scrollX; */
  93. NS_IMETHOD GetScrollX(PRInt32 *aScrollX) = 0;
  94. /**
  95. * Accessor for the current y scroll position in this window in
  96. * pixels.
  97. *
  98. * This attribute is "replaceable" in JavaScript
  99. */
  100. /* readonly attribute long scrollY; */
  101. NS_IMETHOD GetScrollY(PRInt32 *aScrollY) = 0;
  102. /**
  103. * Method for scrolling this window to an absolute pixel offset.
  104. */
  105. /* void scrollTo (in long xScroll, in long yScroll); */
  106. NS_IMETHOD ScrollTo(PRInt32 xScroll, PRInt32 yScroll) = 0;
  107. /**
  108. * Method for scrolling this window to a pixel offset relative to
  109. * the current scroll position.
  110. */
  111. /* void scrollBy (in long xScrollDif, in long yScrollDif); */
  112. NS_IMETHOD ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif) = 0;
  113. /**
  114. * Method for accessing this window's selection object.
  115. */
  116. /* nsISelection getSelection (); */
  117. NS_IMETHOD GetSelection(nsISelection **_retval) = 0;
  118. /**
  119. * Method for scrolling this window by a number of lines.
  120. */
  121. /* void scrollByLines (in long numLines); */
  122. NS_IMETHOD ScrollByLines(PRInt32 numLines) = 0;
  123. /**
  124. * Method for scrolling this window by a number of pages.
  125. */
  126. /* void scrollByPages (in long numPages); */
  127. NS_IMETHOD ScrollByPages(PRInt32 numPages) = 0;
  128. /**
  129. * Method for sizing this window to the content in the window.
  130. */
  131. /* void sizeToContent (); */
  132. NS_IMETHOD SizeToContent(void) = 0;
  133. };
  134. /* Use this macro when declaring classes that implement this interface. */
  135. #define NS_DECL_NSIDOMWINDOW \
  136. NS_IMETHOD GetDocument(nsIDOMDocument * *aDocument); \
  137. NS_IMETHOD GetParent(nsIDOMWindow * *aParent); \
  138. NS_IMETHOD GetTop(nsIDOMWindow * *aTop); \
  139. NS_IMETHOD GetScrollbars(nsIDOMBarProp * *aScrollbars); \
  140. NS_IMETHOD GetFrames(nsIDOMWindowCollection * *aFrames); \
  141. NS_IMETHOD GetName(nsAString & aName); \
  142. NS_IMETHOD SetName(const nsAString & aName); \
  143. NS_IMETHOD GetTextZoom(float *aTextZoom); \
  144. NS_IMETHOD SetTextZoom(float aTextZoom); \
  145. NS_IMETHOD GetScrollX(PRInt32 *aScrollX); \
  146. NS_IMETHOD GetScrollY(PRInt32 *aScrollY); \
  147. NS_IMETHOD ScrollTo(PRInt32 xScroll, PRInt32 yScroll); \
  148. NS_IMETHOD ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif); \
  149. NS_IMETHOD GetSelection(nsISelection **_retval); \
  150. NS_IMETHOD ScrollByLines(PRInt32 numLines); \
  151. NS_IMETHOD ScrollByPages(PRInt32 numPages); \
  152. NS_IMETHOD SizeToContent(void);
  153. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  154. #define NS_FORWARD_NSIDOMWINDOW(_to) \
  155. NS_IMETHOD GetDocument(nsIDOMDocument * *aDocument) { return _to GetDocument(aDocument); } \
  156. NS_IMETHOD GetParent(nsIDOMWindow * *aParent) { return _to GetParent(aParent); } \
  157. NS_IMETHOD GetTop(nsIDOMWindow * *aTop) { return _to GetTop(aTop); } \
  158. NS_IMETHOD GetScrollbars(nsIDOMBarProp * *aScrollbars) { return _to GetScrollbars(aScrollbars); } \
  159. NS_IMETHOD GetFrames(nsIDOMWindowCollection * *aFrames) { return _to GetFrames(aFrames); } \
  160. NS_IMETHOD GetName(nsAString & aName) { return _to GetName(aName); } \
  161. NS_IMETHOD SetName(const nsAString & aName) { return _to SetName(aName); } \
  162. NS_IMETHOD GetTextZoom(float *aTextZoom) { return _to GetTextZoom(aTextZoom); } \
  163. NS_IMETHOD SetTextZoom(float aTextZoom) { return _to SetTextZoom(aTextZoom); } \
  164. NS_IMETHOD GetScrollX(PRInt32 *aScrollX) { return _to GetScrollX(aScrollX); } \
  165. NS_IMETHOD GetScrollY(PRInt32 *aScrollY) { return _to GetScrollY(aScrollY); } \
  166. NS_IMETHOD ScrollTo(PRInt32 xScroll, PRInt32 yScroll) { return _to ScrollTo(xScroll, yScroll); } \
  167. NS_IMETHOD ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif) { return _to ScrollBy(xScrollDif, yScrollDif); } \
  168. NS_IMETHOD GetSelection(nsISelection **_retval) { return _to GetSelection(_retval); } \
  169. NS_IMETHOD ScrollByLines(PRInt32 numLines) { return _to ScrollByLines(numLines); } \
  170. NS_IMETHOD ScrollByPages(PRInt32 numPages) { return _to ScrollByPages(numPages); } \
  171. NS_IMETHOD SizeToContent(void) { return _to SizeToContent(); }
  172. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  173. #define NS_FORWARD_SAFE_NSIDOMWINDOW(_to) \
  174. NS_IMETHOD GetDocument(nsIDOMDocument * *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocument(aDocument); } \
  175. NS_IMETHOD GetParent(nsIDOMWindow * *aParent) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParent(aParent); } \
  176. NS_IMETHOD GetTop(nsIDOMWindow * *aTop) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTop(aTop); } \
  177. NS_IMETHOD GetScrollbars(nsIDOMBarProp * *aScrollbars) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScrollbars(aScrollbars); } \
  178. NS_IMETHOD GetFrames(nsIDOMWindowCollection * *aFrames) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFrames(aFrames); } \
  179. NS_IMETHOD GetName(nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  180. NS_IMETHOD SetName(const nsAString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetName(aName); } \
  181. NS_IMETHOD GetTextZoom(float *aTextZoom) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTextZoom(aTextZoom); } \
  182. NS_IMETHOD SetTextZoom(float aTextZoom) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTextZoom(aTextZoom); } \
  183. NS_IMETHOD GetScrollX(PRInt32 *aScrollX) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScrollX(aScrollX); } \
  184. NS_IMETHOD GetScrollY(PRInt32 *aScrollY) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScrollY(aScrollY); } \
  185. NS_IMETHOD ScrollTo(PRInt32 xScroll, PRInt32 yScroll) { return !_to ? NS_ERROR_NULL_POINTER : _to->ScrollTo(xScroll, yScroll); } \
  186. NS_IMETHOD ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif) { return !_to ? NS_ERROR_NULL_POINTER : _to->ScrollBy(xScrollDif, yScrollDif); } \
  187. NS_IMETHOD GetSelection(nsISelection **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelection(_retval); } \
  188. NS_IMETHOD ScrollByLines(PRInt32 numLines) { return !_to ? NS_ERROR_NULL_POINTER : _to->ScrollByLines(numLines); } \
  189. NS_IMETHOD ScrollByPages(PRInt32 numPages) { return !_to ? NS_ERROR_NULL_POINTER : _to->ScrollByPages(numPages); } \
  190. NS_IMETHOD SizeToContent(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->SizeToContent(); }
  191. #if 0
  192. /* Use the code below as a template for the implementation class for this interface. */
  193. /* Header file */
  194. class nsDOMWindow : public nsIDOMWindow
  195. {
  196. public:
  197. NS_DECL_ISUPPORTS
  198. NS_DECL_NSIDOMWINDOW
  199. nsDOMWindow();
  200. private:
  201. ~nsDOMWindow();
  202. protected:
  203. /* additional members */
  204. };
  205. /* Implementation file */
  206. NS_IMPL_ISUPPORTS1(nsDOMWindow, nsIDOMWindow)
  207. nsDOMWindow::nsDOMWindow()
  208. {
  209. /* member initializers and constructor code */
  210. }
  211. nsDOMWindow::~nsDOMWindow()
  212. {
  213. /* destructor code */
  214. }
  215. /* readonly attribute nsIDOMDocument document; */
  216. NS_IMETHODIMP nsDOMWindow::GetDocument(nsIDOMDocument * *aDocument)
  217. {
  218. return NS_ERROR_NOT_IMPLEMENTED;
  219. }
  220. /* readonly attribute nsIDOMWindow parent; */
  221. NS_IMETHODIMP nsDOMWindow::GetParent(nsIDOMWindow * *aParent)
  222. {
  223. return NS_ERROR_NOT_IMPLEMENTED;
  224. }
  225. /* readonly attribute nsIDOMWindow top; */
  226. NS_IMETHODIMP nsDOMWindow::GetTop(nsIDOMWindow * *aTop)
  227. {
  228. return NS_ERROR_NOT_IMPLEMENTED;
  229. }
  230. /* readonly attribute nsIDOMBarProp scrollbars; */
  231. NS_IMETHODIMP nsDOMWindow::GetScrollbars(nsIDOMBarProp * *aScrollbars)
  232. {
  233. return NS_ERROR_NOT_IMPLEMENTED;
  234. }
  235. /* [noscript] readonly attribute nsIDOMWindowCollection frames; */
  236. NS_IMETHODIMP nsDOMWindow::GetFrames(nsIDOMWindowCollection * *aFrames)
  237. {
  238. return NS_ERROR_NOT_IMPLEMENTED;
  239. }
  240. /* attribute DOMString name; */
  241. NS_IMETHODIMP nsDOMWindow::GetName(nsAString & aName)
  242. {
  243. return NS_ERROR_NOT_IMPLEMENTED;
  244. }
  245. NS_IMETHODIMP nsDOMWindow::SetName(const nsAString & aName)
  246. {
  247. return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249. /* [noscript] attribute float textZoom; */
  250. NS_IMETHODIMP nsDOMWindow::GetTextZoom(float *aTextZoom)
  251. {
  252. return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254. NS_IMETHODIMP nsDOMWindow::SetTextZoom(float aTextZoom)
  255. {
  256. return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. /* readonly attribute long scrollX; */
  259. NS_IMETHODIMP nsDOMWindow::GetScrollX(PRInt32 *aScrollX)
  260. {
  261. return NS_ERROR_NOT_IMPLEMENTED;
  262. }
  263. /* readonly attribute long scrollY; */
  264. NS_IMETHODIMP nsDOMWindow::GetScrollY(PRInt32 *aScrollY)
  265. {
  266. return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268. /* void scrollTo (in long xScroll, in long yScroll); */
  269. NS_IMETHODIMP nsDOMWindow::ScrollTo(PRInt32 xScroll, PRInt32 yScroll)
  270. {
  271. return NS_ERROR_NOT_IMPLEMENTED;
  272. }
  273. /* void scrollBy (in long xScrollDif, in long yScrollDif); */
  274. NS_IMETHODIMP nsDOMWindow::ScrollBy(PRInt32 xScrollDif, PRInt32 yScrollDif)
  275. {
  276. return NS_ERROR_NOT_IMPLEMENTED;
  277. }
  278. /* nsISelection getSelection (); */
  279. NS_IMETHODIMP nsDOMWindow::GetSelection(nsISelection **_retval)
  280. {
  281. return NS_ERROR_NOT_IMPLEMENTED;
  282. }
  283. /* void scrollByLines (in long numLines); */
  284. NS_IMETHODIMP nsDOMWindow::ScrollByLines(PRInt32 numLines)
  285. {
  286. return NS_ERROR_NOT_IMPLEMENTED;
  287. }
  288. /* void scrollByPages (in long numPages); */
  289. NS_IMETHODIMP nsDOMWindow::ScrollByPages(PRInt32 numPages)
  290. {
  291. return NS_ERROR_NOT_IMPLEMENTED;
  292. }
  293. /* void sizeToContent (); */
  294. NS_IMETHODIMP nsDOMWindow::SizeToContent()
  295. {
  296. return NS_ERROR_NOT_IMPLEMENTED;
  297. }
  298. /* End of implementation class template. */
  299. #endif
  300. #endif /* __gen_nsIDOMWindow_h__ */