michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIAutoCompleteResult; michael@0: interface nsIFormAutoCompleteObserver; michael@0: interface nsIDOMHTMLInputElement; michael@0: michael@0: [scriptable, uuid(c079f18f-40ab-409d-800e-878889b83b58)] michael@0: michael@0: interface nsIFormAutoComplete: nsISupports { michael@0: michael@0: /** michael@0: * Generate results for a form input autocomplete menu synchronously. michael@0: * This method is deprecated in favour of autoCompleteSearchAsync. michael@0: */ michael@0: nsIAutoCompleteResult autoCompleteSearch(in AString aInputName, michael@0: in AString aSearchString, michael@0: in nsIDOMHTMLInputElement aField, michael@0: in nsIAutoCompleteResult aPreviousResult); michael@0: michael@0: /** michael@0: * Generate results for a form input autocomplete menu asynchronously. michael@0: */ michael@0: void autoCompleteSearchAsync(in AString aInputName, michael@0: in AString aSearchString, michael@0: in nsIDOMHTMLInputElement aField, michael@0: in nsIAutoCompleteResult aPreviousResult, michael@0: in nsIFormAutoCompleteObserver aListener); michael@0: michael@0: /** michael@0: * If a search is in progress, stop it. Otherwise, do nothing. This is used michael@0: * to cancel an existing search, for example, in preparation for a new search. michael@0: */ michael@0: void stopAutoCompleteSearch(); michael@0: }; michael@0: michael@0: [scriptable, function, uuid(604419ab-55a0-4831-9eca-1b9e67cc4751)] michael@0: interface nsIFormAutoCompleteObserver : nsISupports michael@0: { michael@0: /* michael@0: * Called when a search is complete and the results are ready even if the michael@0: * result set is empty. If the search is cancelled or a new search is michael@0: * started, this is not called. michael@0: * michael@0: * @param result - The search result object michael@0: */ michael@0: void onSearchCompletion(in nsIAutoCompleteResult result); michael@0: };