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 nsIDOMElement; michael@0: interface nsIAutoCompleteInput; michael@0: michael@0: [scriptable, uuid(1b9d7d8a-6dd0-11dc-8314-0800200c9a66)] michael@0: interface nsIAutoCompletePopup : nsISupports michael@0: { michael@0: /* michael@0: * The input object that the popup is currently bound to michael@0: */ michael@0: readonly attribute nsIAutoCompleteInput input; michael@0: michael@0: /* michael@0: * An alternative value to be used when text is entered, rather than the michael@0: * value of the selected item michael@0: */ michael@0: readonly attribute AString overrideValue; michael@0: michael@0: /* michael@0: * The index of the result item that is currently selected michael@0: */ michael@0: attribute long selectedIndex; michael@0: michael@0: /* michael@0: * Indicates if the popup is currently open michael@0: */ michael@0: readonly attribute boolean popupOpen; michael@0: michael@0: /* michael@0: * Bind the popup to an input object and display it with the given coordinates michael@0: * michael@0: * @param input - The input object that the popup will be bound to michael@0: * @param element - The element that the popup will be aligned with michael@0: */ michael@0: void openAutocompletePopup(in nsIAutoCompleteInput input, in nsIDOMElement element); michael@0: michael@0: /* michael@0: * Close the popup and detach from the bound input michael@0: */ michael@0: void closePopup(); michael@0: michael@0: /* michael@0: * Instruct the result view to repaint itself to reflect the most current michael@0: * underlying data michael@0: */ michael@0: void invalidate(); michael@0: michael@0: /* michael@0: * Change the selection relative to the current selection and make sure michael@0: * the newly selected row is visible michael@0: * michael@0: * @param reverse - Select a row above the current selection michael@0: * @param page - Select a row that is a full visible page from the current selection michael@0: * @return The currently selected result item index michael@0: */ michael@0: void selectBy(in boolean reverse, in boolean page); michael@0: };