Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsGeneratedIterator.cpp File Reference
#include "nsISupports.h"
#include "nsIDOMNodeList.h"
#include "nsIContentIterator.h"
#include "nsRange.h"
#include "nsIContent.h"
#include "nsIDOMText.h"
#include "nsISupportsArray.h"
#include "nsCOMPtr.h"
#include "nsPresContext.h"
#include "nsIComponentManager.h"
#include "nsContentCID.h"
#include "nsIPresShell.h"

Go to the source code of this file.

Classes

class  nsGeneratedContentIterator
class  nsGeneratedSubtreeIterator

Defines

#define DO_AFTER   1
#define DO_BEFORE   1

Functions

static PRUint32 GetNumChildren (nsIDOMNode *aNode)
static nsCOMPtr< nsIDOMNodeGetChildAt (nsIDOMNode *aParent, PRInt32 aOffset)
nsresult NS_NewGenRegularIterator (nsIContentIterator **aInstancePtrResult)
 NS_IMPL_ISUPPORTS2 (nsGeneratedContentIterator, nsIGeneratedContentIterator, nsIContentIterator) nsGeneratedContentIterator
nsresult NS_NewGenSubtreeIterator (nsIContentIterator **aInstancePtrResult)

Define Documentation

#define DO_AFTER   1

Definition at line 56 of file nsGeneratedIterator.cpp.

#define DO_BEFORE   1

Definition at line 57 of file nsGeneratedIterator.cpp.


Function Documentation

static nsCOMPtr<nsIDOMNode> GetChildAt ( nsIDOMNode aParent,
PRInt32  aOffset 
) [static]

Definition at line 85 of file nsGeneratedIterator.cpp.

{
  nsCOMPtr<nsIDOMNode> resultNode;

  if (!aParent)
    return resultNode;

  PRBool hasChildNodes;
  aParent->HasChildNodes(&hasChildNodes);
  if (PR_TRUE==hasChildNodes)
  {
    nsCOMPtr<nsIDOMNodeList>nodeList;
    nsresult res = aParent->GetChildNodes(getter_AddRefs(nodeList));
    if (NS_SUCCEEDED(res) && nodeList)
      nodeList->Item(aOffset, getter_AddRefs(resultNode));
  }

  return resultNode;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRUint32 GetNumChildren ( nsIDOMNode aNode) [static]

Definition at line 63 of file nsGeneratedIterator.cpp.

{
  PRUint32 numChildren = 0;
  if (!aNode)
    return 0;

  PRBool hasChildNodes;
  aNode->HasChildNodes(&hasChildNodes);
  if (hasChildNodes)
  {
    nsCOMPtr<nsIDOMNodeList>nodeList;
    nsresult res = aNode->GetChildNodes(getter_AddRefs(nodeList));
    if (NS_SUCCEEDED(res) && nodeList)
      nodeList->GetLength(&numChildren);
  }
  return numChildren;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 205 of file nsGeneratedIterator.cpp.

  : mIsDone(PR_FALSE)
{
}

Definition at line 188 of file nsGeneratedIterator.cpp.

{
  nsGeneratedContentIterator * iter = new nsGeneratedContentIterator();
  if (!iter) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(*aInstancePtrResult = iter);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 844 of file nsGeneratedIterator.cpp.

{
  nsGeneratedSubtreeIterator * iter = new nsGeneratedSubtreeIterator();
  if (!iter) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(*aInstancePtrResult = iter);

  return NS_OK;
}

Here is the call graph for this function: