Logo Search packages:      
Sourcecode: xulrunner version File versions  Download package

nsXULContentBuilder Class Reference

Inheritance diagram for nsXULContentBuilder:

nsXULTemplateBuilder nsIXULTemplateBuilder nsIObserver nsStubDocumentObserver nsISupports nsISupports nsIMutationObserver nsISupports

List of all members.


Detailed Description

The content builder generates DOM nodes from a template. The actual content generation is done entirely inside BuildContentFromTemplate.

Content generation is centered around the generation node (the node with uri="?member" on it). Nodes above the generation node are unique and generated only once. BuildContentFromTemplate will be passed the unique flag as an argument for content at this point and will recurse until it finds the generation node.

Once the generation node has been found, the results for that content node are added to the content map, stored in mContentSupportMap.

If recursion is allowed, generation continues, where the generation node becomes the container to insert into.

Definition at line 103 of file nsXULContentBuilder.cpp.


Public Member Functions

void addListener (in nsIXULBuilderListener aListener)
void addResult (in nsIXULTemplateResult aResult, in nsIDOMNode aQueryNode)
void addRuleFilter (in nsIDOMNode aRule, in nsIXULTemplateRuleFilter aFilter)
nsresult AddSimpleRuleBindings (nsTemplateRule *aRule, nsIContent *aElement)
virtual void AttributeChanged (nsIDocument *aDocument, nsIContent *aContent, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType, PRUint32 aStateMask)=0
virtual void BeginLoad (nsIDocument *aDocument)=0
virtual void BeginUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
virtual void CharacterDataChanged (nsIDocument *aDocument, nsIContent *aContent, CharacterDataChangeInfo *aInfo)=0
virtual void CharacterDataWillChange (nsIDocument *aDocument, nsIContent *aContent, CharacterDataChangeInfo *aInfo)=0
nsresult CompileBinding (nsTemplateRule *aRule, nsIContent *aBinding)
nsresult CompileBindings (nsTemplateRule *aRule, nsIContent *aBindings)
nsresult CompileConditions (nsTemplateRule *aRule, nsIContent *aConditions)
nsresult CompileExtendedQuery (nsIContent *aRuleElement, nsIContent *aActionElement, nsIAtom *aMemberVariable, nsTemplateQuerySet *aQuerySet)
nsresult CompileQueries ()
nsresult CompileSimpleQuery (nsIContent *aRuleElement, nsTemplateQuerySet *aQuerySet, PRBool *aCanUseTemplate)
nsresult CompileTemplate (nsIContent *aTemplate, nsTemplateQuerySet *aQuerySet, PRBool aIsQuerySet, PRInt32 *aPriority, PRBool *aCanUseTemplate)
nsresult CompileWhereCondition (nsTemplateRule *aRule, nsIContent *aCondition, nsTemplateCondition **aCurrentCondition)
nsresult ComputeContainmentProperties ()
virtual void ContentAppended (nsIDocument *aDocument, nsIContent *aContainer, PRInt32 aNewIndexInContainer)=0
virtual void ContentInserted (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
virtual void ContentRemoved (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
virtual void ContentStatesChanged (nsIDocument *aDocument, nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)=0
void createContents (in nsIContent aElement, in boolean aForceCreation)
NS_IMETHOD CreateContents (nsIContent *aElement, PRBool aForceCreation)
nsresult DetermineMatchedRule (nsIContent *aContainer, nsIXULTemplateResult *aResult, nsTemplateQuerySet *aQuerySet, nsTemplateRule **aMatchedRule, PRInt16 *aRuleIndex)
nsresult DetermineMemberVariable (nsIContent *aActionElement, nsIAtom **aMemberVariable)
void DetermineRDFQueryRef (nsIContent *aQueryElement, nsIAtom **tag)
virtual void EndLoad (nsIDocument *aDocument)=0
virtual void EndUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
nsFixedSizeAllocator & GetPool ()
nsIXULTemplateResult getResultForContent (in nsIDOMElement aElement)
NS_IMETHOD GetResultForContent (nsIDOMElement *aContent, nsIXULTemplateResult **aResult)
nsIXULTemplateResult getResultForId (in AString aId)
nsresult GetResultResource (nsIXULTemplateResult *aResult, nsIRDFResource **aResource)
nsresult GetTemplateRoot (nsIContent **aResult)
boolean hasGeneratedContent (in nsIRDFResource aNode, in nsIAtom aTag)
NS_IMETHOD HasGeneratedContent (nsIRDFResource *aResource, nsIAtom *aTag, PRBool *aGenerated)
void init (in nsIContent aElement)
nsresult InitGlobals ()
nsresult InitHTMLTemplateRoot ()
nsresult IsSystemPrincipal (nsIPrincipal *principal, PRBool *result)
nsresult LoadDataSources (nsIDocument *aDoc, PRBool *shouldDelayBuilding)
nsresult LoadDataSourceUrls (nsIDocument *aDocument, const nsAString &aDataSources, PRBool aIsRDFQuery, PRBool *aShouldDelayBuilding)
virtual void NodeWillBeDestroyed (const nsINode *aNode)=0
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS (nsXULTemplateBuilder, nsIXULTemplateBuilder) NS_DECL_NSIXULTEMPLATEBUILDERNS_DECL_NSIOBSERVERNS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYEDnsresult UpdateResult(nsIXULTemplateResult *aOldResult
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
virtual void ParentChainChanged (nsIContent *aContent)=0
void ParseAttribute (const nsAString &aAttributeValue, void(*aVariableCallback)(nsXULTemplateBuilder *aThis, const nsAString &, void *), void(*aTextCallback)(nsXULTemplateBuilder *aThis, const nsAString &, void *), void *aClosure)
void rebuild ()
void refresh ()
void removeListener (in nsIXULBuilderListener aListener)
void removeResult (in nsIXULTemplateResult aResult)
void replaceResult (in nsIXULTemplateResult aOldResult, in nsIXULTemplateResult aNewResult, in nsIDOMNode aQueryNode)
void resultBindingChanged (in nsIXULTemplateResult aResult)
void RunnableRebuild ()
virtual void StyleRuleAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
virtual void StyleRuleChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)=0
virtual void StyleRuleRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
virtual void StyleSheetAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
virtual void StyleSheetApplicableStateChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aApplicable)=0
virtual void StyleSheetRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
nsresult SubstituteText (nsIXULTemplateResult *aMatch, const nsAString &aAttributeValue, nsAString &aResult)
nsresult UpdateResultInContainer (nsIXULTemplateResult *aOldResult, nsIXULTemplateResult *aNewResult, nsTemplateQuerySet *aQuerySet, nsIRDFResource *aOldId, nsIRDFResource *aNewId, nsIContent *aInsertionPoint)
Methods
 NS_IMETHOD_ (nsrefcnt) Release(void)=0
 NS_IMETHOD_ (nsrefcnt) AddRef(void)=0
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)=0

