Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsXFormsModelElement.cpp File Reference
#include "nsXFormsModelElement.h"
#include "nsIXTFGenericElementWrapper.h"
#include "nsMemory.h"
#include "nsIDOMElement.h"
#include "nsIDOM3Node.h"
#include "nsIDOMNodeList.h"
#include "nsIVariant.h"
#include "nsString.h"
#include "nsIDocument.h"
#include "nsXFormsAtoms.h"
#include "nsINameSpaceManager.h"
#include "nsIServiceManager.h"
#include "nsIDOMEvent.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMXPathResult.h"
#include "nsIXFormsXPathEvaluator.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsIDOMNSXPathExpression.h"
#include "nsIContent.h"
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsIXFormsControl.h"
#include "nsXFormsTypes.h"
#include "nsXFormsXPathParser.h"
#include "nsXFormsXPathAnalyzer.h"
#include "nsIInstanceElementPrivate.h"
#include "nsXFormsUtils.h"
#include "nsXFormsSchemaValidator.h"
#include "nsIXFormsUIWidget.h"
#include "nsIAttribute.h"
#include "nsISchemaLoader.h"
#include "nsISchema.h"
#include "nsAutoPtr.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIProgrammingLanguage.h"
#include "nsDOMError.h"
#include "nsIDOMXPathException.h"
#include "nsXFormsControlStub.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIEventStateManager.h"
#include "nsStringEnumerator.h"

Go to the source code of this file.

Classes

class  Updating
 Poor man's try-catch to make sure that we set mProcessingUpdateEvent to when leaving scope. More...

Defines

#define XFORMS_LAZY_INSTANCE_BINDING   "chrome://xforms/content/xforms.xml#xforms-lazy-instance"

Functions

static void GetSchemaElementById (nsIDOMElement *contextNode, const nsString &id, nsIDOMElement **resultNode)
static void DeleteVoidArray (void *aObject, nsIAtom *aPropertyName, void *aPropertyValue, void *aData)
static nsresult AddToModelList (nsIDOMDocument *domDoc, nsXFormsModelElement *model)
static void RemoveFromModelList (nsIDOMDocument *domDoc, nsXFormsModelElement *model)
static const nsVoidArrayGetModelList (nsIDOMDocument *domDoc)
static void SupportsDtorFunc (void *aObject, nsIAtom *aPropertyName, void *aPropertyValue, void *aData)
static void DeleteBindList (void *aObject, nsIAtom *aPropertyName, void *aPropertyValue, void *aData)
nsresult NS_NewXFormsModelElement (nsIXTFElement **aResult)

Variables

static const nsIID sScriptingIIDs []
static nsIAtomsModelPropsList [eModel__count]
static nsVoidArraysPostRefreshList = nsnull
static nsVoidArraysContainerPostRefreshList = nsnull
static PRInt32 sRefreshing = 0
static const nsIID sInstScriptingIIDs []

Define Documentation

#define XFORMS_LAZY_INSTANCE_BINDING   "chrome://xforms/content/xforms.xml#xforms-lazy-instance"

Definition at line 87 of file nsXFormsModelElement.cpp.


Function Documentation

static nsresult AddToModelList ( nsIDOMDocument domDoc,
nsXFormsModelElement model 
) [static]

Definition at line 143 of file nsXFormsModelElement.cpp.

{
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);

  nsVoidArray *models =
      NS_STATIC_CAST(nsVoidArray *,
                     doc->GetProperty(nsXFormsAtoms::modelListProperty));
  if (!models) {
    models = new nsVoidArray(16);
    if (!models)
      return NS_ERROR_OUT_OF_MEMORY;
    doc->SetProperty(nsXFormsAtoms::modelListProperty, models, DeleteVoidArray);
  }
  models->AppendElement(model);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void DeleteBindList ( void aObject,
nsIAtom aPropertyName,
void aPropertyValue,
void aData 
) [static]

