toolkit/components/autocomplete/nsIAutoCompletePopup.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/autocomplete/nsIAutoCompletePopup.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     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 nsIDOMElement;
    1.11 +interface nsIAutoCompleteInput;
    1.12 +
    1.13 +[scriptable, uuid(1b9d7d8a-6dd0-11dc-8314-0800200c9a66)]
    1.14 +interface nsIAutoCompletePopup : nsISupports
    1.15 +{
    1.16 +  /*
    1.17 +   * The input object that the popup is currently bound to
    1.18 +   */
    1.19 +  readonly attribute nsIAutoCompleteInput input;
    1.20 +
    1.21 +  /*
    1.22 +   * An alternative value to be used when text is entered, rather than the
    1.23 +   * value of the selected item
    1.24 +   */
    1.25 +  readonly attribute AString overrideValue;
    1.26 +
    1.27 +  /*
    1.28 +   * The index of the result item that is currently selected
    1.29 +   */
    1.30 +  attribute long selectedIndex;
    1.31 +
    1.32 +  /* 
    1.33 +   * Indicates if the popup is currently open
    1.34 +   */
    1.35 +  readonly attribute boolean popupOpen;
    1.36 +
    1.37 +  /* 
    1.38 +   * Bind the popup to an input object and display it with the given coordinates
    1.39 +   *
    1.40 +   * @param input - The input object that the popup will be bound to
    1.41 +   * @param element - The element that the popup will be aligned with
    1.42 +   */
    1.43 +  void openAutocompletePopup(in nsIAutoCompleteInput input, in nsIDOMElement element);
    1.44 +
    1.45 +  /* 
    1.46 +   * Close the popup and detach from the bound input
    1.47 +   */
    1.48 +  void closePopup();
    1.49 +
    1.50 +  /*
    1.51 +   * Instruct the result view to repaint itself to reflect the most current
    1.52 +   * underlying data
    1.53 +   */
    1.54 +  void invalidate();
    1.55 +    
    1.56 +  /*
    1.57 +   * Change the selection relative to the current selection and make sure
    1.58 +   * the newly selected row is visible
    1.59 +   *
    1.60 +   * @param reverse - Select a row above the current selection
    1.61 +   * @param page - Select a row that is a full visible page from the current selection
    1.62 +   * @return The currently selected result item index
    1.63 +   */
    1.64 +  void selectBy(in boolean reverse, in boolean page);
    1.65 +};

mercurial