michael@0: /* -*- Mode: IDL; 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 "nsIDOMXULElement.idl" michael@0: interface nsIDOMXULContainerElement; michael@0: michael@0: [scriptable, uuid(800a68c7-b854-4597-a436-3055ce5c5c96)] michael@0: interface nsIDOMXULContainerItemElement : nsISupports michael@0: { michael@0: /** michael@0: * Returns the parent container if any. michael@0: */ michael@0: readonly attribute nsIDOMXULContainerElement parentContainer; michael@0: }; michael@0: michael@0: [scriptable, uuid(b2bc96b8-31fc-42f4-937a-bd27291af40b)] michael@0: interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement michael@0: { michael@0: /** michael@0: * Creates an item for the given label and value and appends it to the michael@0: * container. michael@0: * michael@0: * @param aLabel - the label for the new item michael@0: * @param aValue - the value of the new item michael@0: */ michael@0: nsIDOMXULElement appendItem(in DOMString aLabel, in DOMString aValue); michael@0: michael@0: /** michael@0: * Creates an item for the given label and value and inserts it into the michael@0: * container at the specified position. michael@0: * michael@0: * @param aIndex - the index where the new item will be inserted michael@0: * @param aLabel - the label for the new item michael@0: * @param aValue - the value of the new item michael@0: */ michael@0: nsIDOMXULElement insertItemAt(in long aIndex, in DOMString aLabel, michael@0: in DOMString aValue); michael@0: michael@0: /** michael@0: * Removes an item from the container. michael@0: * michael@0: * @param aIndex - index of the item to remove michael@0: */ michael@0: nsIDOMXULElement removeItemAt(in long aIndex); michael@0: michael@0: /** michael@0: * Returns a count of items in the container. michael@0: */ michael@0: readonly attribute unsigned long itemCount; michael@0: michael@0: /** michael@0: * Returns the index of an item or -1 if the item is not in the container. michael@0: * michael@0: * @param aItem - the item to determine the index of michael@0: */ michael@0: long getIndexOfItem(in nsIDOMXULElement aItem); michael@0: michael@0: /** michael@0: * Returns the item at a given index or null if the item is not is the michael@0: * container. michael@0: * michael@0: * @param aIndex - the index of the item to return michael@0: */ michael@0: nsIDOMXULElement getItemAtIndex(in long aIndex); michael@0: }; michael@0: