Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Protected Attributes
nsXULDocument::ContextStack Class Reference

Context stack, which maintains the state of the Builder and allows it to be interrupted. More...

#include <nsXULDocument.h>

Collaboration diagram for nsXULDocument::ContextStack:
Collaboration graph
[legend]

List of all members.

Classes

struct  Entry

Public Member Functions

 ContextStack ()
 ~ContextStack ()
PRInt32 Depth ()
nsresult Push (nsXULPrototypeElement *aPrototype, nsIContent *aElement)
nsresult Pop ()
nsresult Peek (nsXULPrototypeElement **aPrototype, nsIContent **aElement, PRInt32 *aIndex)
nsresult SetTopIndex (PRInt32 aIndex)
PRBool IsInsideXULTemplate ()

Protected Attributes

EntrymTop
PRInt32 mDepth

Detailed Description

Context stack, which maintains the state of the Builder and allows it to be interrupted.

Definition at line 309 of file nsXULDocument.h.


Class Documentation

struct nsXULDocument::ContextStack::Entry

Definition at line 311 of file nsXULDocument.h.

Collaboration diagram for nsXULDocument::ContextStack::Entry:
Class Members
nsIContent * mElement
PRInt32 mIndex
Entry * mNext
nsXULPrototypeElement * mPrototype

Constructor & Destructor Documentation

Definition at line 2585 of file nsXULDocument.cpp.

    : mTop(nsnull), mDepth(0)
{
}

Definition at line 2590 of file nsXULDocument.cpp.

{
    while (mTop) {
        Entry* doomed = mTop;
        mTop = mTop->mNext;
        NS_IF_RELEASE(doomed->mElement);
        delete doomed;
    }
}

Member Function Documentation

Definition at line 325 of file nsXULDocument.h.

{ return mDepth; }

Here is the caller graph for this function:

Definition at line 2664 of file nsXULDocument.cpp.

{
    if (mDepth) {
        for (nsIContent* element = mTop->mElement; element;
             element = element->GetParent()) {

            nsINodeInfo *ni = element->GetNodeInfo();

            if (ni && ni->Equals(nsXULAtoms::Template, kNameSpaceID_XUL)) {
                return PR_TRUE;
            }
        }
    }
    return PR_FALSE;
}

Here is the call graph for this function:

nsresult nsXULDocument::ContextStack::Peek ( nsXULPrototypeElement **  aPrototype,
nsIContent **  aElement,
PRInt32 aIndex 
)

Definition at line 2636 of file nsXULDocument.cpp.

{
    if (mDepth == 0)
        return NS_ERROR_UNEXPECTED;

    *aPrototype = mTop->mPrototype;
    *aElement   = mTop->mElement;
    NS_IF_ADDREF(*aElement);
    *aIndex     = mTop->mIndex;

    return NS_OK;
}

Here is the caller graph for this function:

Definition at line 2621 of file nsXULDocument.cpp.

{
    if (mDepth == 0)
        return NS_ERROR_UNEXPECTED;

    Entry* doomed = mTop;
    mTop = mTop->mNext;
    --mDepth;

    NS_IF_RELEASE(doomed->mElement);
    delete doomed;
    return NS_OK;
}

Here is the caller graph for this function:

Definition at line 2601 of file nsXULDocument.cpp.

{
    Entry* entry = new Entry;
    if (! entry)
        return NS_ERROR_OUT_OF_MEMORY;

    entry->mPrototype = aPrototype;
    entry->mElement   = aElement;
    NS_IF_ADDREF(entry->mElement);
    entry->mIndex     = 0;

    entry->mNext = mTop;
    mTop = entry;

    ++mDepth;
    return NS_OK;
}

Here is the caller graph for this function:

Definition at line 2653 of file nsXULDocument.cpp.

{
    if (mDepth == 0)
        return NS_ERROR_UNEXPECTED;

    mTop->mIndex = aIndex;
    return NS_OK;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 319 of file nsXULDocument.h.

Definition at line 318 of file nsXULDocument.h.


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