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
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIAutoCompleteResult; |
michael@0 | 9 | interface nsIFormAutoCompleteObserver; |
michael@0 | 10 | interface nsIDOMHTMLInputElement; |
michael@0 | 11 | |
michael@0 | 12 | [scriptable, uuid(c079f18f-40ab-409d-800e-878889b83b58)] |
michael@0 | 13 | |
michael@0 | 14 | interface nsIFormAutoComplete: nsISupports { |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * Generate results for a form input autocomplete menu synchronously. |
michael@0 | 18 | * This method is deprecated in favour of autoCompleteSearchAsync. |
michael@0 | 19 | */ |
michael@0 | 20 | nsIAutoCompleteResult autoCompleteSearch(in AString aInputName, |
michael@0 | 21 | in AString aSearchString, |
michael@0 | 22 | in nsIDOMHTMLInputElement aField, |
michael@0 | 23 | in nsIAutoCompleteResult aPreviousResult); |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * Generate results for a form input autocomplete menu asynchronously. |
michael@0 | 27 | */ |
michael@0 | 28 | void autoCompleteSearchAsync(in AString aInputName, |
michael@0 | 29 | in AString aSearchString, |
michael@0 | 30 | in nsIDOMHTMLInputElement aField, |
michael@0 | 31 | in nsIAutoCompleteResult aPreviousResult, |
michael@0 | 32 | in nsIFormAutoCompleteObserver aListener); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * If a search is in progress, stop it. Otherwise, do nothing. This is used |
michael@0 | 36 | * to cancel an existing search, for example, in preparation for a new search. |
michael@0 | 37 | */ |
michael@0 | 38 | void stopAutoCompleteSearch(); |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | [scriptable, function, uuid(604419ab-55a0-4831-9eca-1b9e67cc4751)] |
michael@0 | 42 | interface nsIFormAutoCompleteObserver : nsISupports |
michael@0 | 43 | { |
michael@0 | 44 | /* |
michael@0 | 45 | * Called when a search is complete and the results are ready even if the |
michael@0 | 46 | * result set is empty. If the search is cancelled or a new search is |
michael@0 | 47 | * started, this is not called. |
michael@0 | 48 | * |
michael@0 | 49 | * @param result - The search result object |
michael@0 | 50 | */ |
michael@0 | 51 | void onSearchCompletion(in nsIAutoCompleteResult result); |
michael@0 | 52 | }; |