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: #include "nsISupports.idl" michael@0: michael@0: interface nsIAutoCompleteResult; michael@0: interface nsIAutoCompleteObserver; michael@0: michael@0: [scriptable, uuid(DE8DB85F-C1DE-4d87-94BA-7844890F91FE)] michael@0: interface nsIAutoCompleteSearch : nsISupports michael@0: { michael@0: /* michael@0: * Search for a given string and notify a listener (either synchronously michael@0: * or asynchronously) of the result michael@0: * michael@0: * @param searchString - The string to search for michael@0: * @param searchParam - An extra parameter michael@0: * @param previousResult - A previous result to use for faster searching michael@0: * @param listener - A listener to notify when the search is complete michael@0: */ michael@0: void startSearch(in AString searchString, michael@0: in AString searchParam, michael@0: in nsIAutoCompleteResult previousResult, michael@0: in nsIAutoCompleteObserver listener); michael@0: michael@0: /* michael@0: * Stop all searches that are in progress michael@0: */ michael@0: void stopSearch(); michael@0: }; michael@0: michael@0: [scriptable, uuid(8bd1dbbc-dcce-4007-9afa-b551eb687b61)] michael@0: interface nsIAutoCompleteObserver : nsISupports michael@0: { michael@0: /* michael@0: * Called when a search is complete and the results are ready michael@0: * michael@0: * @param search - The search object that processed this search michael@0: * @param result - The search result object michael@0: */ michael@0: void onSearchResult(in nsIAutoCompleteSearch search, in nsIAutoCompleteResult result); michael@0: michael@0: /* michael@0: * Called to update with new results michael@0: * michael@0: * @param search - The search object that processed this search michael@0: * @param result - The search result object michael@0: */ michael@0: void onUpdateSearchResult(in nsIAutoCompleteSearch search, in nsIAutoCompleteResult result); michael@0: }; michael@0: michael@0: [scriptable, uuid(02314d6e-b730-40cc-a215-221554d77064)] michael@0: interface nsIAutoCompleteSearchDescriptor : nsISupports michael@0: { michael@0: // The search is started after the timeout specified by the corresponding michael@0: // nsIAutoCompleteInput implementation. michael@0: const unsigned short SEARCH_TYPE_DELAYED = 0; michael@0: // The search is started synchronously, before any delayed searches. michael@0: const unsigned short SEARCH_TYPE_IMMEDIATE = 1; michael@0: michael@0: /** michael@0: * Identifies the search behavior. michael@0: * Should be one of the SEARCH_TYPE_* constants above. michael@0: * Defaults to SEARCH_TYPE_DELAYED. michael@0: */ michael@0: readonly attribute unsigned short searchType; michael@0: };