Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/. */
6 #include "nsISupports.idl"
8 interface nsIAutoCompleteResult;
9 interface nsIFormAutoCompleteObserver;
10 interface nsIDOMHTMLInputElement;
12 [scriptable, uuid(c079f18f-40ab-409d-800e-878889b83b58)]
14 interface nsIFormAutoComplete: nsISupports {
16 /**
17 * Generate results for a form input autocomplete menu synchronously.
18 * This method is deprecated in favour of autoCompleteSearchAsync.
19 */
20 nsIAutoCompleteResult autoCompleteSearch(in AString aInputName,
21 in AString aSearchString,
22 in nsIDOMHTMLInputElement aField,
23 in nsIAutoCompleteResult aPreviousResult);
25 /**
26 * Generate results for a form input autocomplete menu asynchronously.
27 */
28 void autoCompleteSearchAsync(in AString aInputName,
29 in AString aSearchString,
30 in nsIDOMHTMLInputElement aField,
31 in nsIAutoCompleteResult aPreviousResult,
32 in nsIFormAutoCompleteObserver aListener);
34 /**
35 * If a search is in progress, stop it. Otherwise, do nothing. This is used
36 * to cancel an existing search, for example, in preparation for a new search.
37 */
38 void stopAutoCompleteSearch();
39 };
41 [scriptable, function, uuid(604419ab-55a0-4831-9eca-1b9e67cc4751)]
42 interface nsIFormAutoCompleteObserver : nsISupports
43 {
44 /*
45 * Called when a search is complete and the results are ready even if the
46 * result set is empty. If the search is cancelled or a new search is
47 * started, this is not called.
48 *
49 * @param result - The search result object
50 */
51 void onSearchCompletion(in nsIAutoCompleteResult result);
52 };