Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsISelectElement Interface Reference

This interface is used to notify a SELECT when OPTION elements are added and removed from its subtree. More...

import "nsISelectElement.idl";

Inheritance diagram for nsISelectElement:
Inheritance graph
[legend]
Collaboration diagram for nsISelectElement:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void willAddOptions (in nsIContent aOptions, in nsIContent aParent, in long aContentIndex)
 To be called when stuff is added under a child of the select--but before they are actually added.
void willRemoveOptions (in nsIContent aParent, in long aContentIndex)
 To be called when stuff is removed under a child of the select--but before they are actually removed.
boolean isOptionDisabled (in long aIndex)
 Checks whether an option is disabled (even if it's part of an optgroup)
boolean setOptionsSelectedByIndex (in long aStartIndex, in long aEndIndex, in boolean aIsSelected, in boolean aClearAll, in boolean aSetDisabled, in boolean aNotify)
 Sets multiple options (or just sets startIndex if select is single) and handles notifications and cleanup and everything under the sun.
long getOptionIndex (in nsIDOMHTMLOptionElement aOption, in long aStartIndex, in boolean aForward)
 Finds the index of a given option element.

Public Attributes

readonly attribute boolean hasOptGroups
 Whether or not there are optgroups in this select.

Detailed Description

This interface is used to notify a SELECT when OPTION elements are added and removed from its subtree.

Note that the nsIDOMHTMLSelectElement and nsIContent interfaces are the ones to use to access and enumerate OPTIONs within a SELECT element.

Definition at line 53 of file nsISelectElement.idl.


Member Function Documentation

long nsISelectElement::getOptionIndex ( in nsIDOMHTMLOptionElement  aOption,
in long  aStartIndex,
in boolean  aForward 
)

Finds the index of a given option element.

Parameters:
aOptionthe option to get the index of
aStartIndexthe index to start looking at
aForwardTRUE to look forward, FALSE to look backward
Returns:
the option index

Checks whether an option is disabled (even if it's part of an optgroup)

Parameters:
aIndexthe index of the option to check
Returns:
whether the option is disabled
boolean nsISelectElement::setOptionsSelectedByIndex ( in long  aStartIndex,
in long  aEndIndex,
in boolean  aIsSelected,
in boolean  aClearAll,
in boolean  aSetDisabled,
in boolean  aNotify 
)

Sets multiple options (or just sets startIndex if select is single) and handles notifications and cleanup and everything under the sun.

When this method exits, the select will be in a consistent state. i.e. if you set the last option to false, it will select an option anyway.

Parameters:
aStartIndexthe first index to set
aEndIndexthe last index to set (set same as first index for one option)
aIsSelectedwhether to set the option(s) to true or false
aClearAllwhether to clear all other options (for example, if you are normal-clicking on the current option)
aSetDisabledwhether it is permissible to set disabled options (for JavaScript)
aNotifywhether to notify frames and such
Returns:
whether any options were actually changed
void nsISelectElement::willAddOptions ( in nsIContent  aOptions,
in nsIContent  aParent,
in long  aContentIndex 
)

To be called when stuff is added under a child of the select--but before they are actually added.

Parameters:
aOptionsthe content that was added (usually just an option, but could be an optgroup node with many child options)
aParentthe parent the options were added to (could be an optgroup)
aContentIndexthe index where the options are being added within the parent (if the parent is an optgroup, the index within the optgroup)
void nsISelectElement::willRemoveOptions ( in nsIContent  aParent,
in long  aContentIndex 
)

To be called when stuff is removed under a child of the select--but before they are actually removed.

Parameters:
aParentthe parent the option(s) are being removed from
aContentIndexthe index of the option(s) within the parent (if the parent is an optgroup, the index within the optgroup)

Member Data Documentation

Whether or not there are optgroups in this select.

Definition at line 125 of file nsISelectElement.idl.


The documentation for this interface was generated from the following file: