Back to index

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

#include <nsEditorUtils.h>

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

List of all members.

Public Member Functions

 nsDOMSubtreeIterator ()
virtual ~nsDOMSubtreeIterator ()
nsresult Init (nsIDOMRange *aRange)
nsresult Init (nsIDOMNode *aNode)
void ForEach (nsDomIterFunctor &functor) const
nsresult AppendList (nsBoolDomIterFunctor &functor, nsCOMArray< nsIDOMNode > &arrayOfNodes) const

Protected Attributes

nsCOMPtr< nsIContentIteratormIter

Detailed Description

Definition at line 219 of file nsEditorUtils.h.


Constructor & Destructor Documentation

Definition at line 160 of file nsEditorUtils.cpp.

{
}

Definition at line 164 of file nsEditorUtils.cpp.

{
}

Member Function Documentation

nsresult nsDOMIterator::AppendList ( nsBoolDomIterFunctor functor,
nsCOMArray< nsIDOMNode > &  arrayOfNodes 
) const [inherited]

Definition at line 139 of file nsEditorUtils.cpp.

{
  nsCOMPtr<nsIDOMNode> node;
  
  // iterate through dom and build list
  while (!mIter->IsDone())
  {
    node = do_QueryInterface(mIter->GetCurrentNode());
    if (!node)
      return NS_ERROR_NULL_POINTER;

    if (functor(node))
    {
      arrayOfNodes.AppendObject(node);
    }
    mIter->Next();
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsDOMIterator::ForEach ( nsDomIterFunctor functor) const [inherited]

Definition at line 122 of file nsEditorUtils.cpp.

{
  nsCOMPtr<nsIDOMNode> node;
  
  // iterate through dom
  while (!mIter->IsDone())
  {
    node = do_QueryInterface(mIter->GetCurrentNode());
    if (!node)
      return;

    functor(node);
    mIter->Next();
  }
}

Here is the call graph for this function:

Reimplemented from nsDOMIterator.

Definition at line 169 of file nsEditorUtils.cpp.

{
  nsresult res;
  mIter = do_CreateInstance("@mozilla.org/content/subtree-content-iterator;1", &res);
  if (NS_FAILED(res)) return res;
  if (!mIter) return NS_ERROR_FAILURE;
  return mIter->Init(aRange);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from nsDOMIterator.

Definition at line 179 of file nsEditorUtils.cpp.

{
  nsresult res;
  mIter = do_CreateInstance("@mozilla.org/content/subtree-content-iterator;1", &res);
  if (NS_FAILED(res)) return res;
  if (!mIter) return NS_ERROR_FAILURE;
  nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
  return mIter->Init(content);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 216 of file nsEditorUtils.h.


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