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/. */
5 #include
"nsISupports.idl"
7 interface nsIAutoCompleteResult
;
8 interface nsIAutoCompleteObserver
;
10 [scriptable
, uuid(DE8DB85F
-C1DE
-4d87
-94BA
-7844890F91FE
)]
11 interface nsIAutoCompleteSearch
: nsISupports
14 * Search for a given string and notify a listener (either synchronously
15 * or asynchronously) of the result
17 * @param searchString - The string to search for
18 * @param searchParam - An extra parameter
19 * @param previousResult - A previous result to use for faster searching
20 * @param listener - A listener to notify when the search is complete
22 void startSearch
(in AString searchString
,
23 in AString searchParam
,
24 in nsIAutoCompleteResult previousResult
,
25 in nsIAutoCompleteObserver listener
);
28 * Stop all searches that are in progress
33 [scriptable
, uuid(8bd1dbbc
-dcce
-4007-9afa
-b551eb687b61
)]
34 interface nsIAutoCompleteObserver
: nsISupports
37 * Called when a search is complete and the results are ready
39 * @param search - The search object that processed this search
40 * @param result - The search result object
42 void onSearchResult
(in nsIAutoCompleteSearch search
, in nsIAutoCompleteResult result
);
45 * Called to update with new results
47 * @param search - The search object that processed this search
48 * @param result - The search result object
50 void onUpdateSearchResult
(in nsIAutoCompleteSearch search
, in nsIAutoCompleteResult result
);
53 [scriptable
, uuid(02314d6e
-b730
-40cc
-a215
-221554d77064
)]
54 interface nsIAutoCompleteSearchDescriptor
: nsISupports
56 // The search is started after the timeout specified by the corresponding
57 // nsIAutoCompleteInput implementation.
58 const unsigned short SEARCH_TYPE_DELAYED
= 0;
59 // The search is started synchronously, before any delayed searches.
60 const unsigned short SEARCH_TYPE_IMMEDIATE
= 1;
63 * Identifies the search behavior.
64 * Should be one of the SEARCH_TYPE_* constants above.
65 * Defaults to SEARCH_TYPE_DELAYED.
67 readonly attribute
unsigned short searchType
;