nsIEmbeddingSiteWindow.idl 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. /* THIS IS A PUBLIC EMBEDDING API */
  8. /**
  9. * The nsIEmbeddingSiteWindow is implemented by the embedder to provide
  10. * Gecko with the means to call up to the host to resize the window,
  11. * hide or show it and set/get its title.
  12. */
  13. [scriptable, uuid(0b976267-4aaa-4f36-a2d4-27b5ca8d73bb)]
  14. interface nsIEmbeddingSiteWindow : nsISupports
  15. {
  16. /**
  17. * Flag indicates that position of the top left corner of the outer area
  18. * is required/specified.
  19. *
  20. * @see setDimensions
  21. * @see getDimensions
  22. */
  23. const unsigned long DIM_FLAGS_POSITION = 1;
  24. /**
  25. * Flag indicates that the size of the inner area is required/specified.
  26. *
  27. * @note The inner and outer flags are mutually exclusive and it is
  28. * invalid to combine them.
  29. *
  30. * @see setDimensions
  31. * @see getDimensions
  32. * @see DIM_FLAGS_SIZE_OUTER
  33. */
  34. const unsigned long DIM_FLAGS_SIZE_INNER = 2;
  35. /**
  36. * Flag indicates that the size of the outer area is required/specified.
  37. *
  38. * @see setDimensions
  39. * @see getDimensions
  40. * @see DIM_FLAGS_SIZE_INNER
  41. */
  42. const unsigned long DIM_FLAGS_SIZE_OUTER = 4;
  43. /**
  44. * Flag indicates that the x parameter should be ignored.
  45. *
  46. * @see setDimensions
  47. */
  48. const unsigned long DIM_FLAGS_IGNORE_X = 8;
  49. /**
  50. * Flag indicates that the y parameter should be ignored.
  51. *
  52. * @see setDimensions
  53. */
  54. const unsigned long DIM_FLAGS_IGNORE_Y = 16;
  55. /**
  56. * Flag indicates that the cx parameter should be ignored.
  57. *
  58. * @see setDimensions
  59. */
  60. const unsigned long DIM_FLAGS_IGNORE_CX = 32;
  61. /**
  62. * Flag indicates that the cy parameter should be ignored.
  63. *
  64. * @see setDimensions
  65. */
  66. const unsigned long DIM_FLAGS_IGNORE_CY = 64;
  67. /**
  68. * Sets the dimensions for the window; the position & size. The
  69. * flags to indicate what the caller wants to set and whether the size
  70. * refers to the inner or outer area. The inner area refers to just
  71. * the embedded area, wheras the outer area can also include any
  72. * surrounding chrome, window frame, title bar, and so on.
  73. *
  74. * @param flags Combination of position, inner and outer size flags.
  75. * The ignore flags are telling the parent to use the
  76. * current values for those dimensions and ignore the
  77. * corresponding parameters the child sends.
  78. * @param x Left hand corner of the outer area.
  79. * @param y Top corner of the outer area.
  80. * @param cx Width of the inner or outer area.
  81. * @param cy Height of the inner or outer area.
  82. *
  83. * @return <code>NS_OK</code> if operation was performed correctly;
  84. * <code>NS_ERROR_UNEXPECTED</code> if window could not be
  85. * destroyed;
  86. * <code>NS_ERROR_INVALID_ARG</code> for bad flag combination
  87. * or illegal dimensions.
  88. *
  89. * @see getDimensions
  90. * @see DIM_FLAGS_POSITION
  91. * @see DIM_FLAGS_SIZE_OUTER
  92. * @see DIM_FLAGS_SIZE_INNER
  93. */
  94. void setDimensions(in unsigned long flags, in long x, in long y, in long cx, in long cy);
  95. /**
  96. * Gets the dimensions of the window. The caller may pass
  97. * <CODE>nullptr</CODE> for any value it is uninterested in receiving.
  98. *
  99. * @param flags Combination of position, inner and outer size flag .
  100. * @param x Left hand corner of the outer area; or <CODE>nullptr</CODE>.
  101. * @param y Top corner of the outer area; or <CODE>nullptr</CODE>.
  102. * @param cx Width of the inner or outer area; or <CODE>nullptr</CODE>.
  103. * @param cy Height of the inner or outer area; or <CODE>nullptr</CODE>.
  104. *
  105. * @see setDimensions
  106. * @see DIM_FLAGS_POSITION
  107. * @see DIM_FLAGS_SIZE_OUTER
  108. * @see DIM_FLAGS_SIZE_INNER
  109. */
  110. void getDimensions(in unsigned long flags, out long x, out long y, out long cx, out long cy);
  111. /**
  112. * Give the window focus.
  113. */
  114. void setFocus();
  115. /**
  116. * Visibility of the window.
  117. */
  118. attribute boolean visibility;
  119. /**
  120. * Title of the window.
  121. */
  122. attribute wstring title;
  123. /**
  124. * Native window for the site's window. The implementor should copy the
  125. * native window object into the address supplied by the caller. The
  126. * type of the native window that the address refers to is platform
  127. * and OS specific as follows:
  128. *
  129. * <ul>
  130. * <li>On Win32 it is an <CODE>HWND</CODE>.</li>
  131. * <li>On MacOS this is a <CODE>WindowPtr</CODE>.</li>
  132. * <li>On GTK this is a <CODE>GtkWidget*</CODE>.</li>
  133. * </ul>
  134. */
  135. [noscript] readonly attribute voidPtr siteWindow;
  136. /**
  137. * Blur the window. This should unfocus the window and send an onblur event.
  138. */
  139. void blur();
  140. };