Definition at line 3258 of file nsXFormsModelElement.cpp.

{
  delete NS_STATIC_CAST(nsCOMArray<nsIXFormsControl> *, aPropertyValue);
}
static void DeleteVoidArray ( void aObject,
nsIAtom aPropertyName,
void aPropertyValue,
void aData 
) [static]

Definition at line 134 of file nsXFormsModelElement.cpp.

{
  delete NS_STATIC_CAST(nsVoidArray *, aPropertyValue);
}

Here is the call graph for this function:

static const nsVoidArray* GetModelList ( nsIDOMDocument domDoc) [static]

Definition at line 173 of file nsXFormsModelElement.cpp.

{
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);

  return NS_STATIC_CAST(nsVoidArray *,
                        doc->GetProperty(nsXFormsAtoms::modelListProperty));
}

Here is the call graph for this function:

static void GetSchemaElementById ( nsIDOMElement contextNode,
const nsString id,
nsIDOMElement **  resultNode 
) [static]

Definition at line 100 of file nsXFormsModelElement.cpp.

{
  // search for an element with the given "id" attribute, and then verify
  // that the element is in the XML Schema namespace.

  nsAutoString expr;
  expr.AssignLiteral("//*[@id=\"");
  expr.Append(id);
  expr.AppendLiteral("\"]");

  nsCOMPtr<nsIDOMXPathResult> xpRes;
  nsresult rv =
    nsXFormsUtils::EvaluateXPath(expr,
                                 contextNode,
                                 contextNode,
                                 nsIDOMXPathResult::FIRST_ORDERED_NODE_TYPE,
                                 getter_AddRefs(xpRes));
  if (NS_SUCCEEDED(rv) && xpRes) {
    nsCOMPtr<nsIDOMNode> node;
    xpRes->GetSingleNodeValue(getter_AddRefs(node));
    if (node) {
      nsAutoString ns;
      node->GetNamespaceURI(ns);
      if (ns.EqualsLiteral(NS_NAMESPACE_XML_SCHEMA))
        CallQueryInterface(node, resultNode);
    }
  }
}

Here is the call graph for this function:

Definition at line 3485 of file nsXFormsModelElement.cpp.

{
  *aResult = new nsXFormsModelElement();
  if (!*aResult)
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(*aResult);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void RemoveFromModelList ( nsIDOMDocument domDoc,
nsXFormsModelElement model 
) [static]

Definition at line 161 of file nsXFormsModelElement.cpp.

{
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);

  nsVoidArray *models =
      NS_STATIC_CAST(nsVoidArray *,
                     doc->GetProperty(nsXFormsAtoms::modelListProperty));
  if (models)
    models->RemoveElement(model);
}

Here is the call graph for this function:

static void SupportsDtorFunc ( void aObject,
nsIAtom aPropertyName,
void aPropertyValue,
void aData 
) [static]

Definition at line 182 of file nsXFormsModelElement.cpp.

{
  nsISupports *propertyValue = NS_STATIC_CAST(nsISupports*, aPropertyValue);
  NS_IF_RELEASE(propertyValue);
}

Variable Documentation

Definition at line 519 of file nsXFormsModelElement.cpp.

Initial value:
 {
  NS_IDOMNODELIST_IID
}

Definition at line 3559 of file nsXFormsModelElement.cpp.

Definition at line 514 of file nsXFormsModelElement.cpp.

Definition at line 518 of file nsXFormsModelElement.cpp.

PRInt32 sRefreshing = 0 [static]

Definition at line 521 of file nsXFormsModelElement.cpp.

Initial value:
 {
  NS_IDOMELEMENT_IID,
  NS_IDOMEVENTTARGET_IID,
  NS_IDOM3NODE_IID,
  NS_IXFORMSMODELELEMENT_IID,
  NS_IXFORMSNSMODELELEMENT_IID
}

Definition at line 506 of file nsXFormsModelElement.cpp.