Static Public Member Functions

static void AddBindingsFor (nsXULTemplateBuilder *aSelf, const nsAString &aVariable, void *aClosure)
static PRBool IsTemplateElement (nsIContent *aContent)
static void SubstituteTextAppendText (nsXULTemplateBuilder *aThis, const nsAString &aText, void *aClosure)
static void SubstituteTextReplaceVariable (nsXULTemplateBuilder *aThis, const nsAString &aVariable, void *aClosure)

Public Attributes

NS_DECL_CYCLE_COLLECTING_ISUPPORTS
nsIXULTemplateResult
aNewResult
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
nsIXULTemplateResult
nsIDOMNode
aQueryNode
readonly attribute
nsIRDFCompositeDataSource 
database
attribute nsISupports datasource
readonly attribute
nsIXULTemplateQueryProcessor 
queryProcessor
readonly attribute nsIDOMElement root
readonly attribute
nsIXULTemplateResult 
rootResult

Protected Types

enum  { eDontTestEmpty = (1 << 0), eDontRecurse = (2 << 0) }

Protected Member Functions

nsresult AddPersistentAttributes (nsIContent *aTemplateNode, nsIXULTemplateResult *aResult, nsIContent *aRealNode)
nsresult BuildContentFromTemplate (nsIContent *aTemplateNode, nsIContent *aResourceNode, nsIContent *aRealNode, PRBool aIsUnique, PRBool aIsSelfReference, nsIXULTemplateResult *aChild, PRBool aNotify, nsTemplateMatch *aMatch, nsIContent **aContainer, PRInt32 *aNewIndexInContainer)
nsresult CloseContainer (nsIContent *aElement)
nsresult CompareResultToNode (nsIXULTemplateResult *aResult, nsIContent *aContent, PRInt32 *aSortOrder)
nsresult CopyAttributesToElement (nsIContent *aTemplateNode, nsIContent *aRealNode, nsIXULTemplateResult *aResult, PRBool aNotify)
nsresult CreateContainerContents (nsIContent *aElement, nsIXULTemplateResult *aResult, PRBool aForceCreation, PRBool aNotify, PRBool aNotifyAtEnd)
nsresult CreateContainerContentsForQuerySet (nsIContent *aElement, nsIXULTemplateResult *aResult, PRBool aNotify, nsTemplateQuerySet *aQuerySet, nsIContent **aContainer, PRInt32 *aNewIndexInContainer)
nsresult CreateElement (PRInt32 aNameSpaceID, nsIAtom *aTag, nsIContent **aResult)
nsresult CreateTemplateAndContainerContents (nsIContent *aElement, PRBool aForceCreation)
nsresult EnsureElementHasGenericChild (nsIContent *aParent, PRInt32 aNameSpaceID, nsIAtom *aTag, PRBool aNotify, nsIContent **aResult)
nsresult GetElementsForResult (nsIXULTemplateResult *aResult, nsCOMArray< nsIContent > &aElements)
virtual PRBool GetInsertionLocations (nsIXULTemplateResult *aOldResult, nsCOMArray< nsIContent > **aLocations)
nsresult InsertSortedNode (nsIContent *aContainer, nsIContent *aNode, nsIXULTemplateResult *aResult, PRBool aNotify)
PRBool IsActivated (nsIRDFResource *aResource)
PRBool IsOpen (nsIContent *aElement)
nsresult OpenContainer (nsIContent *aElement)
virtual nsresult RebuildAll ()
nsresult RemoveGeneratedContent (nsIContent *aElement)
nsresult RemoveMember (nsIContent *aContent)
virtual nsresult ReplaceMatch (nsIXULTemplateResult *aOldResult, nsTemplateMatch *aNewMatch, nsTemplateRule *aNewMatchRule, void *aContext)
nsresult SetContainerAttrs (nsIContent *aElement, nsIXULTemplateResult *aResult, PRBool aIgnoreNonContainers, PRBool aNotify)
virtual nsresult SynchronizeResult (nsIXULTemplateResult *aResult)
nsresult SynchronizeUsingTemplate (nsIContent *aTemplateNode, nsIContent *aRealNode, nsIXULTemplateResult *aResult)
void Traverse (nsCycleCollectionTraversalCallback &cb) const
virtual void Uninit (PRBool aIsFinal)

