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
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/
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
15 * The Original Code is mozilla.org code.
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.
23 * Conrad Carlen <ccarlen@netscape.com>
24 * Simon Fraser <sfraser@netscape.com>
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.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
42 #include
"domstubs.idl"
44 /* THIS IS A PUBLIC EMBEDDING API */
50 * Searches for text in a web browser.
52 * Get one by doing a GetInterface on an nsIWebBrowser.
54 * By default, the implementation will search the focussed frame, or
55 * if there is no focussed frame, the web browser content area. It
56 * does not by default search subframes or iframes. To change this
57 * behaviour, and to explicitly set the frame to search,
58 * QueryInterface to nsIWebBrowserFindInFrames.
63 [scriptable
, uuid(2f977d44
-5485-11d4
-87e2
-0010a4e75ef2
)]
64 interface nsIWebBrowserFind
: nsISupports
69 * Finds, highlights, and scrolls into view the next occurrence of the
70 * search string, using the current search settings. Fails if the
71 * search string is empty.
73 * @return Whether an occurrence was found
80 * The string to search for. This must be non-empty to search.
82 attribute wstring searchString
;
87 * Whether to find backwards (towards the beginning of the document).
88 * Default is false (search forward).
90 attribute
boolean findBackwards
;
95 * Whether the search wraps around to the start (or end) of the document
96 * if no match was found between the current position and the end (or
97 * beginning). Works correctly when searching backwards. Default is
100 attribute
boolean wrapFind
;
105 * Whether to match entire words only. Default is false.
107 attribute
boolean entireWord
;
112 * Whether to match case (case sensitive) when searching. Default is false.
114 attribute
boolean matchCase
;
119 * Whether to search through all frames in the content area. Default is true.
121 * Note that you can control whether the search propagates into child or
122 * parent frames explicitly using nsIWebBrowserFindInFrames, but if one,
123 * but not both, of searchSubframes and searchParentFrames are set, this
126 attribute
boolean searchFrames
;
132 * nsIWebBrowserFindInFrames
134 * Controls how find behaves when multiple frames or iframes are present.
136 * Get by doing a QueryInterface from nsIWebBrowserFind.
141 [scriptable
, uuid(e0f5d182
-34bc
-11d5
-be5b
-b760676c6ebc
)]
142 interface nsIWebBrowserFindInFrames
: nsISupports
147 * Frame at which to start the search. Once the search is done, this will
148 * be set to be the last frame searched, whether or not a result was found.
149 * Has to be equal to or contained within the rootSearchFrame.
151 attribute nsIDOMWindow currentSearchFrame
;
156 * Frame within which to confine the search (normally the content area frame).
157 * Set this to only search a subtree of the frame hierarchy.
159 attribute nsIDOMWindow rootSearchFrame
;
164 * Whether to recurse down into subframes while searching. Default is true.
166 * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
168 attribute
boolean searchSubframes
;
173 * Whether to allow the search to propagate out of the currentSearchFrame into its
174 * parent frame(s). Search is always confined within the rootSearchFrame. Default
177 * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
179 attribute
boolean searchParentFrames
;