Back to index

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

#include <nsTreeColumns.h>

Inheritance diagram for nsTreeColumns:
Inheritance graph
Collaboration diagram for nsTreeColumns:
Collaboration graph

List of all members.

Public Member Functions

 nsTreeColumns (nsITreeBoxObject *aTree)
 ~nsTreeColumns ()
nsITreeColumn getFirstColumn ()
 Get the first/last column.
nsITreeColumn getLastColumn ()
nsITreeColumn getPrimaryColumn ()
 Attribute based column getters.
nsITreeColumn getSortedColumn ()
nsITreeColumn getKeyColumn ()
nsITreeColumn getColumnFor (in nsIDOMElement element)
 Get the column for the given element.
nsITreeColumn getNamedColumn (in AString id)
 Parametric column getters.
nsITreeColumn getColumnAt (in long index)
void invalidateColumns ()
 This method is called whenever a treecol is added or removed and the column cache needs to be rebuilt.
void restoreNaturalOrder ()

Public Attributes

NS_DECL_ISUPPORTS friend class nsTreeBodyFrame
readonly attribute nsITreeBoxObject tree
 The tree widget for these columns.
readonly attribute long count
 The number of columns.

Protected Member Functions

void SetTree (nsITreeBoxObject *aTree)
void EnsureColumns ()
nsTreeColumnGetFirstColumn ()
nsTreeColumnGetPrimaryColumn ()

Private Attributes


Detailed Description

Definition at line 115 of file nsTreeColumns.h.

Constructor & Destructor Documentation

Definition at line 256 of file nsTreeColumns.cpp.

  : mTree(aTree),

Definition at line 262 of file nsTreeColumns.cpp.

  for (nsTreeColumn* currCol = mFirstColumn; currCol; currCol = currCol->GetNext()) {

Here is the call graph for this function:

Member Function Documentation

Definition at line 490 of file nsTreeColumns.cpp.

  if (mTree && !mFirstColumn) {
    nsCOMPtr<nsIBoxObject> boxObject = do_QueryInterface(mTree);
    nsCOMPtr<nsIDOMElement> treeElement;
    nsCOMPtr<nsIContent> treeContent = do_QueryInterface(treeElement);

    nsCOMPtr<nsIContent> colsContent;
    nsTreeUtils::GetDescendantChild(treeContent, nsXULAtoms::treecols, getter_AddRefs(colsContent));
    if (!colsContent)

    nsCOMPtr<nsIDocument> document = treeContent->GetDocument();
    nsIPresShell *shell = document->GetShellAt(0);
    if (!shell)

    nsIFrame* colsFrame = nsnull;
    shell->GetPrimaryFrameFor(colsContent, &colsFrame);
    if (!colsFrame)

    nsIBox* colBox = nsnull;

    nsTreeColumn* currCol = nsnull;
    while (colBox) {
      nsIContent* colContent = colBox->GetContent();

      nsINodeInfo *ni = colContent->GetNodeInfo();
      if (ni && ni->Equals(nsXULAtoms::treecol, kNameSpaceID_XUL)) { 
        // Create a new column structure.
        nsTreeColumn* col = new nsTreeColumn(this, colBox);
        if (!col)

        if (currCol) {
        else {
          NS_ADDREF(mFirstColumn = col);
        currCol = col;


Here is the call graph for this function:

Here is the caller graph for this function:

Get the column for the given element.

Get the first/last column.

Definition at line 130 of file nsTreeColumns.h.

{ EnsureColumns(); return mFirstColumn; };

Here is the call graph for this function:

nsITreeColumn nsITreeColumns::getNamedColumn ( in AString  id) [inherited]

Parametric column getters.

Attribute based column getters.

Definition at line 323 of file nsTreeColumns.cpp.

  NS_IF_ADDREF(*_retval = GetPrimaryColumn());
  return NS_OK;

This method is called whenever a treecol is added or removed and the column cache needs to be rebuilt.

void nsTreeColumns::SetTree ( nsITreeBoxObject aTree) [inline, protected]

Definition at line 125 of file nsTreeColumns.h.

{ mTree = aTree; };

Member Data Documentation

readonly attribute long nsITreeColumns::count [inherited]

The number of columns.

Definition at line 86 of file nsITreeColumns.idl.

Definition at line 136 of file nsTreeColumns.h.

Definition at line 134 of file nsTreeColumns.h.

Definition at line 123 of file nsTreeColumns.h.

The tree widget for these columns.

Definition at line 81 of file nsITreeColumns.idl.

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