nsIWebBrowserFind.idl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. #include "domstubs.idl"
  7. interface mozIDOMWindowProxy;
  8. /* THIS IS A PUBLIC EMBEDDING API */
  9. /**
  10. * nsIWebBrowserFind
  11. *
  12. * Searches for text in a web browser.
  13. *
  14. * Get one by doing a GetInterface on an nsIWebBrowser.
  15. *
  16. * By default, the implementation will search the focussed frame, or
  17. * if there is no focussed frame, the web browser content area. It
  18. * does not by default search subframes or iframes. To change this
  19. * behaviour, and to explicitly set the frame to search,
  20. * QueryInterface to nsIWebBrowserFindInFrames.
  21. */
  22. [scriptable, uuid(e4920136-b3e0-49e0-b1cd-6c783d2591a8)]
  23. interface nsIWebBrowserFind : nsISupports
  24. {
  25. /**
  26. * findNext
  27. *
  28. * Finds, highlights, and scrolls into view the next occurrence of the
  29. * search string, using the current search settings. Fails if the
  30. * search string is empty.
  31. *
  32. * @return Whether an occurrence was found
  33. */
  34. boolean findNext();
  35. /**
  36. * searchString
  37. *
  38. * The string to search for. This must be non-empty to search.
  39. */
  40. attribute wstring searchString;
  41. /**
  42. * findBackwards
  43. *
  44. * Whether to find backwards (towards the beginning of the document).
  45. * Default is false (search forward).
  46. */
  47. attribute boolean findBackwards;
  48. /**
  49. * wrapFind
  50. *
  51. * Whether the search wraps around to the start (or end) of the document
  52. * if no match was found between the current position and the end (or
  53. * beginning). Works correctly when searching backwards. Default is
  54. * false.
  55. */
  56. attribute boolean wrapFind;
  57. /**
  58. * entireWord
  59. *
  60. * Whether to match entire words only. Default is false.
  61. */
  62. attribute boolean entireWord;
  63. /**
  64. * matchCase
  65. *
  66. * Whether to match case (case sensitive) when searching. Default is false.
  67. */
  68. attribute boolean matchCase;
  69. /**
  70. * searchFrames
  71. *
  72. * Whether to search through all frames in the content area. Default is true.
  73. *
  74. * Note that you can control whether the search propagates into child or
  75. * parent frames explicitly using nsIWebBrowserFindInFrames, but if one,
  76. * but not both, of searchSubframes and searchParentFrames are set, this
  77. * returns false.
  78. */
  79. attribute boolean searchFrames;
  80. };
  81. /**
  82. * nsIWebBrowserFindInFrames
  83. *
  84. * Controls how find behaves when multiple frames or iframes are present.
  85. *
  86. * Get by doing a QueryInterface from nsIWebBrowserFind.
  87. */
  88. [scriptable, uuid(e0f5d182-34bc-11d5-be5b-b760676c6ebc)]
  89. interface nsIWebBrowserFindInFrames : nsISupports
  90. {
  91. /**
  92. * currentSearchFrame
  93. *
  94. * Frame at which to start the search. Once the search is done, this will
  95. * be set to be the last frame searched, whether or not a result was found.
  96. * Has to be equal to or contained within the rootSearchFrame.
  97. */
  98. attribute mozIDOMWindowProxy currentSearchFrame;
  99. /**
  100. * rootSearchFrame
  101. *
  102. * Frame within which to confine the search (normally the content area frame).
  103. * Set this to only search a subtree of the frame hierarchy.
  104. */
  105. attribute mozIDOMWindowProxy rootSearchFrame;
  106. /**
  107. * searchSubframes
  108. *
  109. * Whether to recurse down into subframes while searching. Default is true.
  110. *
  111. * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
  112. */
  113. attribute boolean searchSubframes;
  114. /**
  115. * searchParentFrames
  116. *
  117. * Whether to allow the search to propagate out of the currentSearchFrame into its
  118. * parent frame(s). Search is always confined within the rootSearchFrame. Default
  119. * is true.
  120. *
  121. * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
  122. */
  123. attribute boolean searchParentFrames;
  124. };