Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsXULContentBuilder.cpp File Reference
#include "nsContentCID.h"
#include "nsIDocument.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULDocument.h"
#include "nsINodeInfo.h"
#include "nsIPrincipal.h"
#include "nsIServiceManager.h"
#include "nsITextContent.h"
#include "nsIXULDocument.h"
#include "nsIXULSortService.h"
#include "nsClusterKeySet.h"
#include "nsContentSupportMap.h"
#include "nsContentTestNode.h"
#include "nsContentTagTestNode.h"
#include "nsInstantiationNode.h"
#include "nsRDFConMemberTestNode.h"
#include "nsRDFPropertyTestNode.h"
#include "nsRDFSort.h"
#include "nsTemplateRule.h"
#include "nsTemplateMap.h"
#include "nsVoidArray.h"
#include "nsXPIDLString.h"
#include "nsXULAtoms.h"
#include "nsLayoutAtoms.h"
#include "nsXULContentUtils.h"
#include "nsXULElement.h"
#include "nsXULTemplateBuilder.h"
#include "nsSupportsArray.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"
#include "nsContentUtils.h"
#include "jsapi.h"
#include "pldhash.h"
#include "rdf.h"

Go to the source code of this file.

Classes

class  nsXULContentBuilder

Defines

#define NS_RDF_ELEMENT_GOT_CREATED   NS_RDF_NO_VALUE
#define NS_RDF_ELEMENT_WAS_THERE   NS_OK

Functions

static NS_DEFINE_CID (kXULSortServiceCID, NS_XULSORTSERVICE_CID)
PRBool IsElementInBuilder (nsIContent *aContent, nsIXULTemplateBuilder *aBuilder)
NS_IMETHODIMP NS_NewXULContentBuilder (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Define Documentation

Definition at line 114 of file nsXULContentBuilder.cpp.

Definition at line 115 of file nsXULContentBuilder.cpp.


Function Documentation

PRBool IsElementInBuilder ( nsIContent aContent,
nsIXULTemplateBuilder aBuilder 
)

Definition at line 84 of file nsXULContentBuilder.cpp.

{
    // Make sure that the element is contained within the heirarchy
    // that we're supposed to be processing.
    nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(aContent->GetDocument());
    if (! xuldoc)
        return PR_FALSE;

    nsCOMPtr<nsIContent> content = aContent;
    do {
        nsCOMPtr<nsIXULTemplateBuilder> builder;
        xuldoc->GetTemplateBuilderFor(content, getter_AddRefs(builder));
        if (builder) {
            if (builder == aBuilder)
                return PR_TRUE; // aBuilder is the builder for this element.

            // We found a builder, but it's not aBuilder.
            break;
        }

        content = content->GetParent();
    } while (content);

    return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kXULSortServiceCID  ,
NS_XULSORTSERVICE_CID   
) [static]
NS_IMETHODIMP NS_NewXULContentBuilder ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
)

Definition at line 297 of file nsXULContentBuilder.cpp.

{
    NS_PRECONDITION(aOuter == nsnull, "no aggregation");
    if (aOuter)
        return NS_ERROR_NO_AGGREGATION;

    nsresult rv;
    nsXULContentBuilder* result = new nsXULContentBuilder();
    if (! result)
        return NS_ERROR_OUT_OF_MEMORY;

    NS_ADDREF(result); // stabilize

    rv = result->Init();

    if (NS_SUCCEEDED(rv))
        rv = result->QueryInterface(aIID, aResult);

    NS_RELEASE(result);
    return rv;
}

Here is the call graph for this function: