Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsIDOMXULElement.idl"
7 interface nsIDOMXULContainerElement;
9 [scriptable, uuid(800a68c7-b854-4597-a436-3055ce5c5c96)]
10 interface nsIDOMXULContainerItemElement : nsISupports
11 {
12 /**
13 * Returns the parent container if any.
14 */
15 readonly attribute nsIDOMXULContainerElement parentContainer;
16 };
18 [scriptable, uuid(b2bc96b8-31fc-42f4-937a-bd27291af40b)]
19 interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement
20 {
21 /**
22 * Creates an item for the given label and value and appends it to the
23 * container.
24 *
25 * @param aLabel - the label for the new item
26 * @param aValue - the value of the new item
27 */
28 nsIDOMXULElement appendItem(in DOMString aLabel, in DOMString aValue);
30 /**
31 * Creates an item for the given label and value and inserts it into the
32 * container at the specified position.
33 *
34 * @param aIndex - the index where the new item will be inserted
35 * @param aLabel - the label for the new item
36 * @param aValue - the value of the new item
37 */
38 nsIDOMXULElement insertItemAt(in long aIndex, in DOMString aLabel,
39 in DOMString aValue);
41 /**
42 * Removes an item from the container.
43 *
44 * @param aIndex - index of the item to remove
45 */
46 nsIDOMXULElement removeItemAt(in long aIndex);
48 /**
49 * Returns a count of items in the container.
50 */
51 readonly attribute unsigned long itemCount;
53 /**
54 * Returns the index of an item or -1 if the item is not in the container.
55 *
56 * @param aItem - the item to determine the index of
57 */
58 long getIndexOfItem(in nsIDOMXULElement aItem);
60 /**
61 * Returns the item at a given index or null if the item is not is the
62 * container.
63 *
64 * @param aIndex - the index of the item to return
65 */
66 nsIDOMXULElement getItemAtIndex(in long aIndex);
67 };