1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/autocomplete/nsIAutoCompleteSearch.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +interface nsIAutoCompleteResult; 1.11 +interface nsIAutoCompleteObserver; 1.12 + 1.13 +[scriptable, uuid(DE8DB85F-C1DE-4d87-94BA-7844890F91FE)] 1.14 +interface nsIAutoCompleteSearch : nsISupports 1.15 +{ 1.16 + /* 1.17 + * Search for a given string and notify a listener (either synchronously 1.18 + * or asynchronously) of the result 1.19 + * 1.20 + * @param searchString - The string to search for 1.21 + * @param searchParam - An extra parameter 1.22 + * @param previousResult - A previous result to use for faster searching 1.23 + * @param listener - A listener to notify when the search is complete 1.24 + */ 1.25 + void startSearch(in AString searchString, 1.26 + in AString searchParam, 1.27 + in nsIAutoCompleteResult previousResult, 1.28 + in nsIAutoCompleteObserver listener); 1.29 + 1.30 + /* 1.31 + * Stop all searches that are in progress 1.32 + */ 1.33 + void stopSearch(); 1.34 +}; 1.35 + 1.36 +[scriptable, uuid(8bd1dbbc-dcce-4007-9afa-b551eb687b61)] 1.37 +interface nsIAutoCompleteObserver : nsISupports 1.38 +{ 1.39 + /* 1.40 + * Called when a search is complete and the results are ready 1.41 + * 1.42 + * @param search - The search object that processed this search 1.43 + * @param result - The search result object 1.44 + */ 1.45 + void onSearchResult(in nsIAutoCompleteSearch search, in nsIAutoCompleteResult result); 1.46 + 1.47 + /* 1.48 + * Called to update with new results 1.49 + * 1.50 + * @param search - The search object that processed this search 1.51 + * @param result - The search result object 1.52 + */ 1.53 + void onUpdateSearchResult(in nsIAutoCompleteSearch search, in nsIAutoCompleteResult result); 1.54 +}; 1.55 + 1.56 +[scriptable, uuid(02314d6e-b730-40cc-a215-221554d77064)] 1.57 +interface nsIAutoCompleteSearchDescriptor : nsISupports 1.58 +{ 1.59 + // The search is started after the timeout specified by the corresponding 1.60 + // nsIAutoCompleteInput implementation. 1.61 + const unsigned short SEARCH_TYPE_DELAYED = 0; 1.62 + // The search is started synchronously, before any delayed searches. 1.63 + const unsigned short SEARCH_TYPE_IMMEDIATE = 1; 1.64 + 1.65 + /** 1.66 + * Identifies the search behavior. 1.67 + * Should be one of the SEARCH_TYPE_* constants above. 1.68 + * Defaults to SEARCH_TYPE_DELAYED. 1.69 + */ 1.70 + readonly attribute unsigned short searchType; 1.71 +};