2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsIDOMXULElement.idl"
|
2008-02-06 23:07:08 -08:00
|
|
|
interface nsIDOMXULContainerElement;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-04-11 14:55:21 -07:00
|
|
|
[scriptable, uuid(6B94FBAB-5171-432C-8E7A-6183C535E344)]
|
2008-02-06 23:07:08 -08:00
|
|
|
interface nsIDOMXULContainerItemElement : nsIDOMXULElement
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the parent container if any.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDOMXULContainerElement parentContainer;
|
|
|
|
};
|
|
|
|
|
2012-04-11 14:55:21 -07:00
|
|
|
[scriptable, uuid(40211F96-98A5-4DE5-BE0C-8CBF4CA4D615)]
|
2008-02-06 23:07:08 -08:00
|
|
|
interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Creates an item for the given label and value and appends it to the
|
|
|
|
* container.
|
|
|
|
*
|
|
|
|
* @param aLabel - the label for the new item
|
|
|
|
* @param aValue - the value of the new item
|
|
|
|
*/
|
|
|
|
nsIDOMXULElement appendItem(in DOMString aLabel, in DOMString aValue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates an item for the given label and value and inserts it into the
|
|
|
|
* container at the specified position.
|
|
|
|
*
|
|
|
|
* @param aIndex - the index where the new item will be inserted
|
|
|
|
* @param aLabel - the label for the new item
|
|
|
|
* @param aValue - the value of the new item
|
|
|
|
*/
|
|
|
|
nsIDOMXULElement insertItemAt(in long aIndex, in DOMString aLabel,
|
|
|
|
in DOMString aValue);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes an item from the container.
|
|
|
|
*
|
|
|
|
* @param aIndex - index of the item to remove
|
|
|
|
*/
|
|
|
|
nsIDOMXULElement removeItemAt(in long aIndex);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a count of items in the container.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long itemCount;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the index of an item or -1 if the item is not in the container.
|
|
|
|
*
|
|
|
|
* @param aItem - the item to determine the index of
|
|
|
|
*/
|
|
|
|
long getIndexOfItem(in nsIDOMXULElement aItem);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the item at a given index or null if the item is not is the
|
|
|
|
* container.
|
|
|
|
*
|
|
|
|
* @param aIndex - the index of the item to return
|
|
|
|
*/
|
|
|
|
nsIDOMXULElement getItemAtIndex(in long aIndex);
|
|
|
|
};
|
2008-02-06 23:07:08 -08:00
|
|
|
|