michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 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 nsIAccessible; michael@0: interface nsIArray; michael@0: michael@0: /** michael@0: * An accessibility interface for selectable widgets. michael@0: */ michael@0: [scriptable, uuid(3e507fc4-4fcc-4223-a674-a095f591eba1)] michael@0: interface nsIAccessibleSelectable : nsISupports michael@0: { michael@0: /** michael@0: * Return an nsIArray of selected items within the widget. michael@0: */ michael@0: readonly attribute nsIArray selectedItems; michael@0: michael@0: /** michael@0: * Return the number of currently selected items. michael@0: */ michael@0: readonly attribute unsigned long selectedItemCount; michael@0: michael@0: /** michael@0: * Return a nth selected item within the widget. michael@0: */ michael@0: nsIAccessible getSelectedItemAt(in unsigned long index); michael@0: michael@0: /** michael@0: * Return true if the given item is selected. michael@0: */ michael@0: [binaryname(ScriptableIsItemSelected)] michael@0: boolean isItemSelected(in unsigned long index); michael@0: michael@0: /** michael@0: * Adds the specified item to the widget's selection. michael@0: */ michael@0: [binaryname(ScriptableAddItemToSelection)] michael@0: void addItemToSelection(in unsigned long index); michael@0: michael@0: /** michael@0: * Removes the specified item from the widget's selection. michael@0: */ michael@0: [binaryname(ScriptableRemoveItemFromSelection)] michael@0: void removeItemFromSelection(in unsigned long index); michael@0: michael@0: /** michael@0: * Select all items. michael@0: * michael@0: * @return false if the object does not accept multiple selection, michael@0: * otherwise true. michael@0: */ michael@0: [binaryname(ScriptableSelectAll)] michael@0: boolean selectAll(); michael@0: michael@0: /** michael@0: * Unselect all items. michael@0: */ michael@0: [binaryname(ScriptableUnselectAll)] michael@0: void unselectAll(); michael@0: };