1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/xul/nsIDOMXULContainerElement.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsIDOMXULElement.idl" 1.10 +interface nsIDOMXULContainerElement; 1.11 + 1.12 +[scriptable, uuid(800a68c7-b854-4597-a436-3055ce5c5c96)] 1.13 +interface nsIDOMXULContainerItemElement : nsISupports 1.14 +{ 1.15 + /** 1.16 + * Returns the parent container if any. 1.17 + */ 1.18 + readonly attribute nsIDOMXULContainerElement parentContainer; 1.19 +}; 1.20 + 1.21 +[scriptable, uuid(b2bc96b8-31fc-42f4-937a-bd27291af40b)] 1.22 +interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement 1.23 +{ 1.24 + /** 1.25 + * Creates an item for the given label and value and appends it to the 1.26 + * container. 1.27 + * 1.28 + * @param aLabel - the label for the new item 1.29 + * @param aValue - the value of the new item 1.30 + */ 1.31 + nsIDOMXULElement appendItem(in DOMString aLabel, in DOMString aValue); 1.32 + 1.33 + /** 1.34 + * Creates an item for the given label and value and inserts it into the 1.35 + * container at the specified position. 1.36 + * 1.37 + * @param aIndex - the index where the new item will be inserted 1.38 + * @param aLabel - the label for the new item 1.39 + * @param aValue - the value of the new item 1.40 + */ 1.41 + nsIDOMXULElement insertItemAt(in long aIndex, in DOMString aLabel, 1.42 + in DOMString aValue); 1.43 + 1.44 + /** 1.45 + * Removes an item from the container. 1.46 + * 1.47 + * @param aIndex - index of the item to remove 1.48 + */ 1.49 + nsIDOMXULElement removeItemAt(in long aIndex); 1.50 + 1.51 + /** 1.52 + * Returns a count of items in the container. 1.53 + */ 1.54 + readonly attribute unsigned long itemCount; 1.55 + 1.56 + /** 1.57 + * Returns the index of an item or -1 if the item is not in the container. 1.58 + * 1.59 + * @param aItem - the item to determine the index of 1.60 + */ 1.61 + long getIndexOfItem(in nsIDOMXULElement aItem); 1.62 + 1.63 + /** 1.64 + * Returns the item at a given index or null if the item is not is the 1.65 + * container. 1.66 + * 1.67 + * @param aIndex - the index of the item to return 1.68 + */ 1.69 + nsIDOMXULElement getItemAtIndex(in long aIndex); 1.70 +}; 1.71 +