Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Static Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes
nsXFormsUtils Class Reference

This class has static helper methods that don't fit into a specific place in the class hierarchy. More...

#include <nsXFormsUtils.h>

Collaboration diagram for nsXFormsUtils:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { ELEMENT_WITH_MODEL_ATTR = 1 << 0 }
 Possible values for any |aElementFlags| parameters. More...
enum  ConnectionType { kXFormsActionSend = 1, kXFormsActionLoad = 2, kXFormsActionLoadSend = 3 }
 Connection type used by CheckConnectionAllowed. More...

Static Public Member Functions

static NS_HIDDEN_ (nsresult) Init()
 Initialize nsXFormsUtils.
static NS_HIDDEN_ (nsresult) Shutdown()
 Shutdown nsXFormsUtils.
static NS_HIDDEN_ (PRBool) GetParentModel(nsIDOMElement *aBindElement
 Locate the model that is a parent of |aBindElement|.
static NS_HIDDEN_ (nsresult) GetNodeContext(nsIDOMElement *aElement
 Find the evaluation context for an element.
static NS_HIDDEN_ (already_AddRefed< nsIModelElementPrivate >) GetModel(nsIDOMElement *aElement
 Locate the model for an element.
static NS_HIDDEN_ (nsresult) EvaluateNodeBinding(nsIDOMElement *aElement
 Evaluate a 'bind' or |aBindingAttr| attribute on |aElement|.
static NS_HIDDEN_ (nsresult) EvaluateXPath(const nsAString &aExpression
 Convenience method for doing XPath evaluations.
static NS_HIDDEN_ (void) GetNodeValue(nsIDOMNode *aDataNode
 Given a node in the instance data, get its string value according to section 8.1.1 of the XForms specification.
static NS_HIDDEN_ (PRBool) GetSingleNodeBinding(nsIDOMElement *aElement
 Convenience method for doing XPath evaluations to get bound node for an element.
static NS_HIDDEN_ (PRBool) GetSingleNodeBindingValue(nsIDOMElement *aElement
 Convenience method for doing XPath evaluations to get string value for an element.
static NS_HIDDEN_ (PRBool) SetSingleNodeBindingValue(nsIDOMElement *aElement
 Convenience method.
static NS_HIDDEN_ (nsresult) DispatchEvent(nsIDOMNode *aTarget
 Dispatch an XForms event.
static NS_HIDDEN_ (nsresult) DispatchDeferredEvents(nsIDOMDocument *aDocument)
static NS_HIDDEN_ (nsresult) SetEventTrusted(nsIDOMEvent *aEvent
 Sets aEvent trusted if aRelatedNode is in chrome.
static NS_HIDDEN_ (PRBool) EventHandlingAllowed(nsIDOMEvent *aEvent
 Returns PR_TRUE unless aTarget is in chrome and aEvent is not trusted.
static NS_HIDDEN_ (PRBool) IsXFormsEvent(const nsAString &aEvent
 Returns PR_TRUE, if aEvent is an XForms event, and sets the values of aCancelable and aBubbles parameters according to the event type.
static NS_HIDDEN_ (void) GetEventDefaults(const nsAString &aEvent
 Checks if aEvent is a predefined event and sets the values of aCancelable and aBubbles parameters according to the event type.
static NS_HIDDEN_ (nsresult) CloneScriptingInterfaces(const nsIID *aIIDList
 Clone the set of IIDs in |aIIDList| into |aOutArray|.
static NS_HIDDEN_ (nsresult) FindParentContext(nsIDOMElement *aElement
 Returns the context for the element, if set by a parent node.
static NS_HIDDEN_ (PRBool) CheckConnectionAllowed(nsIDOMElement *aElement
 Check whether a connecion to aTestURI from aElement is allowed.
static NS_HIDDEN_ (PRBool) IsXFormsElement(nsIDOMNode *aNode
static NS_HIDDEN_ (PRBool) IsLabelElement(nsIDOMNode *aElement)
 Returns true if the given element is an XForms label.
static NS_HIDDEN_ (PRBool) FocusControl(nsIDOMElement *aElement)
 Tries to focus a form control and returns true if succeeds.
static NS_HIDDEN_ (void) MakeUniqueAndSort(nsCOMArray< nsIDOMNode > *aArray)
 Sorts the array and removes duplicate entries.
static NS_HIDDEN_ (nsresult) GetInstanceNodeForData(nsIDOMNode *aInstanceDataNode
 Returns the <xf:instance> for a given instance data node.
static NS_HIDDEN_ (nsresult) ParseTypeFromNode(nsIDOMNode *aInstanceData
 Returns the type bound to the given node.
static NS_HIDDEN_ (void) ReportError(const nsAString &aMessageName
 Outputs to the Error console.
static NS_HIDDEN_ (void) ReportError(const nsAString &aMessageName
 Simple version of ReportError(), used when reporting without message arguments and file location and node is taken from same element (or nsnull).
static NS_HIDDEN_ (nsresult) GetElementById(const nsAString &aId
 Search for an element by ID through repeat rows looking for controls in addition to looking through the regular DOM.
static NS_HIDDEN_ (nsresult) GetElementByContextId(nsIDOMElement *aRefNode
 Search for an element with the given ID value.
static NS_HIDDEN_ (PRBool) HandleFatalError(nsIDOMElement *aElement
 Shows an error dialog for fatal errors.
static NS_HIDDEN_ (PRBool) AreEntitiesEqual(nsIDOMNamedNodeMap *aEntities1
 Returns whether the given NamedNodeMaps of Entities are equal.
static NS_HIDDEN_ (PRBool) AreNotationsEqual(nsIDOMNamedNodeMap *aNotations1
 Returns whether the given NamedNodeMaps of Notations are equal.
static NS_HIDDEN_ (PRBool) AreNodesEqual(nsIDOMNode *aFirstNode
 Returns whether the given nodes are equal as described in the isEqualNode function defined in the DOM Level 3 Core spec.
static NS_HIDDEN_ (nsresult) GetWindowFromDocument(nsIDOMDocument *aDoc
 Retrieve the window object from the given document.
static NS_HIDDEN_ (PRBool) NodeHasItemset(nsIDOMNode *aNode)
 Determine whether the given node contains an xf:itemset as a child.
static NS_HIDDEN_ (PRBool) AskStopWaiting(nsIDOMElement *aElement)
 Ask the user if she would like to stop the current long-running script component.
static NS_HIDDEN_ (PRInt32) waitLimit
 Caches the current value of the PREF_WAIT_LIMIT preference, which stores the number of seconds that a user should have to wait before she is given an opportunity to stop the busy section of the processor.
static NS_HIDDEN_ (void) BinaryToHex(const char *aBuffer
static NS_HIDDEN_ (nsresult) GetTimeZone(const nsAString &aTime
 Get the time zone information from an xsd:time.

Public Attributes

static nsIModelElementPrivate ** aModel
static PRUint32 aElementFlags
static PRUint32
nsIModelElementPrivate ** 
aModel
static PRUint32
nsIModelElementPrivate
nsIDOMElement ** 
aBindElement
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
aOuterBind
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
nsIXFormsControl ** 
aParentControl
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
nsIXFormsControl nsIDOMNode ** 
aContextNode
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
nsIXFormsControl nsIDOMNode
PRInt32
aContextPosition = nsnull
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
nsIXFormsControl nsIDOMNode
PRInt32 PRInt32
aContextSize = nsnull
static PRUint32
nsIModelElementPrivate
nsIDOMElement PRBool
nsIXFormsControl nsIDOMNode
PRInt32 PRInt32 PRBool 
aUseBindAttr = PR_TRUE)
static nsIXFormsControl ** aParentControl = nsnull
static nsIXFormsControl PRUint32 aElementFlags = ELEMENT_WITH_MODEL_ATTR
static nsIXFormsControl
PRUint32 nsIDOMNode ** 
aContextNode = nsnull)
static PRUint32 const nsStringaBindingAttr
static PRUint32 const nsString
const nsString
aDefaultRef
static PRUint32 const nsString
const nsString PRUint16 
aResultType
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate ** 
aModel
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate
nsIDOMXPathResult ** 
aResult
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate
nsIDOMXPathResult PRBool
aUsesModelBind
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate
nsIDOMXPathResult PRBool
nsIXFormsControl ** 
aParentControl = nsnull
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate
nsIDOMXPathResult PRBool
nsIXFormsControl nsCOMArray
< nsIDOMNode > * 
aDeps = nsnull
static PRUint32 const nsString
const nsString PRUint16
nsIModelElementPrivate
nsIDOMXPathResult PRBool
nsIXFormsControl nsCOMArray
< nsIDOMNode > nsStringArray * 
aIndexesUsed = nsnull)
static nsIDOMNodeaContextNode
static nsIDOMNode nsIDOMNodeaResolverNode
static nsIDOMNode nsIDOMNode
PRUint16 
aResultType
static nsIDOMNode nsIDOMNode
PRUint16 nsIDOMXPathResult ** 
aResult
static nsIDOMNode nsIDOMNode
PRUint16 nsIDOMXPathResult
PRInt32 
aContextPosition = 1
static nsIDOMNode nsIDOMNode
PRUint16 nsIDOMXPathResult
PRInt32 PRInt32 
aContextSize = 1
static nsIDOMNode nsIDOMNode
PRUint16 nsIDOMXPathResult
PRInt32 PRInt32 nsCOMArray
< nsIDOMNode > * 
aSet = nsnull
static nsIDOMNode nsIDOMNode
PRUint16 nsIDOMXPathResult
PRInt32 PRInt32 nsCOMArray
< nsIDOMNode > nsStringArray * 
aIndexesUsed = nsnull)
static nsAString & aNodeValue
static nsIDOMNode ** aNode
static nsIDOMNode
nsIModelElementPrivate ** 
aModel
static nsStringaValue
static const nsAString & aValue
static const nsAString PRBoolaChanged
static nsXFormsEvent aEvent
static nsXFormsEvent PRBoolaDefaultActionEnabled = nsnull
static nsXFormsEvent PRBool
nsIDOMElement
aSrcElement = nsnull
static nsXFormsEvent PRBool
nsIDOMElement nsCOMArray
< nsIXFormsContextInfo > * 
aContextInfo = nsnull)
static nsIDOMNodeaRelatedNode
static nsIDOMNodeaTarget
static PRBoolaCancelable
static PRBool PRBoolaBubbles
static unsigned int aIIDCount
static unsigned int PRUint32aOutCount
static unsigned int PRUint32
nsIID *** 
aOutArray
static nsIModelElementPrivate
nsIXFormsControl ** 
aParentControl
static nsIModelElementPrivate
nsIXFormsControl nsIDOMNode ** 
aContextNode
static nsIModelElementPrivate
nsIXFormsControl nsIDOMNode
PRInt32
aContextPosition
static nsIModelElementPrivate
nsIXFormsControl nsIDOMNode
PRInt32 PRInt32
aContextSize
static nsIURIaTestURI
static nsIURI ConnectionType aType = kXFormsActionLoad)
static const nsAString & aName
static nsIDOMNode ** aInstanceNode
static nsAString & aType
static nsAString nsAString & aNSUri
static const PRUnichar ** aParams
static const PRUnichar PRUint32 aParamLength
static const PRUnichar
PRUint32 nsIDOMNode
aElement
static const PRUnichar
PRUint32 nsIDOMNode nsIDOMNode
aContext
static const PRUnichar
PRUint32 nsIDOMNode nsIDOMNode
PRUint32 
aErrorFlag = nsIScriptError::errorFlag
static const PRUnichar
PRUint32 nsIDOMNode nsIDOMNode
PRUint32 PRBool 
aLiteralMessage = PR_FALSE)
static nsIDOMNodeaElement = nsnull
static nsIDOMNode PRUint32 aErrorFlag
static const PRBool aOnlyXForms
static const PRBool nsIDOMElementaCaller
static const PRBool
nsIDOMElement nsIDOMElement ** 
aElement
static const nsAString & aId
static const nsAString
nsIDOMElement ** 
aElement
static nsIDOMNamedNodeMapaEntities2
static nsIDOMNamedNodeMapaNotations2
static nsIDOMNodeaSecondNode
static nsIDOMNode PRBool aAlreadyNormalized = PR_FALSE)
static nsIDOMWindowInternal ** aWindow
static PRUint32 aCount
static PRUint32 PRUnichar ** aHexString
static nsAString & aResult

Static Private Member Functions

static NS_HIDDEN_ (PRBool) CheckSameOrigin(nsIDocument *aBaseDocument
 Do same origin checks on aBaseDocument and aTestURI.
static NS_HIDDEN_ (PRBool) CheckContentPolicy(nsIDOMElement *aElement
 Check content policy for loading the specificed aTestURI.

Private Attributes

static nsIDocumentaDoc
static nsIDocument nsIURIaURI

Detailed Description

This class has static helper methods that don't fit into a specific place in the class hierarchy.

Definition at line 160 of file nsXFormsUtils.h.


Member Enumeration Documentation

anonymous enum

Possible values for any |aElementFlags| parameters.

These may be bitwise OR'd together.

Enumerator:
ELEMENT_WITH_MODEL_ATTR 

The element has a "model" attribute.

Definition at line 168 of file nsXFormsUtils.h.

       {
    ELEMENT_WITH_MODEL_ATTR = 1 << 0
  };

Connection type used by CheckConnectionAllowed.

Enumerator:
kXFormsActionSend 

Send data, such as doing submission.

kXFormsActionLoad 

Load data, such as getting external instance data.

kXFormsActionLoadSend 

Send and Load data, which is replace=instance.

Definition at line 408 of file nsXFormsUtils.h.


Member Function Documentation

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Initialize nsXFormsUtils.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Shutdown nsXFormsUtils.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Locate the model that is a parent of |aBindElement|.

This method walks up the content tree looking for the containing model.

Returns:
Whether it's a reference to an outermost bind
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Find the evaluation context for an element.

That is, the model it is bound to (|aModel|), and if applicable the <bind> element that it uses (|aBindElement| and the context node (|aContextNode|).

Parameters:
aElementThe element
aElementFlagsFlags describing characteristics of aElement
aModelThe <model> for the element
aBindElementThe <bind> the element is bound to (if any)
aOuterBindWhether the <bind> is an outermost bind
aParentControlThe parent control, ie the one setting the context
aContextNodeThe context node for the element
aContextPositionThe context position for the element
aContextSizeThe context size for the element
aUseBindAttrUse (if present) to determine context node?

Locate the model for an element.

Note:
Actually it is just a shortcut for GetNodeContext().
Parameters:
aElementThe element
aParentControlThe parent control setting the context
aElementFlagsFlags describing characteristics of aElement
aContextNodeThe context node
Returns:
The model
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Evaluate a 'bind' or |aBindingAttr| attribute on |aElement|.

|aResultType| is used as the desired result type for the XPath evaluation.

The model element (if applicable) is located as part of this evaluation, and returned (addrefed) in |aModel|

The return value is an XPathResult as returned from nsIXFormsXPathEvaluator::Evaluate().

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) const [static]

Convenience method for doing XPath evaluations.

This gets a nsIXFormsXPathEvaluator from |aContextNode|'s ownerDocument, and calls nsIXFormsXPathEvaluator::Evalute using the given expression, context node, namespace resolver, and result type.

static nsXFormsUtils::NS_HIDDEN_ ( void  ) [static]

Given a node in the instance data, get its string value according to section 8.1.1 of the XForms specification.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Convenience method for doing XPath evaluations to get bound node for an element.

Also returns the associated model if aModel != null. Returns PR_TRUE if the evaluation succeeds.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Convenience method for doing XPath evaluations to get string value for an element.

Returns PR_TRUE if the evaluation succeeds.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Convenience method.

Evaluates the single node binding expression for the given xforms element and then sets the resulting single node to aValue. This allows elements like xf:filename and xf:mediatype to function properly without needing the overhead of being nsIXFormsControls.

Returns PR_TRUE if the evaluation and node value setting both succeeded.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Dispatch an XForms event.

aDefaultActionEnabled is returned indicating if the default action of the dispatched event was enabled. aSrcElement is passed for events targeted at models. If the model doesn't exist, yet, then the event dispatching is deferred. Once DOMContentLoaded is detected we'll grab the model from aSrcElement and dispatch the event to that model.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Sets aEvent trusted if aRelatedNode is in chrome.

When dispatching events in chrome, they should be set trusted because by default event listeners in chrome handle only trusted events. Should be called before any event dispatching in XForms.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Returns PR_TRUE unless aTarget is in chrome and aEvent is not trusted.

This should be used always before handling events. Otherwise if XForms is used in chrome, it may try to handle events that can be synthesized by untrusted content. I.e. content documents may create events using document.createEvent() and then fire them using target.dispatchEvent();

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) const [static]

Returns PR_TRUE, if aEvent is an XForms event, and sets the values of aCancelable and aBubbles parameters according to the event type.

static nsXFormsUtils::NS_HIDDEN_ ( void  ) const [static]

Checks if aEvent is a predefined event and sets the values of aCancelable and aBubbles parameters according to the event type.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) const [static]

Clone the set of IIDs in |aIIDList| into |aOutArray|.

|aOutCount| is set to |aIIDCount|.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Returns the context for the element, if set by a parent node.

Controls inheriting from nsIXFormsContextControl sets the context for its children.

Parameters:
aElementThe document element of the caller
aModelThe model for |aElement| (if (!*aModel), it is set)
aParentControlThe parent control setting the context
aContextNodeThe resulting context node
aContextPositionThe resulting context position
aContextSizeThe resulting context size

This function may return NS_OK_XFORMS_NOTREADY if parent context containers haven't yet had a chance to bind.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Check whether a connecion to aTestURI from aElement is allowed.

Parameters:
aElementThe element trying to access the resource
aTestURIThe uri we are trying to connect to
aTypeThe type of connection (see ConnectionType)
Returns:
Whether connection is allowed
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]
Returns:
true if aNode is element, its namespace URI is "http://www.w3.org/2002/xforms" and its name is aName.
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Returns true if the given element is an XForms label.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Tries to focus a form control and returns true if succeeds.

static nsXFormsUtils::NS_HIDDEN_ ( void  ) [static]

Sorts the array and removes duplicate entries.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Returns the <xf:instance> for a given instance data node.

static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Returns the type bound to the given node.

Parameters:
aInstanceDataAn instance data node or attribute on an instance data node from which to retrieve type.
aTypeOn return, type of given node.
aNSUriOn return, namespace URI of aType.
static nsXFormsUtils::NS_HIDDEN_ ( void  ) const [static]

Outputs to the Error console.

Parameters:
aMessageIf aLiteralMessage is PR_FALSE, then this is the name of string to output, which is loaded from xforms.properties. Otherwise this message is used 'as is'.
aParamsOptional parameters for the loaded string
aParamLengthAmount of params in aParams
aElementIf set, is used to determine and output the location of the file the XForm is located in
aContextIf set, the node is used to output what element caused the error
aErrorTypeType of error in form of an nsIScriptError flag
aLiteralMessageIf true, then message string is used literally, without going through xforms.properties and without formatting.
static nsXFormsUtils::NS_HIDDEN_ ( void  ) const [static]

Simple version of ReportError(), used when reporting without message arguments and file location and node is taken from same element (or nsnull).

Parameters:
aMessageNameName of string
aElementElement to use for location and context
aErrorTypeType of error in form of an nsIScriptError flag
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) const [static]

Search for an element by ID through repeat rows looking for controls in addition to looking through the regular DOM.

For example, xf:dispatch dispatches an event to an element with the given ID. If the element is in a repeat, you don't want to dispatch the event to the element in the DOM since we just end up hiding it and treating it as part of the repeat template. So we use nsXFormsUtils::GetElementById to dispatch the event to the contol with that id that is in the repeat row that has the current focus (well, the repeat row that corresponds to the repeat's index). If the element with that ID isn't in a repeat, then it picks the element with that ID from the DOM. But you wouldn't want to use this call for items that you know can't be inside repeats (like instance or submission elements). So for those you should use nsXFormsUtils::GetElementByContextId.

Parameters:
aIdThe id of the element
aOnlyXFormsOnly search for XForms elements
aCallerThe caller (or rather the caller's DOM element), ignored if nsnull
aElementThe element (or nsnull if not found)
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Search for an element with the given ID value.

First nsIDOMDocument::getElementById() is used. If it successful then found element is returned. Second, if the given node is inside anonymous content then search is performed throughout the complete bindings chain by attribute.

Parameters:
aRefNodeThe node relatively of which search is performed in anonymous content
aIdThe / value to search for
Returns:
aElement The element we found that has its ID/anonid value equal to aId
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Shows an error dialog for fatal errors.

The dialog can be disabled via the |xforms.disablePopup| preference.

Parameters:
aElementElement the exception occured at
aNameThe name to use for the new window
Returns:
Whether handling was successful
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Returns whether the given NamedNodeMaps of Entities are equal.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Returns whether the given NamedNodeMaps of Notations are equal.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Returns whether the given nodes are equal as described in the isEqualNode function defined in the DOM Level 3 Core spec.

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/DOM3-Core.html#core-Node3-isEqualNode

XXX: this is just temporary until isEqualNode is implemented in Mozilla (https://bugzilla.mozilla.org/show_bug.cgi?id=159167)

Parameters:
aFirstNodeThe first node to compare
aSecondNodeThe second node to compare
aAlreadyNormalizedWhether the two nodes and their children, etc. have already been normalized to allow for more accurate child node comparisons, as recommended in the DOM Level 3 Core spec.
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) [static]

Retrieve the window object from the given document.

Parameters:
aDocThe document to get window object from
aWindowThe found window object
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Determine whether the given node contains an xf:itemset as a child.

In valid XForms documents this should only be possible if aNode is an xf:select/1 or an xf:choices element. This function is used primarily as a worker function for select/1's IsContentAllowed override.

static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static]

Ask the user if she would like to stop the current long-running script component.

Returns PR_TRUE if yes, otherwise PR_FALSE.

Parameters:
aElementAn element in the current document; used to find the window for the prompt
static nsXFormsUtils::NS_HIDDEN_ ( PRInt32  ) [static]

Caches the current value of the PREF_WAIT_LIMIT preference, which stores the number of seconds that a user should have to wait before she is given an opportunity to stop the busy section of the processor.

(A value of 0 indicates that the user does not want to be prompted.)

static nsXFormsUtils::NS_HIDDEN_ ( void  ) const [static]
static nsXFormsUtils::NS_HIDDEN_ ( nsresult  ) const [static]

Get the time zone information from an xsd:time.

This function assumes that aTime is a valid xsd:time.

Parameters:
aTimeA valid xsd:time
aResultResult string containing the time zone or an empty string if none is found.
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static, private]

Do same origin checks on aBaseDocument and aTestURI.

Hosts can be whitelisted through the XForms permissions.

Note:
The function assumes that the caller does not pass null arguments
Parameters:
aBaseDocumentThe document the XForms lives in
aTestURIThe uri we are trying to connect to
aTypeThe type of connection (see ConnectionType)
Returns:
Whether connection is allowed
static nsXFormsUtils::NS_HIDDEN_ ( PRBool  ) [static, private]

Check content policy for loading the specificed aTestURI.

Note:
The function assumes that the caller does not pass null arguments
Parameters:
aElementThe element trying to load the content
aBaseDocumentThe document the XForms lives in
aTestURIThe uri we are trying to load
Returns:
Whether loading is allowed.

Member Data Documentation

Definition at line 627 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 363 of file nsXFormsUtils.h.

Definition at line 562 of file nsXFormsUtils.h.

Definition at line 363 of file nsXFormsUtils.h.

Definition at line 318 of file nsXFormsUtils.h.

Definition at line 489 of file nsXFormsUtils.h.

Definition at line 332 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 242 of file nsXFormsUtils.h.

Definition at line 276 of file nsXFormsUtils.h.

Definition at line 401 of file nsXFormsUtils.h.

Definition at line 223 of file nsXFormsUtils.h.

Definition at line 280 of file nsXFormsUtils.h.

Definition at line 401 of file nsXFormsUtils.h.

Definition at line 224 of file nsXFormsUtils.h.

Definition at line 281 of file nsXFormsUtils.h.

Definition at line 401 of file nsXFormsUtils.h.

Definition at line 663 of file nsXFormsUtils.h.

Definition at line 330 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 265 of file nsXFormsUtils.h.

Definition at line 705 of file nsXFormsUtils.h.

Definition at line 489 of file nsXFormsUtils.h.

Definition at line 506 of file nsXFormsUtils.h.

Definition at line 562 of file nsXFormsUtils.h.

Definition at line 581 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 241 of file nsXFormsUtils.h.

Definition at line 601 of file nsXFormsUtils.h.

Definition at line 493 of file nsXFormsUtils.h.

Initial value:
 nsIScriptError::errorFlag)
    {
      nsXFormsUtils::ReportError(aMessageName, nsnull, 0, aElement, aElement, aErrorFlag, PR_FALSE);
    }

  
  static NS_HIDDEN_(void) ReportErrorMessage(const nsAString &aMessage,
                                             nsIDOMNode      *aElement = nsnull,
                                             PRUint32         aErrorFlag = nsIScriptError::errorFlag)
    {
      nsXFormsUtils::ReportError(aMessage, nsnull, 0, aElement, aElement, aErrorFlag, PR_TRUE);
    }

  
  static NS_HIDDEN_(PRBool) IsDocumentReadyForBind(nsIDOMElement *aElement)

Definition at line 507 of file nsXFormsUtils.h.

Definition at line 329 of file nsXFormsUtils.h.

Definition at line 663 of file nsXFormsUtils.h.

Definition at line 581 of file nsXFormsUtils.h.

Definition at line 380 of file nsXFormsUtils.h.

Definition at line 266 of file nsXFormsUtils.h.

Definition at line 283 of file nsXFormsUtils.h.

Definition at line 456 of file nsXFormsUtils.h.

Definition at line 494 of file nsXFormsUtils.h.

Definition at line 195 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 298 of file nsXFormsUtils.h.

static const nsAString & nsXFormsUtils::aName

Definition at line 436 of file nsXFormsUtils.h.

Definition at line 298 of file nsXFormsUtils.h.

Definition at line 290 of file nsXFormsUtils.h.

Definition at line 608 of file nsXFormsUtils.h.

nsAString nsAString& nsXFormsUtils::aNSUri

Definition at line 467 of file nsXFormsUtils.h.

Definition at line 562 of file nsXFormsUtils.h.

Definition at line 380 of file nsXFormsUtils.h.

Definition at line 380 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 489 of file nsXFormsUtils.h.

Definition at line 489 of file nsXFormsUtils.h.

Definition at line 217 of file nsXFormsUtils.h.

Definition at line 240 of file nsXFormsUtils.h.

Definition at line 264 of file nsXFormsUtils.h.

Definition at line 401 of file nsXFormsUtils.h.

Definition at line 345 of file nsXFormsUtils.h.

Definition at line 276 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 276 of file nsXFormsUtils.h.

Definition at line 675 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 276 of file nsXFormsUtils.h.

Definition at line 626 of file nsXFormsUtils.h.

Definition at line 282 of file nsXFormsUtils.h.

Definition at line 331 of file nsXFormsUtils.h.

Definition at line 355 of file nsXFormsUtils.h.

Definition at line 428 of file nsXFormsUtils.h.

Definition at line 429 of file nsXFormsUtils.h.

Definition at line 467 of file nsXFormsUtils.h.

Definition at line 705 of file nsXFormsUtils.h.

Definition at line 225 of file nsXFormsUtils.h.

Definition at line 257 of file nsXFormsUtils.h.

Definition at line 307 of file nsXFormsUtils.h.

Definition at line 318 of file nsXFormsUtils.h.

Definition at line 636 of file nsXFormsUtils.h.


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