toolkit/components/satchel/nsIFormAutoComplete.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/satchel/nsIFormAutoComplete.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     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 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIAutoCompleteResult;
    1.12 +interface nsIFormAutoCompleteObserver;
    1.13 +interface nsIDOMHTMLInputElement;
    1.14 +
    1.15 +[scriptable, uuid(c079f18f-40ab-409d-800e-878889b83b58)]
    1.16 +
    1.17 +interface nsIFormAutoComplete: nsISupports {
    1.18 +
    1.19 +    /**
    1.20 +     * Generate results for a form input autocomplete menu synchronously.
    1.21 +     * This method is deprecated in favour of autoCompleteSearchAsync.
    1.22 +     */
    1.23 +    nsIAutoCompleteResult autoCompleteSearch(in AString aInputName,
    1.24 +                                             in AString aSearchString,
    1.25 +                                             in nsIDOMHTMLInputElement aField,
    1.26 +                                             in nsIAutoCompleteResult aPreviousResult);
    1.27 +
    1.28 +    /**
    1.29 +     * Generate results for a form input autocomplete menu asynchronously.
    1.30 +     */
    1.31 +    void autoCompleteSearchAsync(in AString aInputName,
    1.32 +                                 in AString aSearchString,
    1.33 +                                 in nsIDOMHTMLInputElement aField,
    1.34 +                                 in nsIAutoCompleteResult aPreviousResult,
    1.35 +                                 in nsIFormAutoCompleteObserver aListener);
    1.36 +
    1.37 +    /**
    1.38 +     * If a search is in progress, stop it. Otherwise, do nothing. This is used
    1.39 +     * to cancel an existing search, for example, in preparation for a new search.
    1.40 +     */
    1.41 +    void stopAutoCompleteSearch();
    1.42 +};
    1.43 +
    1.44 +[scriptable, function, uuid(604419ab-55a0-4831-9eca-1b9e67cc4751)]
    1.45 +interface nsIFormAutoCompleteObserver : nsISupports
    1.46 +{
    1.47 +  /*
    1.48 +   * Called when a search is complete and the results are ready even if the
    1.49 +   * result set is empty. If the search is cancelled or a new search is
    1.50 +   * started, this is not called.
    1.51 +   *
    1.52 +   * @param result - The search result object
    1.53 +   */
    1.54 +  void onSearchCompletion(in nsIAutoCompleteResult result);
    1.55 +};

mercurial