nsIWebBrowserFind.idl 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* -*- Mode: IDL; tab-width: 4; 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) 2001
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. * Conrad Carlen <[email protected]>
  24. * Simon Fraser <[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. #include "domstubs.idl"
  41. /* THIS IS A PUBLIC EMBEDDING API */
  42. /**
  43. * nsIWebBrowserFind
  44. *
  45. * Searches for text in a web browser.
  46. *
  47. * Get one by doing a GetInterface on an nsIWebBrowser.
  48. *
  49. * By default, the implementation will search the focussed frame, or
  50. * if there is no focussed frame, the web browser content area. It
  51. * does not by default search subframes or iframes. To change this
  52. * behaviour, and to explicitly set the frame to search,
  53. * QueryInterface to nsIWebBrowserFindInFrames.
  54. *
  55. * @status FROZEN
  56. */
  57. [scriptable, uuid(2f977d44-5485-11d4-87e2-0010a4e75ef2)]
  58. interface nsIWebBrowserFind : nsISupports
  59. {
  60. /**
  61. * findNext
  62. *
  63. * Finds, highlights, and scrolls into view the next occurrence of the
  64. * search string, using the current search settings. Fails if the
  65. * search string is empty.
  66. *
  67. * @return Whether an occurrence was found
  68. */
  69. boolean findNext();
  70. /**
  71. * searchString
  72. *
  73. * The string to search for. This must be non-empty to search.
  74. */
  75. attribute wstring searchString;
  76. /**
  77. * findBackwards
  78. *
  79. * Whether to find backwards (towards the beginning of the document).
  80. * Default is false (search forward).
  81. */
  82. attribute boolean findBackwards;
  83. /**
  84. * wrapFind
  85. *
  86. * Whether the search wraps around to the start (or end) of the document
  87. * if no match was found between the current position and the end (or
  88. * beginning). Works correctly when searching backwards. Default is
  89. * false.
  90. */
  91. attribute boolean wrapFind;
  92. /**
  93. * entireWord
  94. *
  95. * Whether to match entire words only. Default is false.
  96. */
  97. attribute boolean entireWord;
  98. /**
  99. * matchCase
  100. *
  101. * Whether to match case (case sensitive) when searching. Default is false.
  102. */
  103. attribute boolean matchCase;
  104. /**
  105. * searchFrames
  106. *
  107. * Whether to search through all frames in the content area. Default is true.
  108. *
  109. * Note that you can control whether the search propagates into child or
  110. * parent frames explicitly using nsIWebBrowserFindInFrames, but if one,
  111. * but not both, of searchSubframes and searchParentFrames are set, this
  112. * returns false.
  113. */
  114. attribute boolean searchFrames;
  115. };
  116. /**
  117. * nsIWebBrowserFindInFrames
  118. *
  119. * Controls how find behaves when multiple frames or iframes are present.
  120. *
  121. * Get by doing a QueryInterface from nsIWebBrowserFind.
  122. *
  123. * @status FROZEN
  124. */
  125. [scriptable, uuid(e0f5d182-34bc-11d5-be5b-b760676c6ebc)]
  126. interface nsIWebBrowserFindInFrames : nsISupports
  127. {
  128. /**
  129. * currentSearchFrame
  130. *
  131. * Frame at which to start the search. Once the search is done, this will
  132. * be set to be the last frame searched, whether or not a result was found.
  133. * Has to be equal to or contained within the rootSearchFrame.
  134. */
  135. attribute nsIDOMWindow currentSearchFrame;
  136. /**
  137. * rootSearchFrame
  138. *
  139. * Frame within which to confine the search (normally the content area frame).
  140. * Set this to only search a subtree of the frame hierarchy.
  141. */
  142. attribute nsIDOMWindow rootSearchFrame;
  143. /**
  144. * searchSubframes
  145. *
  146. * Whether to recurse down into subframes while searching. Default is true.
  147. *
  148. * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
  149. */
  150. attribute boolean searchSubframes;
  151. /**
  152. * searchParentFrames
  153. *
  154. * Whether to allow the search to propagate out of the currentSearchFrame into its
  155. * parent frame(s). Search is always confined within the rootSearchFrame. Default
  156. * is true.
  157. *
  158. * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
  159. */
  160. attribute boolean searchParentFrames;
  161. };