Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsListBoxObject.cpp File Reference
#include "nsCOMPtr.h"
#include "nsPIListBoxObject.h"
#include "nsBoxObject.h"
#include "nsIFrame.h"
#include "nsIDocument.h"
#include "nsIBindingManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMNodeList.h"
#include "nsXULAtoms.h"
#include "nsIScrollableFrame.h"

Go to the source code of this file.

Classes

class  nsListBoxObject

Functions

 NS_IMPL_ISUPPORTS_INHERITED3 (nsListBoxObject, nsBoxObject, nsIListBoxObject, nsPIListBoxObject, nsPIListBoxObject_MOZILLA_1_8_BRANCH) nsListBoxObject
static void FindBodyContent (nsIContent *aParent, nsIContent **aResult)
nsresult NS_NewListBoxObject (nsIBoxObject **aResult)

Function Documentation

static void FindBodyContent ( nsIContent aParent,
nsIContent **  aResult 
) [static]

Definition at line 187 of file nsListBoxObject.cpp.

{
  if (aParent->Tag() == nsXULAtoms::listboxbody) {
    *aResult = aParent;
    NS_IF_ADDREF(*aResult);
  }
  else {
    nsCOMPtr<nsIDOMNodeList> kids;
    aParent->GetDocument()->BindingManager()->GetXBLChildNodesFor(aParent, getter_AddRefs(kids));
    if (!kids) return;

    PRUint32 i;
    kids->GetLength(&i);
    // start from the end, cuz we're smart and we know the listboxbody is probably at the end
    while (i > 0) {
      nsCOMPtr<nsIDOMNode> childNode;
      kids->Item(--i, getter_AddRefs(childNode));
      nsCOMPtr<nsIContent> childContent(do_QueryInterface(childNode));
      FindBodyContent(childContent, aResult);
      if (*aResult)
        break;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 82 of file nsListBoxObject.cpp.

  : mListBoxBody(nsnull)
{
}

Definition at line 272 of file nsListBoxObject.cpp.

{
  *aResult = new nsListBoxObject;
  if (!*aResult)
    return NS_ERROR_OUT_OF_MEMORY;
  NS_ADDREF(*aResult);
  return NS_OK;
}

Here is the call graph for this function: