Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
TableRowsCollection Class Reference

This class provides a late-bound collection of rows in a table. More...

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

List of all members.

Public Member Functions

 TableRowsCollection (nsHTMLTableElement *aParent)
virtual ~TableRowsCollection ()
NS_IMETHOD GetLength (PRUint32 *aLength)
NS_IMETHOD Item (PRUint32 aIndex, nsIDOMNode **aReturn)
NS_IMETHOD NamedItem (const nsAString &aName, nsIDOMNode **aReturn)
NS_IMETHOD ParentDestroyed ()
nsIDOMNode item (in unsigned long index)
nsIDOMNode namedItem (in DOMString name)

Public Attributes

readonly attribute unsigned long length

Protected Attributes

nsHTMLTableElementmParent

Detailed Description

This class provides a late-bound collection of rows in a table.

mParent is NOT ref-counted to avoid circular references

Definition at line 103 of file nsHTMLTableElement.cpp.


Constructor & Destructor Documentation

Definition at line 121 of file nsHTMLTableElement.cpp.

  : nsGenericDOMHTMLCollection()
{
  mParent = aParent;
}

Definition at line 127 of file nsHTMLTableElement.cpp.

{
  // we do NOT have a ref-counted reference to mParent, so do NOT
  // release it!  this is to avoid circular references.  The
  // instantiator who provided mParent is responsible for managing our
  // reference for us.
}

Member Function Documentation

Implements nsGenericDOMHTMLCollection.

Definition at line 198 of file nsHTMLTableElement.cpp.

{
  *aLength=0;
  nsresult rv = NS_OK;

  DO_FOR_EACH_ROWGROUP(
    *aLength += CountRowsInRowGroup(rowGroup);
  );

  return rv;
}

Here is the call graph for this function:

nsIDOMNode nsIDOMHTMLCollection::item ( in unsigned long  index) [inherited]
NS_IMETHODIMP TableRowsCollection::Item ( PRUint32  aIndex,
nsIDOMNode **  aReturn 
) [virtual]

Implements nsGenericDOMHTMLCollection.

Definition at line 238 of file nsHTMLTableElement.cpp.

{
  *aReturn = nsnull;
  nsresult rv = NS_OK;

  DO_FOR_EACH_ROWGROUP(
    PRUint32 count = GetItemOrCountInRowGroup(rowGroup, aIndex, aReturn);
    if (*aReturn) {
      return NS_OK; 
    }

    NS_ASSERTION(count <= aIndex, "GetItemOrCountInRowGroup screwed up");
    aIndex -= count;
  );

  return rv;
}

Here is the call graph for this function:

nsIDOMNode nsIDOMHTMLCollection::namedItem ( in DOMString  name) [inherited]
NS_IMETHODIMP TableRowsCollection::NamedItem ( const nsAString &  aName,
nsIDOMNode **  aReturn 
) [virtual]

Implements nsGenericDOMHTMLCollection.

Definition at line 273 of file nsHTMLTableElement.cpp.

{
  *aReturn = nsnull;
  nsresult rv = NS_OK;
  DO_FOR_EACH_ROWGROUP(
    rv = GetNamedItemInRowGroup(rowGroup, aName, aReturn);
    NS_ENSURE_SUCCESS(rv, rv);
    if (*aReturn) {
      return rv;
    }
  );
  return rv;
}

Here is the call graph for this function:

Definition at line 289 of file nsHTMLTableElement.cpp.

{
  // see comment in destructor, do NOT release mParent!
  mParent = nsnull;

  return NS_OK;
}

Here is the caller graph for this function:


Member Data Documentation

readonly attribute unsigned long nsIDOMHTMLCollection::length [inherited]

Definition at line 55 of file nsIDOMHTMLCollection.idl.

Definition at line 117 of file nsHTMLTableElement.cpp.


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