Back to index

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

#include <inDeepTreeWalker.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIDOMTREEWALKER
NS_DECL_INIDEEPTREEWALKER 
inDeepTreeWalker ()
virtual ~inDeepTreeWalker ()
void init (in nsIDOMNode aRoot, in unsigned long aWhatToShow)
nsIDOMNode parentNode ()
nsIDOMNode firstChild ()
nsIDOMNode lastChild ()
nsIDOMNode previousSibling ()
nsIDOMNode nextSibling ()
nsIDOMNode previousNode ()
nsIDOMNode nextNode ()

Public Attributes

attribute boolean showAnonymousContent
attribute boolean showSubDocuments
readonly attribute nsIDOMNode root
readonly attribute unsigned long whatToShow
readonly attribute nsIDOMNodeFilter filter
readonly attribute boolean expandEntityReferences
attribute nsIDOMNode currentNode

Protected Member Functions

void PushNode (nsIDOMNode *aNode)

Protected Attributes

PRBool mShowAnonymousContent
PRBool mShowSubDocuments
nsCOMPtr< nsIDOMNodemRoot
nsCOMPtr< nsIDOMNodemCurrentNode
PRUint32 mWhatToShow
nsAutoVoidArray mStack
nsCOMPtr< inIDOMUtilsmDOMUtils

Detailed Description

Definition at line 49 of file inDeepTreeWalker.h.


Constructor & Destructor Documentation

Definition at line 77 of file inDeepTreeWalker.cpp.

{ 
  for (PRInt32 i = mStack.Count() - 1; i >= 0; --i) {
    delete NS_STATIC_CAST(DeepTreeStackItem*, mStack[i]);
  }
}

Member Function Documentation

void inIDeepTreeWalker::init ( in nsIDOMNode  aRoot,
in unsigned long  aWhatToShow 
) [inherited]
void inDeepTreeWalker::PushNode ( nsIDOMNode aNode) [protected]

Definition at line 257 of file inDeepTreeWalker.cpp.

{
  mCurrentNode = aNode;
  if (!aNode) return;

  DeepTreeStackItem* item = new DeepTreeStackItem();
  item->node = aNode;

  nsCOMPtr<nsIDOMNodeList> kids;
  if (mShowSubDocuments) {
    nsCOMPtr<nsIDOMDocument> domdoc = inLayoutUtils::GetSubDocumentFor(aNode);
    if (domdoc) {
      domdoc->GetChildNodes(getter_AddRefs(kids));
    }
  }
  
  if (!kids) {
    if (mShowAnonymousContent) {
      nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
      nsCOMPtr<nsIBindingManager> bindingManager;
      if (content &&
          (bindingManager = inLayoutUtils::GetBindingManagerFor(aNode))) {
        bindingManager->GetAnonymousNodesFor(content, getter_AddRefs(kids));
        if (!kids)
          bindingManager->GetContentListFor(content, getter_AddRefs(kids));
      } else {
        aNode->GetChildNodes(getter_AddRefs(kids));
      }
    } else
      aNode->GetChildNodes(getter_AddRefs(kids));
  }
  
  item->kids = kids;
  item->lastIndex = 0;
  mStack.AppendElement((void*)item);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 53 of file nsIDOMTreeWalker.idl.

Definition at line 52 of file nsIDOMTreeWalker.idl.

Definition at line 51 of file nsIDOMTreeWalker.idl.

Definition at line 65 of file inDeepTreeWalker.h.

Definition at line 69 of file inDeepTreeWalker.h.

Definition at line 64 of file inDeepTreeWalker.h.

Definition at line 62 of file inDeepTreeWalker.h.

Definition at line 63 of file inDeepTreeWalker.h.

nsAutoVoidArray inDeepTreeWalker::mStack [protected]

Definition at line 68 of file inDeepTreeWalker.h.

Definition at line 66 of file inDeepTreeWalker.h.

Definition at line 49 of file nsIDOMTreeWalker.idl.

Definition at line 46 of file inIDeepTreeWalker.idl.

Definition at line 47 of file inIDeepTreeWalker.idl.

readonly attribute unsigned long nsIDOMTreeWalker::whatToShow [inherited]

Definition at line 50 of file nsIDOMTreeWalker.idl.


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