|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 interface nsAString; |
|
9 interface inISearchObserver; |
|
10 |
|
11 [scriptable, uuid(D5FA765B-2448-4686-B7C1-5FF13ACB0FC9)] |
|
12 interface inISearchProcess : nsISupports |
|
13 { |
|
14 // indicates if an asynchronous search is in progress |
|
15 readonly attribute boolean isActive; |
|
16 |
|
17 // the number of results returned |
|
18 readonly attribute long resultCount; |
|
19 |
|
20 // for optimization when doing an async search, this will optionally |
|
21 // destroy old results, assuming they will be fetched as soon as |
|
22 // the observer is notified of their presence. If true, then indices |
|
23 // pass to the get*ResultAt methods will return null for any index |
|
24 // other than the most recent one, and getResults will return null always. |
|
25 attribute boolean holdResults; |
|
26 |
|
27 // start a synchronous search |
|
28 void searchSync(); |
|
29 |
|
30 // start an asynchronous search |
|
31 void searchAsync(in inISearchObserver aObserver); |
|
32 |
|
33 // command an async process to stop immediately |
|
34 void searchStop(); |
|
35 |
|
36 // performs a step in the asynchronous search loop |
|
37 // return indicates true if loop is done, false if it should continue |
|
38 // This is there only for the benefit of asynchronous search controllers, |
|
39 // and is not for use by those who just wish to call searchAsync |
|
40 boolean searchStep(); |
|
41 |
|
42 // methods for getting results of specific types |
|
43 |
|
44 AString getStringResultAt(in long aIndex); |
|
45 |
|
46 long getIntResultAt(in long aIndex); |
|
47 |
|
48 unsigned long getUIntResultAt(in long aIndex); |
|
49 }; |