nsIEmbeddingSiteWindow.idl 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  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. * Adam Lock <[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. /* THIS IS A PUBLIC EMBEDDING API */
  41. /**
  42. * The nsIEmbeddingSiteWindow is implemented by the embedder to provide
  43. * Gecko with the means to call up to the host to resize the window,
  44. * hide or show it and set/get its title.
  45. *
  46. * @status FROZEN
  47. */
  48. [scriptable, uuid(3E5432CD-9568-4bd1-8CBE-D50ABA110743)]
  49. interface nsIEmbeddingSiteWindow : nsISupports
  50. {
  51. /**
  52. * Flag indicates that position of the top left corner of the outer area
  53. * is required/specified.
  54. *
  55. * @see setDimensions
  56. * @see getDimensions
  57. */
  58. const unsigned long DIM_FLAGS_POSITION = 1;
  59. /**
  60. * Flag indicates that the size of the inner area is required/specified.
  61. *
  62. * @note The inner and outer flags are mutually exclusive and it is
  63. * invalid to combine them.
  64. *
  65. * @see setDimensions
  66. * @see getDimensions
  67. * @see DIM_FLAGS_SIZE_OUTER
  68. */
  69. const unsigned long DIM_FLAGS_SIZE_INNER = 2;
  70. /**
  71. * Flag indicates that the size of the outer area is required/specified.
  72. *
  73. * @see setDimensions
  74. * @see getDimensions
  75. * @see DIM_FLAGS_SIZE_INNER
  76. */
  77. const unsigned long DIM_FLAGS_SIZE_OUTER = 4;
  78. /**
  79. * Sets the dimensions for the window; the position & size. The
  80. * flags to indicate what the caller wants to set and whether the size
  81. * refers to the inner or outer area. The inner area refers to just
  82. * the embedded area, wheras the outer area can also include any
  83. * surrounding chrome, window frame, title bar, and so on.
  84. *
  85. * @param flags Combination of position, inner and outer size flags.
  86. * @param x Left hand corner of the outer area.
  87. * @param y Top corner of the outer area.
  88. * @param cx Width of the inner or outer area.
  89. * @param cy Height of the inner or outer area.
  90. *
  91. * @return <code>NS_OK</code> if operation was performed correctly;
  92. * <code>NS_ERROR_UNEXPECTED</code> if window could not be
  93. * destroyed;
  94. * <code>NS_ERROR_INVALID_ARG</code> for bad flag combination
  95. * or illegal dimensions.
  96. *
  97. * @see getDimensions
  98. * @see DIM_FLAGS_POSITION
  99. * @see DIM_FLAGS_SIZE_OUTER
  100. * @see DIM_FLAGS_SIZE_INNER
  101. */
  102. void setDimensions(in unsigned long flags, in long x, in long y, in long cx, in long cy);
  103. /**
  104. * Gets the dimensions of the window. The caller may pass
  105. * <CODE>nsnull</CODE> for any value it is uninterested in receiving.
  106. *
  107. * @param flags Combination of position, inner and outer size flag .
  108. * @param x Left hand corner of the outer area; or <CODE>nsnull</CODE>.
  109. * @param y Top corner of the outer area; or <CODE>nsnull</CODE>.
  110. * @param cx Width of the inner or outer area; or <CODE>nsnull</CODE>.
  111. * @param cy Height of the inner or outer area; or <CODE>nsnull</CODE>.
  112. *
  113. * @see setDimensions
  114. * @see DIM_FLAGS_POSITION
  115. * @see DIM_FLAGS_SIZE_OUTER
  116. * @see DIM_FLAGS_SIZE_INNER
  117. */
  118. void getDimensions(in unsigned long flags, out long x, out long y, out long cx, out long cy);
  119. /**
  120. * Give the window focus.
  121. */
  122. void setFocus();
  123. /**
  124. * Visibility of the window.
  125. */
  126. attribute boolean visibility;
  127. /**
  128. * Title of the window.
  129. */
  130. attribute wstring title;
  131. /**
  132. * Native window for the site's window. The implementor should copy the
  133. * native window object into the address supplied by the caller. The
  134. * type of the native window that the address refers to is platform
  135. * and OS specific as follows:
  136. *
  137. * <ul>
  138. * <li>On Win32 it is an <CODE>HWND</CODE>.</li>
  139. * <li>On MacOS this is a <CODE>WindowPtr</CODE>.</li>
  140. * <li>On GTK this is a <CODE>GtkWidget*</CODE>.</li>
  141. * </ul>
  142. */
  143. [noscript] readonly attribute voidPtr siteWindow;
  144. };