Protected Attributes

nsCOMPtr
< nsIRDFCompositeDataSource
mCompDB
nsContentSupportMap mContentSupportMap
nsCOMPtr< nsISupportsmDataSource
nsCOMPtr< nsIRDFDataSource > mDB
PRInt32 mFlags
nsCOMArray< nsIXULBuilderListener > mListeners
nsDataHashtable
< nsISupportsHashKey,
nsTemplateMatch * > 
mMatchMap
nsCOMPtr< nsIAtom > mMemberVariable
nsIDocument * mObservedDocument
nsFixedSizeAllocator mPool
PRBool mQueriesCompiled
nsCOMPtr
< nsIXULTemplateQueryProcessor
mQueryProcessor
nsTArray< nsTemplateQuerySet * > mQuerySets
nsCOMPtr< nsIAtom > mRefVariable
nsCOMPtr< nsIContentmRoot
nsCOMPtr< nsIXULTemplateResultmRootResult
nsSortState mSortState
nsTemplateMap mTemplateMap
ActivationEntrymTop

Static Protected Attributes

static nsIObserverServicegObserverService
static nsIRDFContainerUtils * gRDFContainerUtils
static nsIRDFServicegRDFService
static nsrefcnt gRefCnt = 0
static nsIScriptSecurityManagergScriptSecurityManager
static nsIPrincipalgSystemPrincipal

Friends

NS_IMETHODIMP NS_NewXULContentBuilder (nsISupports *aOuter, REFNSIID aIID, void **aResult)

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

Generated by  Doxygen 1.6.0   Back to index