Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
nsXFormsMessageElement Class Reference

Implementation of the XForms <message> element. More...

Inheritance diagram for nsXFormsMessageElement:
Inheritance graph
[legend]
Collaboration diagram for nsXFormsMessageElement:
Collaboration graph
[legend]

List of all members.

Public Types

enum  MessageType { eType_Normal, eType_Hint, eType_Help, eType_Alert }
enum  StopType { eStopType_None, eStopType_Security, eStopType_LinkError }

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
GetValue (nsAString &aValue)
NS_IMETHOD OnCreated (nsIXTFBindableElementWrapper *aWrapper)
 This sets the notification mask and initializes mElement.
NS_IMETHOD WillChangeDocument (nsIDOMDocument *aNewDocument)
NS_IMETHOD OnDestroyed ()
NS_IMETHOD ParentChanged (nsIDOMElement *aNewParent)
NS_IMETHOD WillChangeParent (nsIDOMElement *aNewParent)
NS_IMETHOD AttributeSet (nsIAtom *aName, const nsAString &aSrc)
NS_IMETHOD AttributeRemoved (nsIAtom *aName)
NS_IMETHOD DoneAddingChildren ()
NS_DECL_NSICHANNELEVENTSINK
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIDOMEVENTLISTENER
virtual
NS_DECL_NSIXFORMSACTIONMODULEELEMENT
nsIDOMElement
GetElement ()
virtual nsresult HandleSingleAction (nsIDOMEvent *aEvent, nsIXFormsActionElement *aParentAction)
 With the while attribute, actions can potentially be iterated.
void StartEphemeral ()
void ShowEphemeral ()
void HideEphemeral ()
void ResetEphemeralPosition ()
 nsXFormsMessageElement (MessageType aType)
NS_IMETHOD TryFocus (PRBool *aOK)
NS_IMETHOD Refresh ()
NS_IMETHOD IsTypeAllowed (PRUint16 aType, PRBool *aIsAllowed, nsRestrictionFlag *aRestriction, nsAString &aTypes)
 This function is overridden by controls that are restricted in the datatypes that they can bind to.
NS_IMETHOD HandleDefault (nsIDOMEvent *aEvent, PRBool *aHandled)
NS_IMETHOD DocumentChanged (nsIDOMDocument *aNewDocument)
NS_IMETHOD WillSetAttribute (nsIAtom *aName, const nsAString &aValue)
NS_IMETHOD WillRemoveAttribute (nsIAtom *aName)
NS_IMETHOD GetBoundNode (nsIDOMNode **aBoundNode)
NS_IMETHOD BindToModel (PRBool aSetBoundNode=PR_FALSE)
NS_IMETHOD GetDependencies (nsCOMArray< nsIDOMNode > **aDependencies)
NS_IMETHOD GetElement (nsIDOMElement **aElement)
NS_IMETHOD ResetBoundNode (const nsString &aBindAttribute, PRUint16 aResultType, PRBool *aContextChanged)
NS_IMETHOD Bind (PRBool *aContextChanged)
NS_IMETHOD GetOnDeferredBindList (PRBool *onList)
NS_IMETHOD SetOnDeferredBindList (PRBool putOnList)
NS_IMETHOD IsEventTarget (PRBool *aOK)
NS_IMETHOD GetUsesModelBinding (PRBool *aRes)
NS_IMETHOD GetUsesSingleNodeBinding (PRBool *aRes)
NS_IMETHOD GetDefaultIntrinsicState (PRInt32 *aRes)
NS_IMETHOD GetDisabledIntrinsicState (PRInt32 *aRes)
NS_IMETHOD RebindAndRefresh ()
NS_IMETHOD GetAbortedBindListContainer (nsIXFormsContextControl **aContainer)
NS_IMETHOD SetAbortedBindListContainer (nsIXFormsContextControl *aContainer)
nsresult Create (nsIXTFElementWrapper *aWrapper)
void AddRemoveSNBAttr (nsIAtom *aName, const nsAString &aValue)
 This function manages the mBindAttrsCount value.
virtual PRBool IsContentAllowed ()
 This function is overridden by controls that are restricted in the type of content that may be bound to the control.
virtual PRBool IsContentComplex ()
 This function determines if the content to which the control is being bound is complex; ie contains Element children.
virtual nsRepeatState GetRepeatState ()
 Get/Set the repeat state for the control.
virtual void SetRepeatState (nsRepeatState aState)
boolean tryFocus ()
 Tries to move focus to form control and returns true if succeeded.
void bindToModel (in boolean setBoundNode)
 Binds the control to the model.
boolean isEventTarget ()
 According to sec 4.1 in the spec, only certain controls are allowed to be targets of the interaction and notification events.
void rebindAndRefresh ()
 This method is used to force the control to recalculate its bound node and to refresh.
void getContext (out AString aModelID, out nsIDOMNode aContextNode, out long aContextPosition, out long aContextSize)
 Used by children to retrieve the context of their parent.
void setContext (in nsIDOMNode aContextNode, in long aContextPosition, in long aContextSize)
 Used by parents to set the context for children.
void addRemoveAbortedControl (in nsIXFormsControl aControl, in boolean aAddControl)
 Each context control maintains an 'aborted bind' list.
boolean bind ()
 This tells the form control to update its node binding based on the current instance data.
void refresh ()
 This tells the form control to update its state based on the current instance data.
void onCreated (in nsIXTFBindableElementWrapper wrapper)
 onCreated will be called before any notifications are sent to the xtf element.
void onDestroyed ()
void getScriptingInterfaces (out unsigned long count,[array, size_is(count), retval] out nsIIDPtr array)
void willChangeDocument (in nsIDOMDocument newDoc)
void documentChanged (in nsIDOMDocument newDoc)
void willChangeParent (in nsIDOMElement newParent)
void parentChanged (in nsIDOMElement newParent)
void willInsertChild (in nsIDOMNode child, in unsigned long index)
void childInserted (in nsIDOMNode child, in unsigned long index)
void willAppendChild (in nsIDOMNode child)
void childAppended (in nsIDOMNode child)
void willRemoveChild (in unsigned long index)
void childRemoved (in unsigned long index)
void willSetAttribute (in nsIAtom name, in AString newValue)
void attributeSet (in nsIAtom name, in AString newValue)
void willRemoveAttribute (in nsIAtom name)
void attributeRemoved (in nsIAtom name)
void beginAddingChildren ()
void doneAddingChildren ()
boolean handleDefault (in nsIDOMEvent aEvent)
void cloneState (in nsIDOMElement aElement)
nsIXFormsAccessors getXFormsAccessors ()
 Get the IXFormsAccessors object for this control.
void widgetAttached ()
 This should be called by XBL widgets, when they are created.
void reportError (in DOMString errorMsg)
 Report an error.
void reportErrorMessage (in DOMString errorMsg)
 Report an error.
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.
void handleAction (in nsIDOMEvent aEvent, in nsIXFormsActionElement aParentAction)
nsIDOMEvent getCurrentEvent ()
 Get the event currently being processed in handleAction.
void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount)
 Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.
void onStartRequest (in nsIRequest aRequest, in nsISupports aContext)
 Called to signify the beginning of an asynchronous request.
void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode)
 Called to signify the end of an asynchronous request.
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.
void onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags)
 Called when a redirect occurs.
PRBool CanIterate ()
void SetCurrentEvent (nsIDOMEvent *aEvent)

Public Attributes

const PRUint32 kStandardNotificationMask
 The standard notification flags set on nsIXTFElement.
const PRUint32 kElementFlags
 The element flags for the controls passed to nsXFormsUtils:EvaluateNodeBinding()
readonly attribute nsIDOMNode boundNode
 The instance node that the control is bound to.
readonly attribute nsCOMArrayPtr dependencies
 The instance nodes that the control depend on.
readonly attribute nsIDOMElement element
 Get the element that should receive events for the control.
readonly attribute boolean usesModelBinding
 Is true when the control is getting its instance data node binding from a model bind element, ie.
readonly attribute boolean usesSingleNodeBinding
 Is true when the control uses single node binding.
readonly attribute long defaultIntrinsicState
 These represent the default intrinsic states for controls when they are enabled and disabled.
readonly attribute long disabledIntrinsicState
attribute nsIXFormsContextControl abortedBindListContainer
 The keeper of the aborted bind list, if any, that this control is currently listed on.
attribute boolean onDeferredBindList
 Determines whether this control is already on the deferred bind list.
const unsigned long ELEMENT_TYPE_GENERIC_ELEMENT = 0
const unsigned long ELEMENT_TYPE_SVG_VISUAL = 1
const unsigned long ELEMENT_TYPE_XML_VISUAL = 2
const unsigned long ELEMENT_TYPE_XUL_VISUAL = 3
const unsigned long ELEMENT_TYPE_BINDABLE = 4
readonly attribute unsigned long elementType
readonly attribute boolean isAttributeHandler
const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001
const unsigned long NOTIFY_DOCUMENT_CHANGED = 0x00000002
const unsigned long NOTIFY_WILL_CHANGE_PARENT = 0x00000004
const unsigned long NOTIFY_PARENT_CHANGED = 0x00000008
const unsigned long NOTIFY_WILL_INSERT_CHILD = 0x00000010
const unsigned long NOTIFY_CHILD_INSERTED = 0x00000020
const unsigned long NOTIFY_WILL_APPEND_CHILD = 0x00000040
const unsigned long NOTIFY_CHILD_APPENDED = 0x00000080
const unsigned long NOTIFY_WILL_REMOVE_CHILD = 0x00000100
const unsigned long NOTIFY_CHILD_REMOVED = 0x00000200
const unsigned long NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400
const unsigned long NOTIFY_ATTRIBUTE_SET = 0x00000800
const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000
const unsigned long NOTIFY_ATTRIBUTE_REMOVED = 0x00002000
const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000
const unsigned long NOTIFY_DONE_ADDING_CHILDREN = 0x00008000
const unsigned long NOTIFY_HANDLE_DEFAULT = 0x00010000
attribute DOMString value
 The value bound to the XForms control.
readonly attribute boolean hasBoundNode
 Is the delegate bound to a node?
const unsigned long REDIRECT_TEMPORARY = 1 << 0
 This is a temporary redirect.
const unsigned long REDIRECT_PERMANENT = 1 << 1
 This is a permanent redirect.
const unsigned long REDIRECT_INTERNAL = 1 << 2
 This is an internal redirect, i.e.

Protected Member Functions

void SetMozTypeAttribute ()
PRBool HasBindingAttribute () const
 Does control have a binding attribute?
PRBool GetRelevantState ()
 Returns the relevant state of the control.
nsresult ProcessNodeBinding (const nsString &aBindingAttr, PRUint16 aResultType, nsIDOMXPathResult **aResult, nsIModelElementPrivate **aModel=nsnull)
 Processes the node binding of a control, get the current Model (mModel) and binds the control to it.
void ResetHelpAndHint (PRBool aInitialize)
 Reset (and reinitialize) the event listener, which is used to create xforms-hint and xforms-help events.
virtual PRBool IsBindingAttribute (const nsIAtom *aAttr) const
 Checks whether an attribute is a binding attribute for the control.
virtual void AfterSetAttribute (nsIAtom *aName)
 Causes Bind() and Refresh() to be called if aName is the atom of a single node binding attribute for this control.
void BeforeSetAttribute (nsIAtom *aName, const nsAString &aValue)
 Removes this control from its model's list of controls if a single node binding attribute is removed.
void RemoveIndexListeners ()
 Removes the index change event listeners.
nsresult ForceModelDetach (PRBool aRebind)
 Forces detaching from the model.
nsresult MaybeAddToModel (nsIModelElementPrivate *aOldModel, nsIXFormsControl *aParent)
 Adds the form control to the model, if the model has changed.
nsresult GetBoundBuiltinType (PRUint16 *aBuiltinType)
 Returns the nsISchemaBuiltinType of the node to which this element is bound.
virtual nsRepeatState UpdateRepeatState (nsIDOMNode *aParent)
 This is called when the parent node for a XForms control changes.

Protected Attributes

nsString mControlType
nsRefPtr< nsXFormsAccessorsmAccessor
 The accessors object for this delegate.
nsIDOMElementmElement
 The nsIXTFElementWrapper.
nsCOMPtr< nsIDOMNodemBoundNode
 The node that the control is bound to.
nsCOMArray< nsIDOMNodemDependencies
 Array of nsIDOMNodes that the control depends on.
nsCOMPtr< nsIModelElementPrivatemModel
 The model for the control.
nsCOMPtr< nsIDOMEventListenermEventListener
 This event listener is used to create xforms-hint and xforms-help events.
PRPackedBool mHasParent
 State that tells whether control has a parent or not.
PRPackedBool mHasDoc
 State that tells whether control has a parent or not.
PRPackedBool mPreventLoop
 State to prevent infinite loop when generating and handling xforms-next and xforms-previous events.
PRPackedBool mUsesModelBinding
 Does the control use a model bind? That is, does it have a .
PRPackedBool mAppearDisabled
 Should the control appear disabled.
PRPackedBool mOnDeferredBindList
 Indicates whether this control is already on the deferred bind list.
PRInt8 mBindAttrsCount
 Used to keep track of whether this control has any single node binding attributes.
nsRepeatState mRepeatState
nsCOMArray
< nsIXFormsRepeatElement
mIndexesUsed
 List of repeats that the node binding depends on.
nsCOMArray< nsIXFormsControlmAbortedBindList
 List of XForms elements contained by this control who tried to bind and couldn't because this control wasn't ready to bind, yet.
nsCOMPtr< nsIXFormsContextControlmAbortedBindListContainer
 The control that contains the aborted bind list that this control is on.
PRBool mCanIterate
 This signals whether or not this action can iterate.
nsCOMPtr< nsIDOMEventmCurrentEvent
 The event currently being processed.

Private Member Functions

nsresult HandleEphemeralMessage (nsIDOMDocument *aDoc, nsIDOMEvent *aEvent)
nsresult HandleModalAndModelessMessage (nsIDOMDocument *aDoc, nsAString &aLevel)
void ImportNode (nsIDOMNode *aSrc, nsIDOMDocument *aDestDoc, nsIDOMNode **aTarget)
PRBool HandleInlineAlert (nsIDOMEvent *aEvent)
nsresult ConstructMessageWindowURL (const nsAString &aData, PRBool aIsLink, nsAString &aURL)
nsresult TestExternalFile ()
 Begin the process of testing to see if this message element could get held up later by linking to an external resource.
void AddRemoveExternalResource (PRBool aAdd)
 Either add or subtract from the number of messages with external resources currently loading in this document.
PRBool IsEphemeral ()
 Determine if the message is Ephemeral.
nsresult SetContextInfo (const char *aName, const nsAString &aValue)
 Set context info for events.

Private Attributes

MessageType mType
PRInt32 mPosX
PRInt32 mPosY
nsCOMPtr< nsITimermEphemeralTimer
nsIDOMDocumentmDocument
nsCOMPtr< nsIChannelmChannel
StopType mStopType
nsCString mSrcAttrText
PRBool mDoneAddingChildren
nsCOMArray< nsIXFormsContextInfomContextInfo
nsString mSrc

Detailed Description

Implementation of the XForms <message> element.

See also:
http://www.w3.org/TR/xforms/slice10.html#action-info

Definition at line 106 of file nsXFormsMessageElement.cpp.


Member Enumeration Documentation

Enumerator:
eType_Normal 
eType_Hint 
eType_Help 
eType_Alert 

Definition at line 152 of file nsXFormsMessageElement.cpp.

Enumerator:
eStopType_None 
eStopType_Security 
eStopType_LinkError 

Definition at line 159 of file nsXFormsMessageElement.cpp.


Constructor & Destructor Documentation


Member Function Documentation

Each context control maintains an 'aborted bind' list.

This list is used to track xforms controls that this context control contains which have tried to bind but couldn't because this context control wasn't bound yet, either.

Parameters:
aControlThe XForms control that couldn't bind because this context control wasn't ready.
addControlIf true, aControl is added to the list. If false aControl will be removed from the list and also aControl will lose its link to this control.

Either add or subtract from the number of messages with external resources currently loading in this document.

aAdd == PR_TRUE will add to the total otherwise we will subtract from the total (as long as it isn't already 0).

Definition at line 1227 of file nsXFormsMessageElement.cpp.

{
  // if this message doesn't have a channel established already or it has
  // already returned, then no sense bumping the counter.
  if (!mChannel) {
    return;
  }

  nsCOMPtr<nsIDOMDocument> domDoc;
  mElement->GetOwnerDocument(getter_AddRefs(domDoc));
  if (!domDoc) {
    return;
  }

  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
  PRUint32 loadingMessages = NS_PTR_TO_UINT32(
    doc->GetProperty(nsXFormsAtoms::externalMessagesProperty));
  if (aAdd) {
    loadingMessages++;
  } else {
    if (loadingMessages) {
      loadingMessages--;
    }
  }
  doc->SetProperty(nsXFormsAtoms::externalMessagesProperty,
                   NS_REINTERPRET_CAST(void *, loadingMessages), nsnull);

  if (!loadingMessages) {
    // no outstanding loads left, let the model in the document know in case
    // the models are waiting to send out the xforms-ready event

    nsCOMPtr<nsIModelElementPrivate> modelPriv =
      nsXFormsUtils::GetModel(mElement);
    if (modelPriv) {
      // if there are no more messages loading then it is probably the case
      // that my mChannel is going to get nulled out as soon as this function
      // returns.  If the model is waiting for this notification, then it may
      // kick off the message right away and we should probably ensure that
      // mChannel is gone before HandleAction is called.  So...if the channel
      // isn't pending, let's null it out right here.
      PRBool isPending = PR_TRUE;
      mChannel->IsPending(&isPending);
      if (!isPending) {
        mChannel = nsnull;
      }
      modelPriv->MessageLoadFinished();
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsXFormsControlStubBase::AddRemoveSNBAttr ( nsIAtom aName,
const nsAString &  aValue 
) [inherited]

This function manages the mBindAttrsCount value.

mBindAttrsCount will be incremented if a single node binding attribute is specified that isn't currently on the control AND aValue isn't empty. Otherwise, if the control already contains this attribute with a non-empty value and aValue is empty, then mBindAttrsCount is decremented.

aName - Atom of the single node binding attribute ('bind', 'ref', etc.). Using an atom to make it a tad harder to misuse by passing in any old string, for instance. Since different controls may have different binding attrs, we do NO validation on the attr. We assume that the caller is smart enough to only send us a binding attr atom. aValue - The string value that the SNB attribute is being set to.

Definition at line 934 of file nsXFormsControlStub.cpp.

{
  nsAutoString attrStr, attrValue;
  aName->ToString(attrStr);
  mElement->GetAttribute(attrStr, attrValue);

  // if we are setting a single node binding attribute that we don't already
  // have, bump the count.
  if (!aValue.IsEmpty() && attrValue.IsEmpty()) {
    ++mBindAttrsCount;
  } else if (!attrValue.IsEmpty()) { 
    // if we are setting a currently existing binding attribute to have an
    // empty value, treat it like the binding attr is being removed.
    --mBindAttrsCount;
    NS_ASSERTION(mBindAttrsCount>=0, "bad mojo!  mBindAttrsCount < 0!");
  }
}

Here is the caller graph for this function:

void nsXFormsControlStubBase::AfterSetAttribute ( nsIAtom aName) [protected, virtual, inherited]

Causes Bind() and Refresh() to be called if aName is the atom of a single node binding attribute for this control.

Called by AttributeSet and AttributeRemoved.

Reimplemented in nsXFormsRepeatElement.

Definition at line 965 of file nsXFormsControlStub.cpp.

{
  if (IsBindingAttribute(aName)) {
    PRBool dummy;
    nsresult rv = Bind(&dummy);
    if (NS_SUCCEEDED(rv) &&
        rv != NS_OK_XFORMS_DEFERRED && rv != NS_OK_XFORMS_NOTREADY)
      Refresh();
  }

}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from nsXFormsBindableControlStub.

Definition at line 430 of file nsXFormsMessageElement.cpp.

{
  if (mDoneAddingChildren) {
    if (aName == nsXFormsAtoms::src) {
      // If we are currently trying to test an external resource, cancel the
      // request.
      if (mChannel) {
        mChannel->Cancel(NS_BINDING_ABORTED);
      }

      mSrcAttrText.Truncate();
      mStopType = eStopType_None;
    }
  }

  return nsXFormsDelegateStub::AttributeRemoved(aName);
}
NS_IMETHODIMP nsXFormsMessageElement::AttributeSet ( nsIAtom aName,
const nsAString &  aSrc 
)

Reimplemented from nsXFormsBindableControlStub.

Definition at line 409 of file nsXFormsMessageElement.cpp.

{
  if (mDoneAddingChildren) {
    if (aName == nsXFormsAtoms::src) {
      // If we are currently trying to load an external message, cancel the
      // request.
      if (mChannel) {
        mChannel->Cancel(NS_BINDING_ABORTED);
      }

      mStopType = eStopType_None;

      // The src attribute has changed so retest the external file.
      TestExternalFile();
    }
  }

  return nsXFormsDelegateStub::AttributeSet(aName, aValue);
}

Here is the call graph for this function:

void nsIXTFElement::attributeSet ( in nsIAtom  name,
in AString  newValue 
) [inherited]
void nsXFormsControlStubBase::BeforeSetAttribute ( nsIAtom aName,
const nsAString &  aValue 
) [protected, inherited]

Removes this control from its model's list of controls if a single node binding attribute is removed.

Called by WillSetAttribute and WillRemoveAttribute.

Parameters:
aName- atom of the attribute being changed
aValue- value that the attribute is being changed to.

Definition at line 978 of file nsXFormsControlStub.cpp.

{
  if (IsBindingAttribute(aName)) {
    AddRemoveSNBAttr(aName, aValue);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

This tells the form control to update its node binding based on the current instance data.

Returns:
Did the binding change the context?
NS_IMETHODIMP nsXFormsControlStubBase::Bind ( PRBool aContextChanged) [inherited]

Reimplemented in nsXFormsRepeatElement, nsXFormsContextContainer, nsXFormsOutputElement, and nsXFormsItemSetElement.

Definition at line 234 of file nsXFormsControlStub.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIXFormsControl::bindToModel ( in boolean  setBoundNode) [inherited]

Binds the control to the model.

Only handles attaching to the model (including reattaching from any old model).

Note:
It can also set the boundNode, but does not do a proper node binding, as in setting up dependencies, attaching index() listeners, etc.
Parameters:
setBoundNodeSet boundNode too?

Definition at line 431 of file nsXFormsControlStub.cpp.

{
  if (GetRepeatState() == eType_Template) {
    // No sense going any further.  A template control has no need to bind,
    // refresh, etc. so no reason to put it on the model's control list
    return NS_OK;
  }

  nsCOMPtr<nsIModelElementPrivate> oldModel(mModel);

  nsCOMPtr<nsIXFormsControl> parentControl;
  nsCOMPtr<nsIDOMNode> boundNode;
  mModel = nsXFormsUtils::GetModel(mElement, getter_AddRefs(parentControl),
                                   kElementFlags,
                                   getter_AddRefs(boundNode));
  if (aSetBoundNode) {
    mBoundNode.swap(boundNode);
  }

  return MaybeAddToModel(oldModel, parentControl);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file nsXFormsActionModuleBase.h.

{ return mCanIterate; }

Here is the caller graph for this function:

void nsIXTFElement::childInserted ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]
void nsIXTFElement::childRemoved ( in unsigned long  index) [inherited]
void nsIXTFElement::cloneState ( in nsIDOMElement  aElement) [inherited]
nsresult nsXFormsMessageElement::ConstructMessageWindowURL ( const nsAString &  aData,
PRBool  aIsLink,
nsAString &  aURL 
) [private]

Definition at line 622 of file nsXFormsControlStub.cpp.

{
  aWrapper->SetNotificationMask(kStandardNotificationMask);

  // It's ok to keep a weak pointer to mElement.  mElement will have an
  // owning reference to this object, so as long as we null out mElement in
  // OnDestroyed, it will always be valid.
  nsCOMPtr<nsIDOMElement> node;
  aWrapper->GetElementNode(getter_AddRefs(node));
  mElement = node;
  NS_ASSERTION(mElement, "Wrapper is not an nsIDOMElement, we'll crash soon");

#ifdef DEBUG_smaug
  sControlList->AppendElement(this);
#endif

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from nsXFormsControlStubBase.

Reimplemented in nsXFormsContextContainer, nsXFormsItemSetElement, and nsXFormsActionElement.

Definition at line 387 of file nsXFormsControlStub.h.

  {
    return nsXFormsControlStubBase::DocumentChanged(aNewDocument);
  }

Definition at line 449 of file nsXFormsMessageElement.cpp.

Here is the call graph for this function:

nsresult nsXFormsControlStubBase::ForceModelDetach ( PRBool  aRebind) [protected, inherited]

Forces detaching from the model.

Parameters:
aRebindTry rebinding to a new model?

Definition at line 663 of file nsXFormsControlStub.cpp.

{
  // We shouldn't bother binding if the control is part of a template, but we
  // need to run through RemoveFormControl in the event that this control
  // was just moved under a repeat or itemset and wasn't there originally.
  if (mModel) {
    // Remove from model, so Bind() will be forced to reattach
    mModel->RemoveFormControl(this);
    mModel = nsnull;
  }

  if (!aRebind || GetRepeatState() == eType_Template) {
    return NS_OK;
  }

  PRBool dummy;
  nsresult rv = Bind(&dummy);
  NS_ENSURE_SUCCESS(rv, rv);

  if (rv == NS_OK_XFORMS_DEFERRED || rv == NS_OK_XFORMS_NOTREADY) {
    return NS_OK;
  }

  // If there were any controls that had already tried to bind but failed
  // to because this control wasn't ready yet, then try them again.
  PRInt32 arraySize = mAbortedBindList.Count();
  if (arraySize) {
    for (PRInt32 i = 0; i < arraySize; ++i) {
      nsCOMPtr<nsIXFormsControl> control = mAbortedBindList.ObjectAt(i);
      if (control) {
        control->RebindAndRefresh();
        control->SetAbortedBindListContainer(nsnull);
      }
    }
  
    mAbortedBindList.Clear();
  }

  return Refresh();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 903 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aControlContainingList);

  NS_IF_ADDREF(*aControlContainingList = mAbortedBindListContainer);
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsXFormsControlStubBase::GetBoundBuiltinType ( PRUint16 aBuiltinType) [protected, inherited]

Returns the nsISchemaBuiltinType of the node to which this element is bound.

Definition at line 987 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aBuiltinType);
  *aBuiltinType = 0;

  NS_ENSURE_STATE(mModel);

  // get type of bound instance data
  nsCOMPtr<nsISchemaType> schemaType;
  nsresult rv = mModel->GetTypeForControl(this, getter_AddRefs(schemaType));
  NS_ENSURE_SUCCESS(rv, rv);

  return mModel->GetRootBuiltinType(schemaType, aBuiltinType);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in nsXFormsOutputElement.

Definition at line 108 of file nsXFormsControlStub.cpp.

{
  NS_IF_ADDREF(*aBoundNode = mBoundNode);
  return NS_OK;  
}

Here is the caller graph for this function:

void nsIXFormsContextControl::getContext ( out AString  aModelID,
out nsIDOMNode  aContextNode,
out long  aContextPosition,
out long  aContextSize 
) [inherited]

Used by children to retrieve the context of their parent.

Parameters:
aModelIDThe modelID
aContextNodeThe context node
aContextPositionThe context position
aContextSizeThe context size
Note:
The actual model ID must be returned. An empty |aModelID| should only be returned if the default model has an id="".

Get the event currently being processed in handleAction.

The XPath event() method uses this method to get the context info for the current event.

Reimplemented in nsXFormsSelect1Element, nsXFormsSelectElement, and nsXFormsRangeElement.

Definition at line 294 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aState);
  *aState = kDefaultIntrinsicState;
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 115 of file nsXFormsControlStub.cpp.

{
  if (aDependencies)
    *aDependencies = &mDependencies;
  return NS_OK;  
}

Reimplemented in nsXFormsSelect1Element, nsXFormsSelectElement, and nsXFormsRangeElement.

Definition at line 302 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aState);
  *aState = kDisabledIntrinsicState;
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 123 of file nsXFormsControlStub.cpp.

{
  NS_IF_ADDREF(*aElement = mElement);
  return NS_OK;  
}
NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIDOMEVENTLISTENER virtual NS_DECL_NSIXFORMSACTIONMODULEELEMENT nsIDOMElement* nsXFormsMessageElement::GetElement ( ) [inline, virtual]

Implements nsXFormsActionModuleHelper.

Definition at line 137 of file nsXFormsMessageElement.cpp.

{ return mElement; }
void nsIInterfaceRequestor::getInterface ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

Retrieves the specified interface pointer.

Parameters:
uuidThe IID of the interface being requested.
result[out] The interface pointer to be filled in if the interface is accessible.
Returns:
NS_OK - interface was successfully returned. NS_NOINTERFACE - interface not accessible. NS_ERROR* - method failure.

Definition at line 279 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aOnList);
  *aOnList = mOnDeferredBindList;
  return NS_OK;
}

Returns the relevant state of the control.

Definition at line 489 of file nsXFormsControlStub.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Get/Set the repeat state for the control.

The repeat state indicates whether the control lives inside a context container, a repeat element, an itemset or non of the above.

Definition at line 1034 of file nsXFormsControlStub.cpp.

{
  return mRepeatState;
}

Here is the caller graph for this function:

void nsIXTFElement::getScriptingInterfaces ( out unsigned long  count,
[array, size_is(count), retval] out nsIIDPtr  array 
) [inherited]

Definition at line 265 of file nsXFormsControlStub.cpp.

{
  *aRes = mUsesModelBinding;
  return NS_OK;
}

Reimplemented in nsXFormsRepeatElement, and nsXFormsItemSetElement.

Definition at line 272 of file nsXFormsControlStub.cpp.

{
  *aRes = PR_TRUE;
  return NS_OK;
}

Definition at line 1027 of file nsXFormsMessageElement.cpp.

{
  // The order of precedence for determining the text of the message
  // is: single node binding, linking, inline text (8.3.5).  We cache
  // the value of the external message (via mSrcAttrText) for hints
  // and ephemeral messages.
  
  nsXFormsDelegateStub::GetValue(aValue);
  if (aValue.IsVoid()) {
    if (!mSrcAttrText.IsEmpty()) {
      // handle linking ('src') attribute
      aValue = NS_ConvertUTF8toUTF16(mSrcAttrText);
    }
    else {
      // Return inline value
      nsCOMPtr<nsIDOM3Node> node = do_QueryInterface(mElement);
      if (node) {
        node->GetTextContent(aValue);
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Get the IXFormsAccessors object for this control.

NS_IMETHOD nsXFormsBindableControlStub::HandleDefault ( nsIDOMEvent aEvent,
PRBool aHandled 
) [inline, inherited]

Reimplemented from nsXFormsControlStubBase.

Reimplemented in nsXFormsSubmitElement.

Definition at line 372 of file nsXFormsControlStub.h.

  {
    return nsXFormsControlStubBase::HandleDefault(aEvent, aHandled);
  }

Here is the caller graph for this function:

Bug:
How to handle the following: <message level="ephemeral" src="http://mozilla.org">

Definition at line 587 of file nsXFormsMessageElement.cpp.

{
  if (!aEvent)
    return NS_OK;

  nsAutoString eventType;
  aEvent->GetType(eventType);

  if (mType == eType_Hint) {
    // If this is a <hint> element, try to make it work more like a tooltip:
    // - if we get an xforms-moz-hint-off event, hide the element.
    // - if the <hint> is active and we get a new xforms-hint, then do nothing.
    nsCOMPtr<nsIDocument> doc(do_QueryInterface(aDoc));
    if (!doc)
      return NS_OK;

    nsXFormsMessageElement *msg =
    NS_STATIC_CAST(nsXFormsMessageElement*,
                   doc->GetProperty(nsXFormsAtoms::messageProperty));
    if (msg == this) {
      if (eventType.EqualsLiteral("xforms-moz-hint-off")) {
        if (mEphemeralTimer) {
          mEphemeralTimer->Cancel();
          mEphemeralTimer = nsnull;
        }
        doc->UnsetProperty(nsXFormsAtoms::messageProperty);

        nsCOMPtr<nsIXFormsEphemeralMessageUI> ui(do_QueryInterface(mElement));
        if (ui) {
          ui->Hide();
        }
        ResetEphemeralPosition();
      }

      return NS_OK;
    }
  }

  nsCOMPtr<nsIDOMEventTarget> target;
  aEvent->GetTarget(getter_AddRefs(target));
  nsCOMPtr<nsIDOMElement> targetEl(do_QueryInterface(target));
  if (targetEl) {
    nsCOMPtr<nsIDOMNSDocument> nsDoc(do_QueryInterface(aDoc));
    if (nsDoc) {
      PRInt32 oldX = mPosX;
      PRInt32 oldY = mPosY;
      nsCOMPtr<nsIBoxObject> box;
      nsDoc->GetBoxObjectFor(targetEl, getter_AddRefs(box));
      if (box) {
        box->GetX(&mPosX);
        box->GetY(&mPosY);
        PRInt32 height;
        box->GetHeight(&height);

        mPosX += 10;
        mPosY = mPosY + height;

        // Move the ephemeral message a bit upwards if the
        // box object of the event target is large enough.
        // This makes it more clear to which element the 
        // message is related to.
        if (height > 20)
          mPosY -= height > 30 ? 10 : 10 - (30 - height);
      }

      // A special case for hints to make them work more like
      // normal tooltips.
      if (eventType.EqualsLiteral("xforms-hint") &&
          mPosX == oldX && mPosY == oldY) {
        return NS_OK;
      }

      StartEphemeral();
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Definition at line 555 of file nsXFormsMessageElement.cpp.

{
  nsCOMPtr<nsIDOMDocument> doc;
  nsCOMPtr<nsIDOMWindowInternal> internal;
  mElement->GetOwnerDocument(getter_AddRefs(doc));
  nsXFormsUtils::GetWindowFromDocument(doc, getter_AddRefs(internal));
  if (!internal) {
    return PR_FALSE;
  }

  nsCOMPtr<nsIDOMViewCSS> cssView(do_QueryInterface(internal));
  if (!cssView)
    return PR_FALSE;
  
  nsAutoString tmp;
  nsCOMPtr<nsIDOMCSSStyleDeclaration> styles;
  cssView->GetComputedStyle(mElement, tmp, getter_AddRefs(styles));
  nsCOMPtr<nsIDOMCSSValue> display;
  styles->GetPropertyCSSValue(NS_LITERAL_STRING("display"),
                              getter_AddRefs(display));
  if (display) {
    nsCOMPtr<nsIDOMCSSPrimitiveValue> displayValue(do_QueryInterface(display));
    if (displayValue) {
      nsAutoString type;
      displayValue->GetStringValue(type);
      return !type.EqualsLiteral("none");
    }
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsXFormsMessageElement::HandleModalAndModelessMessage ( nsIDOMDocument aDoc,
nsAString &  aLevel 
) [private]

Definition at line 669 of file nsXFormsMessageElement.cpp.

{
  nsCOMPtr<nsIDOMWindowInternal> internal;
  nsXFormsUtils::GetWindowFromDocument(aDoc, getter_AddRefs(internal));
  if (!internal) {
    return NS_OK;
  }

  nsAutoString messageURL;

  // Order of precedence is single-node binding, linking attribute then
  // inline text.

  nsAutoString instanceData;
  PRBool hasBinding = nsXFormsUtils::GetSingleNodeBindingValue(mElement,
                                                               instanceData);

  nsAutoString options;
  options.AssignLiteral(MESSAGE_WINDOW_PROPERTIES);

  nsAutoString src;
  if (!hasBinding) {
    mElement->GetAttribute(NS_LITERAL_STRING("src"), src);
  }

  nsresult rv;
  if (!hasBinding && !src.IsEmpty()) {
    // Creating a normal window for messages with src attribute.
    options.AppendLiteral(",resizable");
    // Create a new URI so that we properly convert relative urls to absolute.
    nsCOMPtr<nsIDocument> doc(do_QueryInterface(aDoc));
    NS_ENSURE_STATE(doc);
    nsCOMPtr<nsIURI> uri;
    NS_NewURI(getter_AddRefs(uri), src, doc->GetDocumentCharacterSet().get(),
              doc->GetDocumentURI());
    NS_ENSURE_STATE(uri);
    nsCAutoString uriSpec;
    uri->GetSpec(uriSpec);
    messageURL = NS_ConvertUTF8toUTF16(uriSpec);
  } else {
    // Cloning the content of the xf:message and creating a
    // dialog for it.
    nsCOMPtr<nsIDOMDocument> ddoc;
    nsCOMPtr<nsIDOMDOMImplementation> domImpl;
    rv = aDoc->GetImplementation(getter_AddRefs(domImpl));
    NS_ENSURE_SUCCESS(rv, rv);

    rv = domImpl->CreateDocument(EmptyString(), EmptyString(), nsnull,
                                 getter_AddRefs(ddoc));
    NS_ENSURE_SUCCESS(rv, rv);
    if (!ddoc)
      return NS_OK;

    nsCOMPtr<nsIDOMNode> tmp;
    nsCOMPtr<nsIDOMElement> htmlEl;
    rv = ddoc->CreateElementNS(NS_LITERAL_STRING(NS_NAMESPACE_XHTML),
                               NS_LITERAL_STRING("html"),
                               getter_AddRefs(htmlEl));
    NS_ENSURE_SUCCESS(rv, rv);
    htmlEl->SetAttribute(NS_LITERAL_STRING("style"),
                       NS_LITERAL_STRING("background-color: -moz-Dialog;"));
    ddoc->AppendChild(htmlEl, getter_AddRefs(tmp));

    nsCOMPtr<nsIDOMElement> bodyEl;
    rv = ddoc->CreateElementNS(NS_LITERAL_STRING(NS_NAMESPACE_XHTML),
                               NS_LITERAL_STRING("body"),
                               getter_AddRefs(bodyEl));
    NS_ENSURE_SUCCESS(rv, rv);
    htmlEl->AppendChild(bodyEl, getter_AddRefs(tmp));

    // If we have a binding, it is enough to show a simple message
    if (hasBinding) {
      nsCOMPtr<nsIDOM3Node> body3(do_QueryInterface(bodyEl));
      if (body3)
        body3->SetTextContent(instanceData);
    } else {
      // Otherwise copying content from the original document to
      // the modeless/modal message document.
      nsCOMPtr<nsIDOMNode> tmp;
      nsCOMPtr<nsIDOMNodeList> childNodes;
      mElement->GetChildNodes(getter_AddRefs(childNodes));

      PRUint32 count = 0;
      if (childNodes)
        childNodes->GetLength(&count);

      for (PRUint32 i = 0; i < count; ++i) {
        nsCOMPtr<nsIDOMNode> child;
        childNodes->Item(i, getter_AddRefs(child));
        
        if (child) {
          nsCOMPtr<nsIDOMNode> clone;
          ImportNode(child, ddoc, getter_AddRefs(clone));
          if (clone)
            bodyEl->AppendChild(clone, getter_AddRefs(tmp));
        }
      }
    }

    nsCOMPtr<nsIDOMSerializer> serializer =
      do_CreateInstance(NS_XMLSERIALIZER_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    nsAutoString docString;
    rv = serializer->SerializeToString(ddoc, docString);
    NS_ENSURE_SUCCESS(rv, rv);

    char* b64 =
      PL_Base64Encode(NS_ConvertUTF16toUTF8(docString).get(), 0, nsnull);
    if (!b64) {
      return NS_ERROR_FAILURE;
    }

    nsCAutoString b64String;
    b64String.AppendLiteral("data:application/vnd.mozilla.xul+xml;base64,");
    b64String.Append(b64);
    PR_Free(b64);

    CopyUTF8toUTF16(b64String, messageURL);
  }

  if (aLevel.EqualsLiteral("modal")) {
    options.AppendLiteral(",modal");
  } else if (aLevel.EqualsLiteral("modeless")) {
    options.AppendLiteral(",minimizable");
  }

  nsCOMPtr<nsISupportsString> arg(
    do_CreateInstance("@mozilla.org/supports-string;1", &rv));
  if (!arg)
    return rv;

  arg->SetData(messageURL);

  nsCOMPtr<nsISupportsArray> args(
    do_CreateInstance("@mozilla.org/supports-array;1", &rv));
  if (!args)
    return rv;

  args->AppendElement(arg);

  nsCOMPtr<nsIDOMWindow> messageWindow;
  // The 2nd argument is the window name, and if a window with the name exists,
  // it gets reused.  Using "_blank" makes sure we get a new window each time.
  internal->OpenDialog(NS_LITERAL_STRING(MESSAGE_WINDOW_URL),
                       NS_LITERAL_STRING("_blank"), options, args,
                       getter_AddRefs(messageWindow));
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

With the while attribute, actions can potentially be iterated.

The HandleSingleAction method processes one iteration of an action (that is, the "body" of the action); it should be dispatched by the HandleAction method, which manages the conditional execution and iteration of the action.

Implements nsXFormsActionModuleHelper.

Definition at line 465 of file nsXFormsMessageElement.cpp.

{
  // If TestExternalFile fails, then there is an external link that we need
  // to use that we can't reach right now.  If it won't load, then might as
  // well stop here.  We don't want to be popping up empty windows
  // or windows that will just end up showing 404 messages.
  // We also stop if we were not allowed to access the given resource.
  if (mStopType == eStopType_LinkError ||
      mStopType == eStopType_Security) {
    // we couldn't successfully link to our external resource.  Better throw
    // the xforms-link-error event
    nsCOMPtr<nsIModelElementPrivate> modelPriv =
      nsXFormsUtils::GetModel(mElement);
    nsCOMPtr<nsIDOMNode> model = do_QueryInterface(modelPriv);

    // Context Info: 'resource-uri'
    // The URI associated with the failed link.
    SetContextInfo("resource-uri", mSrc);

    nsXFormsUtils::DispatchEvent(model, eEvent_LinkError, nsnull, nsnull,
                                 &mContextInfo);
    return NS_OK;
  }

  // If there is still a channel, then someone must have changed the value of
  // the src attribute since the document finished loading and we haven't yet
  // determined whether the new link is valid or not.  For now we'll assume
  // that the value is good rather than returning a link error.  Also
  // canceling the channel since it is too late now.
  if (mChannel) {
    mChannel->Cancel(NS_BINDING_ABORTED);
  }

  if (mType != eType_Normal) {
    nsCOMPtr<nsIDOMEventTarget> target;

    if (mType == eType_Alert) {
      // Alert should fire only if target is the parent element.
      aEvent->GetTarget(getter_AddRefs(target));
    } else {
      // If <help> or <hint> is inside <action>, we don't want to fire them, 
      // unless xforms-help/xforms-hint is dispatched to the <action>.
      aEvent->GetCurrentTarget(getter_AddRefs(target));
    }
    nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(target));
    nsCOMPtr<nsIDOMNode> parent;
    mElement->GetParentNode(getter_AddRefs(parent));
    if (!parent || targetNode != parent)
      return NS_OK;
  }

  nsAutoString level;
  
  switch (mType) {
    case eType_Normal:
      mElement->GetAttribute(NS_LITERAL_STRING("level"), level);
      break;
    case eType_Hint:
      level.AssignLiteral("ephemeral");
      // Using the innermost <hint>.
      aEvent->StopPropagation();
      break;
    case eType_Help:
      level.AssignLiteral("modeless");
      // <help> is equivalent to a
      // <message level="modeless" ev:event="xforms-help" ev:propagate="stop>.
      aEvent->StopPropagation();
      aEvent->PreventDefault();
      break;
    case eType_Alert:
      if (HandleInlineAlert(aEvent))
        return NS_OK;

      level.AssignLiteral("modal");
      break;
  }

  if (level.IsEmpty())
    return NS_OK;

  nsCOMPtr<nsIDOMDocument> doc;
  mElement->GetOwnerDocument(getter_AddRefs(doc));

  return level.EqualsLiteral("ephemeral")
    ? HandleEphemeralMessage(doc, aEvent)
    : HandleModalAndModelessMessage(doc, level);
}

Here is the call graph for this function:

PRBool nsXFormsControlStubBase::HasBindingAttribute ( ) const [inline, protected, inherited]

Does control have a binding attribute?

Definition at line 264 of file nsXFormsControlStub.h.

{ return mBindAttrsCount != 0; };

Here is the caller graph for this function:

Definition at line 889 of file nsXFormsMessageElement.cpp.

{
  if (mEphemeralTimer) {
    mEphemeralTimer->Cancel();
    mEphemeralTimer = nsnull;
  }
  if (!mElement)
    return;

  nsCOMPtr<nsIDOMDocument> domdoc;
  mElement->GetOwnerDocument(getter_AddRefs(domdoc));
  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domdoc));
  if (!doc)
    return;
  nsXFormsMessageElement *msg =
    NS_STATIC_CAST(nsXFormsMessageElement*,
                   doc->GetProperty(nsXFormsAtoms::messageProperty));
  if (msg && msg != this) {
    msg->HideEphemeral();
    return;
  }
  doc->UnsetProperty(nsXFormsAtoms::messageProperty);

  nsCOMPtr<nsIXFormsEphemeralMessageUI> ui(do_QueryInterface(mElement));
  if (ui) {
    ui->Hide();
  }

  mEphemeralTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
  if (mEphemeralTimer)
    mEphemeralTimer->InitWithFuncCallback(sEphemeralCallbackResetPosition,
                                          this, 
                                          EPHEMERAL_POSITION_RESET_TIMEOUT,
                                          nsITimer::TYPE_ONE_SHOT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsXFormsMessageElement::ImportNode ( nsIDOMNode aSrc,
nsIDOMDocument aDestDoc,
nsIDOMNode **  aTarget 
) [private]

Definition at line 303 of file nsXFormsMessageElement.cpp.

{
  nsAutoString ns;
  nsAutoString localName;
  aSrc->GetNamespaceURI(ns);
  aSrc->GetLocalName(localName);
  // Clone the visual content of the <output>.
  // According to the XForms Schema it is enough 
  // to support <output> here.
  if (ns.EqualsLiteral(NS_NAMESPACE_XFORMS) &&
      localName.EqualsLiteral("output")) {
    nsCOMPtr<nsIDelegateInternal> outEl(do_QueryInterface(aSrc));
    if (outEl) {
      nsCOMPtr<nsIDOMText> text;
      nsAutoString value;
      outEl->GetValue(value);
      aDestDoc->CreateTextNode(value, getter_AddRefs(text));
      NS_IF_ADDREF(*aTarget = text);
    }
    return;
  }

  // Clone other elements
  aDestDoc->ImportNode(aSrc, PR_FALSE, aTarget);

  if (!*aTarget)
    return;

  // Add the new children
  nsCOMPtr<nsIDOMNode> tmp;
  nsCOMPtr<nsIDOMNodeList> childNodes;
  aSrc->GetChildNodes(getter_AddRefs(childNodes));

  PRUint32 count = 0;
  if (childNodes)
    childNodes->GetLength(&count);

  for (PRUint32 i = 0; i < count; ++i) {
    nsCOMPtr<nsIDOMNode> child;
    childNodes->Item(i, getter_AddRefs(child));
    
    if (child) {
      nsCOMPtr<nsIDOMNode> clone;
      ImportNode(child, aDestDoc, getter_AddRefs(clone));
      if (clone)
        (*aTarget)->AppendChild(clone, getter_AddRefs(tmp));
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsXFormsControlStubBase::IsBindingAttribute ( const nsIAtom aAttr) const [protected, virtual, inherited]

Checks whether an attribute is a binding attribute for the control.

This should be overriden by controls that have "non-standard" binding attributes.

Parameters:
aAttrThe attribute to check.

Reimplemented in nsXFormsRepeatElement.

Definition at line 953 of file nsXFormsControlStub.cpp.

{
  if (aAttr == nsXFormsAtoms::bind ||
      aAttr == nsXFormsAtoms::ref  ||
      aAttr == nsXFormsAtoms::model) {
    return PR_TRUE;
  }
  
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

This function is overridden by controls that are restricted in the type of content that may be bound to the control.

For example, xf:input may only be bound to simpleContent.

Reimplemented in nsXFormsTextareaElement, nsXFormsOutputElement, nsXFormsSelect1Element, nsXFormsSelectElement, and nsXFormsInputElement.

Definition at line 1003 of file nsXFormsControlStub.cpp.

{
  return PR_TRUE;
}

Here is the caller graph for this function:

This function determines if the content to which the control is being bound is complex; ie contains Element children.

Definition at line 1009 of file nsXFormsControlStub.cpp.

{
  PRBool isComplex = PR_FALSE;

  if (mBoundNode) {
    // If the bound node has any Element children, then it has complexContent.
    nsCOMPtr<nsIDOMNode> currentNode;
    mBoundNode->GetFirstChild(getter_AddRefs(currentNode));
    while (currentNode) {
      PRUint16 nodeType;
      currentNode->GetNodeType(&nodeType);
      if (nodeType == nsIDOMNode::ELEMENT_NODE) {
        isComplex = PR_TRUE;
        break;
      }

      nsCOMPtr<nsIDOMNode> node;
      currentNode->GetNextSibling(getter_AddRefs(node));
      currentNode.swap(node);
    }
  }
  return isComplex;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Determine if the message is Ephemeral.

Definition at line 1277 of file nsXFormsMessageElement.cpp.

{
  if (mType == eType_Hint)
    return PR_TRUE;

  nsAutoString level;
  mElement->GetAttribute(NS_LITERAL_STRING("level"), level);
  return level.Equals(NS_LITERAL_STRING("ephemeral"));
}

Here is the caller graph for this function:

According to sec 4.1 in the spec, only certain controls are allowed to be targets of the interaction and notification events.

The controls that inherit from nsXFormsControlStub that SHOULDN'T get these events need to override IsEventTarget() and return PR_FALSE

NS_IMETHODIMP nsXFormsDelegateStub::IsTypeAllowed ( PRUint16  aType,
PRBool aIsAllowed,
nsRestrictionFlag aRestriction,
nsAString &  aTypes 
) [inherited]

This function is overridden by controls that are restricted in the datatypes that they can bind to.

aTypes will be filled out and returned only if aIsAllowed is found to be PR_FALSE.

Parameters:
aTypeType we are testing against
aIsAllowedIndicates whether control can bind to aType
aRestrictionOutput. If eTypes_Inclusive, then the types returned in aTypes is the list of builtin types that this control can bind to. If eTypes_Exclusive, the types returned in aTypes is the list of builtin types that this control cannot be bound to.
aTypesOutput. A " " delimited list of builtin types that the control has some restriction with, as specified by aRestriction.

Reimplemented in nsXFormsTextareaElement, nsXFormsUploadElement, nsXFormsRangeElement, and nsXFormsInputElement.

Definition at line 192 of file nsXFormsDelegateStub.cpp.

{
  NS_ENSURE_ARG_POINTER(aRestriction);
  NS_ENSURE_ARG_POINTER(aIsAllowed);
  *aIsAllowed = PR_TRUE;
  *aRestriction = eTypes_NoRestriction;
  aTypes.Truncate();
  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsXFormsControlStubBase::MaybeAddToModel ( nsIModelElementPrivate aOldModel,
nsIXFormsControl aParent 
) [protected, inherited]

Adds the form control to the model, if the model has changed.

Parameters:
aOldModelThe previous model the control was bound to
aParentThe parent XForms control

Definition at line 310 of file nsXFormsControlStub.cpp.

{
  if (GetRepeatState() == eType_Template) {
    // No sense going any further.  A template control has no need to bind,
    // refresh, etc. so no reason to put it on the model's control list
    return NS_OK;
  }

  // XXX: just doing pointer comparison would be nice....
  PRBool sameModel = PR_FALSE;
  nsresult rv;

  if (mModel) {
    nsCOMPtr<nsIDOM3Node> n3Model(do_QueryInterface(mModel));
    nsCOMPtr<nsIDOMNode> nOldModel(do_QueryInterface(aOldModel));
    NS_ASSERTION(n3Model, "model element not supporting nsIDOM3Node?!");
    rv = n3Model->IsSameNode(nOldModel, &sameModel);
    NS_ENSURE_SUCCESS(rv, rv);
  } else {
    sameModel = !aOldModel;
  }

  if (!sameModel) {
    if (aOldModel) {
      rv = aOldModel->RemoveFormControl(this);
      NS_ENSURE_SUCCESS(rv, rv);
    }
    if (mModel) {
      rv = mModel->AddFormControl(this, aParent);
      NS_ENSURE_SUCCESS(rv, rv);
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIChannelEventSink::onChannelRedirect ( in nsIChannel  oldChannel,
in nsIChannel  newChannel,
in unsigned long  flags 
) [inherited]

Called when a redirect occurs.

This may happen due to an HTTP 3xx status code.

Parameters:
oldChannelThe channel that's being redirected.
newChannelThe new channel. This channel is not opened yet.
flagsFlags indicating the type of redirect. A bitmask consisting of flags from above. One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be set.
Exceptions:
<any>Throwing an exception will cancel the load. No network request for the new channel will be made.

onCreated will be called before any notifications are sent to the xtf element.

Parameters:
wrapperis a weak proxy to the wrapping element (i.e. holding a reference to this will not create a cycle).

This sets the notification mask and initializes mElement.

Reimplemented from nsXFormsDelegateStub.

Definition at line 239 of file nsXFormsMessageElement.cpp.

Here is the call graph for this function:

void nsIStreamListener::onDataAvailable ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsIInputStream  aInputStream,
in unsigned long  aOffset,
in unsigned long  aCount 
) [inherited]

Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.

The onDataAvailable impl must read exactly |aCount| bytes of data before returning.

Parameters:
aRequestrequest corresponding to the source of the data
aContextuser defined context
aInputStreaminput stream containing the data chunk
aOffsetNumber of bytes that were sent in previous onDataAvailable calls for this request. In other words, the sum of all previous count parameters. If that number is greater than or equal to 2^32, this parameter will be PR_UINT32_MAX (2^32 - 1).
aCountnumber of bytes available in the stream

NOTE: The aInputStream parameter must implement readSegments.

An exception thrown from onDataAvailable has the side-effect of causing the request to be canceled.

Reimplemented from nsXFormsDelegateStub.

Definition at line 280 of file nsXFormsMessageElement.cpp.

void nsIRequestObserver::onStartRequest ( in nsIRequest  aRequest,
in nsISupports  aContext 
) [inherited]

Called to signify the beginning of an asynchronous request.

Parameters:
aRequestrequest being observed
aContextuser defined context

An exception thrown from onStartRequest has the side-effect of causing the request to be canceled.

Here is the caller graph for this function:

void nsIRequestObserver::onStopRequest ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsresult  aStatusCode 
) [inherited]

Called to signify the end of an asynchronous request.

This call is always preceded by a call to onStartRequest.

Parameters:
aRequestrequest being observed
aContextuser defined context
aStatusCodereason for stopping (NS_OK if completed successfully)

An exception thrown from onStopRequest is generally ignored.

Here is the caller graph for this function:

Reimplemented from nsXFormsBindableControlStub.

Definition at line 384 of file nsXFormsMessageElement.cpp.

{
  if (mType == eType_Normal || !aNewParent)
    return nsXFormsDelegateStub::ParentChanged(aNewParent);

  nsCOMPtr<nsIDOMEventTarget> targ(do_QueryInterface(aNewParent));
  NS_ENSURE_STATE(targ);

  if (mType == eType_Hint) {
    targ->AddEventListener(NS_LITERAL_STRING("xforms-hint"), this, PR_FALSE);
    targ->AddEventListener(NS_LITERAL_STRING("xforms-moz-hint-off"),
                           this, PR_FALSE);
  } else if (mType == eType_Help) {
    targ->AddEventListener(NS_LITERAL_STRING("xforms-help"), this, PR_FALSE);
  } else if (mType == eType_Alert) {
    // Adding listeners for error events, which have a form control as a target.
    targ->AddEventListener(NS_LITERAL_STRING("xforms-invalid"), this, PR_TRUE);
    targ->AddEventListener(NS_LITERAL_STRING("xforms-out-of-range"), this, PR_TRUE);
    targ->AddEventListener(NS_LITERAL_STRING("xforms-binding-exception"), this, PR_TRUE);
  }

  return nsXFormsDelegateStub::ParentChanged(aNewParent);
}

Here is the call graph for this function:

void nsIXTFElement::parentChanged ( in nsIDOMElement  newParent) [inherited]
nsresult nsXFormsControlStubBase::ProcessNodeBinding ( const nsString aBindingAttr,
PRUint16  aResultType,
nsIDOMXPathResult **  aResult,
nsIModelElementPrivate **  aModel = nsnull 
) [protected, inherited]

Processes the node binding of a control, get the current Model (mModel) and binds the control to it.

Note:
Will return NS_OK_XFORMS_DEFERRED if the binding is being deferred.
Parameters:
aBindingAttrThe default binding attribute
aResultTypeThe XPath result type requested
aResultThe XPath result
aModelThe model

Definition at line 348 of file nsXFormsControlStub.cpp.

{
  nsStringArray indexesUsed;

  if (aResult) {
    *aResult = nsnull;
  }

  if (aModel) {
    *aModel = nsnull;
  }

  // let's not go through all of this rigamarol if we don't have a chance
  // in heck of binding anyhow.  Check to see if the models will be receptive
  // to some binding.  readyForBindProperty is set when they are.  Make sure
  // to return NS_OK so that we don't start complaining about binding
  // failures in this situation.

  if (!nsXFormsUtils::IsDocumentReadyForBind(mElement)) {
    nsXFormsModelElement::DeferElementBind(this);
    return NS_OK_XFORMS_DEFERRED;
  }

  nsresult rv;
  PRBool usesModelBinding;
  nsCOMPtr<nsIModelElementPrivate> oldModel(mModel);
  nsCOMPtr<nsIXFormsControl> parentControl;
  rv = nsXFormsUtils::EvaluateNodeBinding(mElement,
                                          kElementFlags,
                                          aBindingAttr,
                                          EmptyString(),
                                          aResultType,
                                          getter_AddRefs(mModel),
                                          aResult,
                                          &usesModelBinding,
                                          getter_AddRefs(parentControl),
                                          &mDependencies,
                                          &indexesUsed);
  NS_ENSURE_SUCCESS(rv, rv);

  // if NS_OK_XFORMS_NOTREADY, mModel probably won't exist or might no longer
  // be valid, so shouldn't continue.
  if (rv == NS_OK_XFORMS_NOTREADY) {
    return rv;
  }

  NS_ENSURE_STATE(mModel);

  rv = MaybeAddToModel(oldModel, parentControl);
  NS_ENSURE_SUCCESS(rv, rv);

  if (aModel)
    NS_ADDREF(*aModel = mModel);

  mUsesModelBinding = usesModelBinding;

  if (indexesUsed.Count()) {
    // add index listeners on repeat elements

    for (PRInt32 i = 0; i < indexesUsed.Count(); ++i) {
      // Find the repeat element and add |this| as a listener
      nsCOMPtr<nsIDOMElement> repElem;
      nsXFormsUtils::GetElementByContextId(mElement, *(indexesUsed[i]),
                                           getter_AddRefs(repElem));
      nsCOMPtr<nsIXFormsRepeatElement> rep(do_QueryInterface(repElem));
      if (!rep)
        continue;

      rv = rep->AddIndexUser(this);
      NS_ENSURE_SUCCESS(rv, rv);

      rv = mIndexesUsed.AppendObject(rep);
      NS_ENSURE_SUCCESS(rv, rv);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 817 of file nsXFormsControlStub.cpp.

Here is the call graph for this function:

This method is used to force the control to recalculate its bound node and to refresh.

Used primarily internally to correct situations where DOM manipulations have gotten things out of balance.

This tells the form control to update its state based on the current instance data.

Reimplemented from nsXFormsControlStubBase.

Reimplemented in nsXFormsRepeatElement, nsXFormsOutputElement, nsXFormsItemSetElement, nsXFormsLabelElement, nsXFormsSelect1Element, and nsXFormsSelectElement.

Definition at line 86 of file nsXFormsDelegateStub.cpp.

{
  if (GetRepeatState() == eType_Template)
    return NS_OK_XFORMS_NOREFRESH;

  const nsVoidArray* list = nsPostRefresh::PostRefreshList();
  if (list && list->IndexOf(this) >= 0) {
    // This control will be refreshed later.
    return NS_OK_XFORMS_NOREFRESH;
  }

  nsresult rv = nsXFormsBindableControlStub::Refresh();
  NS_ENSURE_SUCCESS(rv, rv);

  SetMozTypeAttribute();

  nsCOMPtr<nsIXFormsUIWidget> widget = do_QueryInterface(mElement);

  return widget ? widget->Refresh() : NS_OK;
}

Here is the call graph for this function:

Removes the index change event listeners.

Definition at line 130 of file nsXFormsControlStub.cpp.

{
  if (!mIndexesUsed.Count())
    return;

  for (PRInt32 i = 0; i < mIndexesUsed.Count(); ++i) {
    nsCOMPtr<nsIXFormsRepeatElement> rep = mIndexesUsed[i];
    rep->RemoveIndexUser(this);
  }

  mIndexesUsed.Clear();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIXFormsDelegate::reportError ( in DOMString  errorMsg) [inherited]

Report an error.

Parameters:
errorMsgThe error message id.
void nsIXFormsDelegate::reportErrorMessage ( in DOMString  errorMsg) [inherited]

Report an error.

Parameters:
errorMsgThe literal/raw message to report.
NS_IMETHODIMP nsXFormsControlStubBase::ResetBoundNode ( const nsString aBindAttribute,
PRUint16  aResultType,
PRBool aContextChanged 
) [inherited]

Definition at line 144 of file nsXFormsControlStub.cpp.

{
  NS_ENSURE_ARG(aContextChanged);

  // Clear existing bound node, etc.
  *aContextChanged = mBoundNode ? PR_TRUE : PR_FALSE;
  nsCOMPtr<nsIDOMNode> oldBoundNode;
  oldBoundNode.swap(mBoundNode);
  mUsesModelBinding = PR_FALSE;
  mAppearDisabled = PR_FALSE;
  mDependencies.Clear();
  RemoveIndexListeners();

  if (!mHasParent || !mHasDoc || !HasBindingAttribute())
    return NS_OK_XFORMS_NOTREADY;

  nsCOMPtr<nsIDOMXPathResult> result;
  nsresult rv = ProcessNodeBinding(aBindAttribute, aResultType,
                                   getter_AddRefs(result));

  if (NS_FAILED(rv)) {
    nsXFormsUtils::ReportError(NS_LITERAL_STRING("controlBindError"), mElement);
    return rv;
  }

  if (rv == NS_OK_XFORMS_DEFERRED || rv == NS_OK_XFORMS_NOTREADY || !result) {
    // Binding was deferred, or not bound
    return rv;
  }

  // Get context node, if any
  if (mUsesModelBinding) {
    // When bound via @bind, we'll get a snapshot back
    result->SnapshotItem(0, getter_AddRefs(mBoundNode));
  } else {
    result->GetSingleNodeValue(getter_AddRefs(mBoundNode));
  }

  *aContextChanged = (oldBoundNode != mBoundNode);

  // Some controls may not be bound to certain types of content. If the content
  // is a disallowed type, report the error and dispatch a binding exception
  // event.
  PRBool isAllowed = IsContentAllowed();

  if (!mBoundNode || !isAllowed) {
    // If there's no result (ie, no instance node) returned by the above, it
    // means that the binding is not pointing to an instance data node, so we
    // should disable the control.
    mAppearDisabled = PR_TRUE;

    if (!isAllowed) {
      // build the error string that we want output to the ErrorConsole
      nsAutoString localName;
      mElement->GetLocalName(localName);
      const PRUnichar *strings[] = { localName.get() };

      nsXFormsUtils::ReportError(
        NS_LITERAL_STRING("boundTypeErrorComplexContent"),
        strings, 1, mElement, mElement);

      nsXFormsUtils::DispatchEvent(mElement, eEvent_BindingException);
    }

    nsCOMPtr<nsIXTFElementWrapper> wrapper(do_QueryInterface(mElement));
    NS_ENSURE_STATE(wrapper);

    PRInt32 iState;
    GetDisabledIntrinsicState(&iState);
    return wrapper->SetIntrinsicState(iState);
  }

  // Check for presence of @xsi:type on bound node and add as a dependency
  nsCOMPtr<nsIDOMElement> boundEl(do_QueryInterface(mBoundNode));
  if (boundEl) {
    nsCOMPtr<nsIDOMAttr> attrNode;
    rv = boundEl->GetAttributeNodeNS(NS_LITERAL_STRING(NS_NAMESPACE_XML_SCHEMA_INSTANCE),
                                     NS_LITERAL_STRING("type"),
                                     getter_AddRefs(attrNode));
    if (NS_SUCCEEDED(rv) && attrNode) {
      mDependencies.AppendObject(attrNode);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 147 of file nsXFormsMessageElement.cpp.

  {
    mPosX = mPosY = -1;
  }

Here is the caller graph for this function:

void nsXFormsControlStubBase::ResetHelpAndHint ( PRBool  aInitialize) [protected, inherited]

Reset (and reinitialize) the event listener, which is used to create xforms-hint and xforms-help events.

Definition at line 454 of file nsXFormsControlStub.cpp.

{
  nsCOMPtr<nsIDOMEventTarget> targ(do_QueryInterface(mElement));
  if (!targ)
    return;

  NS_NAMED_LITERAL_STRING(mouseover, "mouseover");
  NS_NAMED_LITERAL_STRING(mouseout, "mouseout");
  NS_NAMED_LITERAL_STRING(focus, "focus");
  NS_NAMED_LITERAL_STRING(blur, "blur");
  NS_NAMED_LITERAL_STRING(keypress, "keypress");

  if (mEventListener) {
    targ->RemoveEventListener(mouseover, mEventListener, PR_TRUE);
    targ->RemoveEventListener(mouseout, mEventListener, PR_TRUE);
    targ->RemoveEventListener(focus, mEventListener, PR_TRUE);
    targ->RemoveEventListener(blur, mEventListener, PR_TRUE);
    targ->RemoveEventListener(keypress, mEventListener, PR_TRUE);
    mEventListener = nsnull;
  }

  if (aInitialize) {
    mEventListener = new nsXFormsHintHelpListener();
    if (!mEventListener)
      return;

    targ->AddEventListener(mouseover, mEventListener, PR_TRUE);
    targ->AddEventListener(mouseout, mEventListener, PR_TRUE);
    targ->AddEventListener(focus, mEventListener, PR_TRUE);
    targ->AddEventListener(blur, mEventListener, PR_TRUE);
    targ->AddEventListener(keypress, mEventListener, PR_TRUE);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 913 of file nsXFormsControlStub.cpp.

{
  // A control should never be on more than one aborted bind list.  There is
  // probably a chance through some crazy DOM stirring for a control to be
  // waiting on notification from a context control and then the control finds
  // itself trying to bind again under a whole different parent tree.  So we'll
  // have the control remove itself from the old list and link itself to the
  // new list.

  if (mAbortedBindListContainer && aControlContainingList) {
    if (!SameCOMIdentity(mAbortedBindListContainer, aControlContainingList)) {
      mAbortedBindListContainer->AddRemoveAbortedControl(this, PR_FALSE);
    }
  }

  mAbortedBindListContainer = aControlContainingList;
  return NS_OK;
}

Here is the call graph for this function:

void nsIXFormsContextControl::setContext ( in nsIDOMNode  aContextNode,
in long  aContextPosition,
in long  aContextSize 
) [inherited]

Used by parents to set the context for children.

Parameters:
aContextNodeThe context node
aContextPositionThe context position
aContextSizeThe context size
nsresult nsXFormsMessageElement::SetContextInfo ( const char *  aName,
const nsAString &  aValue 
) [private]

Set context info for events.

Parameters:
aNameName of the context property.
aValueValue of the context property.

Definition at line 1288 of file nsXFormsMessageElement.cpp.

{
  nsCOMPtr<nsXFormsContextInfo> contextInfo = new nsXFormsContextInfo(mElement);
  NS_ENSURE_TRUE(contextInfo, NS_ERROR_OUT_OF_MEMORY);
  contextInfo->SetStringValue(aName, aValue);
  mContextInfo.AppendObject(contextInfo);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 66 of file nsXFormsActionModuleBase.h.

{ mCurrentEvent = aEvent; }

Here is the caller graph for this function:

void nsXFormsDelegateStub::SetMozTypeAttribute ( ) [protected, inherited]

Definition at line 205 of file nsXFormsDelegateStub.cpp.

{
  NS_NAMED_LITERAL_STRING(mozTypeNs, NS_NAMESPACE_MOZ_XFORMS_TYPE);
  NS_NAMED_LITERAL_STRING(mozType, "type");
  NS_NAMED_LITERAL_STRING(mozTypeList, "typelist");
  NS_NAMED_LITERAL_STRING(mozRejectedType, "rejectedtype");

  // can't use mBoundNode here since mBoundNode can exist for xf:output, for
  // example, even if there is no binding attribute.
  nsCOMPtr<nsIDOMNode> boundNode;
  GetBoundNode(getter_AddRefs(boundNode));
  if (mModel && boundNode) {
    nsAutoString type, nsOrig;
    if (NS_FAILED(mModel->GetTypeAndNSFromNode(boundNode, type, nsOrig))) {
      mElement->RemoveAttributeNS(mozTypeNs, mozType);
      mElement->RemoveAttributeNS(mozTypeNs, mozTypeList);
      mElement->RemoveAttributeNS(mozTypeNs, mozRejectedType);
      return;
    }

    nsAutoString attrValue(nsOrig);
    attrValue.AppendLiteral("#");
    attrValue.Append(type);
    mElement->SetAttributeNS(mozTypeNs, mozType, attrValue);

    // Get the list of types that this type derives from and set it as the
    // value of the basetype attribute
    nsresult rv = mModel->GetDerivedTypeList(type, nsOrig, attrValue);
    if (NS_SUCCEEDED(rv)) {
      mElement->SetAttributeNS(mozTypeNs, mozTypeList, attrValue);
    } else {
      // Note: even if we can't build the derived type list, we should leave on
      // mozType attribute.  We can still use the attr for validation, etc.  But
      // the type-restricted controls like range and upload won't display since
      // they are bound to their anonymous content by @typeList.  Make sure that
      // we don't leave around mozTypeList if it isn't accurate.
      mElement->RemoveAttributeNS(mozTypeNs, mozTypeList);
    }

    // Get the builtin type that the bound type is derived from.  Then determine
    // if this control is allowed to bind to this type.  Some controls like
    // input, secret, textarea, upload and range can only bind to some types
    // and not to others.
    PRUint16 builtinType = 0;
    rv = GetBoundBuiltinType(&builtinType);
    if (NS_SUCCEEDED(rv)) {
      PRBool isAllowed = PR_TRUE;
      nsAutoString restrictedTypeList;
      nsRestrictionFlag restriction;
      IsTypeAllowed(builtinType, &isAllowed, &restriction, restrictedTypeList);
      if (!isAllowed) {
        // if this control isn't allowed to bind to this type, we'll set the
        // 'mozType:rejectedtype' attr to true so that our default CSS will
        // not display the control
        mElement->SetAttributeNS(mozTypeNs, mozRejectedType,
                                 NS_LITERAL_STRING("true"));

        // build the error string that we want output to the ErrorConsole
        nsAutoString localName;
        mElement->GetLocalName(localName);
        const PRUnichar *strings[] = { localName.get(), restrictedTypeList.get() };

        nsXFormsUtils::ReportError(
          restriction == eTypes_Inclusive ?
            NS_LITERAL_STRING("boundTypeErrorInclusive") :
            NS_LITERAL_STRING("boundTypeErrorExclusive"),
          strings, 2, mElement, mElement);
        return;
      }
    }
    // We reached here for one of two reasons:
    // 1) The control can handle this type
    // 2) We don't have enough information to make a judgement.
    //
    // Either way, we'll remove the attribute so that the control is useable
    mElement->RemoveAttributeNS(mozTypeNs, mozRejectedType);

    return;
  }

  mElement->RemoveAttributeNS(mozTypeNs, mozType);
  mElement->RemoveAttributeNS(mozTypeNs, mozTypeList);
  mElement->RemoveAttributeNS(mozTypeNs, mozRejectedType);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 287 of file nsXFormsControlStub.cpp.

{
  mOnDeferredBindList = aPutOnList;
  return NS_OK;
}

Reimplemented in nsXFormsContextContainer.

Definition at line 1040 of file nsXFormsControlStub.cpp.

{
  mRepeatState = aState;
  return;
}

Here is the caller graph for this function:

Definition at line 848 of file nsXFormsMessageElement.cpp.

{
  HideEphemeral();
  if (!mElement)
    return;
  nsCOMPtr<nsIDOMDocument> domdoc;
  mElement->GetOwnerDocument(getter_AddRefs(domdoc));
  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domdoc));
  if (!doc)
    return;
  doc->SetProperty(nsXFormsAtoms::messageProperty, this);
  mEphemeralTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
  if (mEphemeralTimer)
    mEphemeralTimer->InitWithFuncCallback(sEphemeralCallbackShow, this, 
                                          SHOW_EPHEMERAL_TIMEOUT,
                                          nsITimer::TYPE_ONE_SHOT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Begin the process of testing to see if this message element could get held up later by linking to an external resource.

Run this when the element is set up and it will try to access any external resource that this message may later try to access. If we can't get to it by the time the message is triggered, then throw a xforms-link-error.

Definition at line 926 of file nsXFormsMessageElement.cpp.

{
  // Let's see if checking for any external resources is even necessary.  Single
  // node binding trumps linking attributes in order of precendence.  If we
  // find single node binding in evidence, then return NS_OK to show that
  // this message element has access to the info that it needs.
  nsAutoString snb;
  mElement->GetAttribute(NS_LITERAL_STRING("bind"), snb);
  if (!snb.IsEmpty()) {
    return NS_OK;
  }
  mElement->GetAttribute(NS_LITERAL_STRING("ref"), snb);
  if (!snb.IsEmpty()) {
    return NS_OK;
  }

  // if no linking attribute, no need to go on
  nsAutoString src;
  mElement->GetAttribute(NS_LITERAL_STRING("src"), src);
  if (src.IsEmpty()) {
    return NS_OK;
  }
  // Remember the src attribute so we can set it in the context info
  // for the xforms-link-error event if the link fails.
  mSrc = src;

  nsCOMPtr<nsIDOMDocument> domDoc;
  mElement->GetOwnerDocument(getter_AddRefs(domDoc));
  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
  NS_ENSURE_STATE(doc);
  nsCOMPtr<nsIURI> uri;
  NS_NewURI(getter_AddRefs(uri), src, doc->GetDocumentCharacterSet().get(),
            doc->GetDocumentURI());
  NS_ENSURE_STATE(uri);

  if (!nsXFormsUtils::CheckConnectionAllowed(mElement, uri)) {
    nsAutoString tagName;
    mElement->GetLocalName(tagName);
    const PRUnichar *strings[] = { tagName.get() };
    nsXFormsUtils::ReportError(NS_LITERAL_STRING("externalLinkLoadOrigin"),
                               strings, 1, mElement, mElement);
    // Keep the the dialog from popping up.  Won't be able to reach the
    // resource anyhow.
    mStopType = eStopType_Security;
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsILoadGroup> loadGroup = doc->GetDocumentLoadGroup();
  NS_WARN_IF_FALSE(loadGroup, "No load group!");

  // Using the same load group as the main document and creating
  // the channel with LOAD_NORMAL flag delays the dispatching of
  // the 'load' event until message data document has been loaded.
  nsresult rv = NS_NewChannel(getter_AddRefs(mChannel), uri, nsnull, loadGroup,
                              this, nsIRequest::LOAD_NORMAL);
  NS_ENSURE_TRUE(mChannel, rv);
  
  // See if it's an http channel.  We'll look at the http status code more
  // closely and only request the "HEAD" to keep the response small.
  // Especially since we are requesting this for every message in the document
  // and in most cases we pass off the URL to another browser service to
  // get and display the message so no good to try to look at the contents
  // anyway.
  nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
  if (httpChannel) {
    if (!IsEphemeral()) {
      PRBool isReallyHTTP = PR_FALSE;
      uri->SchemeIs("http", &isReallyHTTP);
      if (!isReallyHTTP) {
        uri->SchemeIs("https", &isReallyHTTP);
      }
      if (isReallyHTTP) {
        httpChannel->SetRequestMethod(NS_LITERAL_CSTRING("HEAD"));
      }
    }
  }

  rv = mChannel->AsyncOpen(this, nsnull);
  if (NS_FAILED(rv)) {
    mChannel = nsnull;
  
    // URI doesn't exist; report error.
    // set up the error strings
    nsAutoString tagName;
    mElement->GetLocalName(tagName);
    const PRUnichar *strings[] = { src.get(), tagName.get() };
    nsXFormsUtils::ReportError(NS_LITERAL_STRING("externalLink1Error"),
                               strings, 2, mElement, mElement);
    mStopType = eStopType_LinkError;
    // Remember the src attribute so we can set it in the context info
    // for the xforms-link-error event.
    mSrc = src;
    return NS_ERROR_FAILURE;
  }

  // channel should be running along smoothly, increment the count
  AddRemoveExternalResource(PR_TRUE);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Tries to move focus to form control and returns true if succeeded.

Reimplemented from nsXFormsControlStubBase.

Reimplemented in nsXFormsRepeatElement, and nsXFormsGroupElement.

Definition at line 108 of file nsXFormsDelegateStub.cpp.

{
  *aOK = PR_FALSE;
  if (GetRelevantState()) {
    nsCOMPtr<nsIXFormsUIWidget> widget = do_QueryInterface(mElement);
    if (widget) {
      widget->Focus(aOK);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

nsRepeatState nsXFormsControlStubBase::UpdateRepeatState ( nsIDOMNode aParent) [protected, virtual, inherited]

This is called when the parent node for a XForms control changes.

It checks the ancestors of the element and returns an nsRepeatState depending on the element's place in the document.

Parameters:
aParentThe new parent of the XForms control

Reimplemented in nsXFormsRepeatElement.

Definition at line 1047 of file nsXFormsControlStub.cpp.

{
  // Walk up the parent chain looking to see if the this control is contained
  // in an item.  If it is and that item is contained in a itemset, then we
  // know that this control was generated as a clone from the itemset's
  // template.  Similarly, we'll check to see if this control lives in a
  // contextcontainer (meaning it was cloned from a repeat's template).
  // Otherwise, if neither of these are the case but it lives under a repeat
  // or an itemset, then this control must be part of a template.  A template
  // is the content of a repeat or itemset that gets cloned once for every
  // node in the bound nodeset.
  //
  // If none of this applies, we'll return eType_NotApplicable to show that this
  // control isn't bound to a repeating nodeset.
  nsRepeatState repeatState = eType_NotApplicable;

  if (!mHasDoc || !mHasParent) {
    // If we don't have a document or a parent, none of these tests will work
    // correctly so no sense doing them now.  If either of these are false the
    // repeat state for the object should already be eType_Unknown so just
    // return that now.
    return eType_Unknown;
  }

  nsCOMPtr<nsIDOMNode> parent = aParent;
  PRBool childIsItem = PR_FALSE;
  while (parent) {
    if (nsXFormsUtils::IsXFormsElement(parent,
                                       NS_LITERAL_STRING("contextcontainer"))) {
      repeatState = eType_GeneratedContent;
      break;
    }
    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("repeat"))) {
      repeatState = eType_Template;
      break;
    }
    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("itemset"))) {
      if (childIsItem) {
        repeatState = eType_GeneratedContent;
        break;
      }
      repeatState = eType_Template;
      break;
    }

    if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("item"))) {
      childIsItem = PR_TRUE;
    } else {

      nsCOMPtr<nsIDOMElement> parentEle(do_QueryInterface(parent));
      if (!parentEle) {
        // I don't know how this can possibly happen, but if it does I guess
        // we should just ignore it and coninue on our way.
        break;
      }

      // if this control is contained underneath an element that contains
      // an xforms binding attribute that introduces an anonymous xf:repeat
      // then the control is part of a template
      PRBool repeatAttr = PR_FALSE;
      parentEle->HasAttributeNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS),
                                NS_LITERAL_STRING("repeat-bind"),
                                &repeatAttr);
      if (repeatAttr) {
        repeatState = eType_Template;
        break;
      }

      parentEle->HasAttributeNS(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS),
                                NS_LITERAL_STRING("repeat-nodeset"),
                                &repeatAttr);
      if (repeatAttr) {
        repeatState = eType_Template;
        break;
      }
    }
    nsCOMPtr<nsIDOMNode> tmp;
    parent->GetParentNode(getter_AddRefs(tmp));
    parent = tmp;
  }

  SetRepeatState(repeatState);
  return repeatState;
}

Here is the call graph for this function:

Here is the caller graph for this function:

This should be called by XBL widgets, when they are created.

Reimplemented from nsXFormsBindableControlStub.

Definition at line 251 of file nsXFormsMessageElement.cpp.

{
  if (mDocument) {
    if (mEphemeralTimer) {
      mEphemeralTimer->Cancel();
      mEphemeralTimer = nsnull;
    }

    nsCOMPtr<nsIDocument> doc(do_QueryInterface(mDocument));
    if (doc) {
      nsXFormsMessageElement *msg =
        NS_STATIC_CAST(nsXFormsMessageElement*,
                       doc->GetProperty(nsXFormsAtoms::messageProperty));
      if (msg == this)
        doc->UnsetProperty(nsXFormsAtoms::messageProperty);
    }

    // If we are currently trying to load an external message, cancel the
    // request.
    if (mChannel) {
      mChannel->Cancel(NS_BINDING_ABORTED);
    }
  }

  mDocument = aNewDocument;
  return nsXFormsDelegateStub::WillChangeDocument(aNewDocument);
}

Here is the call graph for this function:

Reimplemented from nsXFormsBindableControlStub.

Definition at line 355 of file nsXFormsMessageElement.cpp.

{
  if (mType == eType_Normal)
    return nsXFormsDelegateStub::WillChangeParent(aNewParent);
  
  nsCOMPtr<nsIDOMNode> parent;
  mElement->GetParentNode(getter_AddRefs(parent));
  if (!parent)
    return nsXFormsDelegateStub::WillChangeParent(aNewParent);

  nsCOMPtr<nsIDOMEventTarget> targ(do_QueryInterface(parent));
  NS_ENSURE_STATE(targ);
  
  if (mType == eType_Hint) {
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-hint"), this, PR_FALSE);
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-moz-hint-off"),
                              this, PR_FALSE);
  } else if (mType == eType_Help) {
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-help"), this, PR_FALSE);      
  } else if (mType == eType_Alert) {
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-invalid"), this, PR_TRUE);
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-out-of-range"), this, PR_TRUE);
    targ->RemoveEventListener(NS_LITERAL_STRING("xforms-binding-exception"),this, PR_TRUE);
  }

  return nsXFormsDelegateStub::WillChangeParent(aNewParent);
}

Here is the call graph for this function:

void nsIXTFElement::willInsertChild ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]

Reimplemented from nsXFormsControlStubBase.

Definition at line 412 of file nsXFormsControlStub.h.

void nsIXTFElement::willRemoveChild ( in unsigned long  index) [inherited]
void nsIXTFElement::willSetAttribute ( in nsIAtom  name,
in AString  newValue 
) [inherited]
NS_IMETHOD nsXFormsBindableControlStub::WillSetAttribute ( nsIAtom aName,
const nsAString &  aValue 
) [inline, inherited]

Reimplemented from nsXFormsControlStubBase.

Definition at line 402 of file nsXFormsControlStub.h.


Member Data Documentation

The keeper of the aborted bind list, if any, that this control is currently listed on.

In other words, if this control tried to bind and couldn't, we added it to the appropriate context control's aborted bind list so that this control could bind as soon as the context control is able to bind. But if this control is removed from the DOM before it has a chance to be processed, we should remove it from the list so that it can be cleaned up appropriately.

Definition at line 138 of file nsIXFormsControl.idl.

The instance node that the control is bound to.

Definition at line 63 of file nsIXFormsControl.idl.

These represent the default intrinsic states for controls when they are enabled and disabled.

Definition at line 117 of file nsIXFormsControl.idl.

The instance nodes that the control depend on.

In other words, all the instance nodes that could influence which node the control is bound to (mBoundNode). For example: If a node has "/share[@owner = /me]", it depends on all /share nodes, all attributes on /share nodes, and all /me nodes.

Definition at line 84 of file nsIXFormsControl.idl.

Definition at line 118 of file nsIXFormsControl.idl.

Get the element that should receive events for the control.

Todo:
This should not be necessary, we should send directly to the control (XXX)

Definition at line 92 of file nsIXFormsControl.idl.

Definition at line 72 of file nsIXTFElement.idl.

Definition at line 56 of file nsIXTFElement.idl.

Definition at line 60 of file nsIXTFElement.idl.

Definition at line 64 of file nsIXTFElement.idl.

Definition at line 68 of file nsIXTFElement.idl.

readonly attribute unsigned long nsIXTFElement::elementType [inherited]

Definition at line 78 of file nsIXTFElement.idl.

Is the delegate bound to a node?

Definition at line 56 of file nsIDelegateInternal.idl.

Definition at line 86 of file nsIXTFElement.idl.

The element flags for the controls passed to nsXFormsUtils:EvaluateNodeBinding()

Definition at line 78 of file nsXFormsControlStub.h.

The standard notification flags set on nsIXTFElement.

Definition at line 72 of file nsXFormsControlStub.h.

List of XForms elements contained by this control who tried to bind and couldn't because this control wasn't ready to bind, yet.

This means that these contained nodes couldn't bind because they could be potentially using this control's bound node as a context node. When this control is ready to bind and successfully binds, then this list will be processed. And in turn, if these controls contain controls on THEIR mAbortedBindList, then they will be similarly processed.

Definition at line 253 of file nsXFormsControlStub.h.

The control that contains the aborted bind list that this control is on.

A control should never be on more than one list at a time.

Definition at line 259 of file nsXFormsControlStub.h.

The accessors object for this delegate.

Definition at line 120 of file nsXFormsDelegateStub.h.

Should the control appear disabled.

This is f.x. used when a valid single node binding is not pointing to an instance data node.

Definition at line 223 of file nsXFormsControlStub.h.

PRInt8 nsXFormsControlStubBase::mBindAttrsCount [protected, inherited]

Used to keep track of whether this control has any single node binding attributes.

Definition at line 234 of file nsXFormsControlStub.h.

The node that the control is bound to.

Definition at line 192 of file nsXFormsControlStub.h.

This signals whether or not this action can iterate.

Technically, all XForms 1.1 actions are allowed to iterate, but for some of them it may not make sense. Currently, this is set to PR_TRUE for all actions, but we can optionally disable iteration for specific actions based upon additional information in the future.

Definition at line 85 of file nsXFormsActionModuleBase.h.

Definition at line 216 of file nsXFormsMessageElement.cpp.

Definition at line 221 of file nsXFormsMessageElement.cpp.

Definition at line 118 of file nsXFormsDelegateStub.h.

The event currently being processed.

Definition at line 90 of file nsXFormsActionModuleBase.h.

Array of nsIDOMNodes that the control depends on.

Definition at line 195 of file nsXFormsControlStub.h.

Definition at line 215 of file nsXFormsMessageElement.cpp.

Definition at line 219 of file nsXFormsMessageElement.cpp.

The nsIXTFElementWrapper.

Definition at line 185 of file nsXFormsControlStub.h.

Definition at line 214 of file nsXFormsMessageElement.cpp.

This event listener is used to create xforms-hint and xforms-help events.

Definition at line 201 of file nsXFormsControlStub.h.

State that tells whether control has a parent or not.

Definition at line 207 of file nsXFormsControlStub.h.

State that tells whether control has a parent or not.

Definition at line 204 of file nsXFormsControlStub.h.

List of repeats that the node binding depends on.

This happens when using the index() function in the binding expression.

Definition at line 242 of file nsXFormsControlStub.h.

The model for the control.

Definition at line 198 of file nsXFormsControlStub.h.

Indicates whether this control is already on the deferred bind list.

Definition at line 228 of file nsXFormsControlStub.h.

Definition at line 211 of file nsXFormsMessageElement.cpp.

Definition at line 212 of file nsXFormsMessageElement.cpp.

State to prevent infinite loop when generating and handling xforms-next and xforms-previous events.

Definition at line 212 of file nsXFormsControlStub.h.

Definition at line 236 of file nsXFormsControlStub.h.

Definition at line 222 of file nsXFormsMessageElement.cpp.

Definition at line 218 of file nsXFormsMessageElement.cpp.

Definition at line 217 of file nsXFormsMessageElement.cpp.

Definition at line 208 of file nsXFormsMessageElement.cpp.

Does the control use a model bind? That is, does it have a .

Definition at line 217 of file nsXFormsControlStub.h.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_REMOVED = 0x00002000 [inherited]

Definition at line 118 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_SET = 0x00000800 [inherited]

Definition at line 115 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000 [inherited]

Definition at line 120 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_APPENDED = 0x00000080 [inherited]

Definition at line 109 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_INSERTED = 0x00000020 [inherited]

Definition at line 106 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_REMOVED = 0x00000200 [inherited]

Definition at line 112 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DOCUMENT_CHANGED = 0x00000002 [inherited]

Definition at line 100 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DONE_ADDING_CHILDREN = 0x00008000 [inherited]

Definition at line 121 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_HANDLE_DEFAULT = 0x00010000 [inherited]

Definition at line 123 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_PARENT_CHANGED = 0x00000008 [inherited]

Definition at line 103 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_APPEND_CHILD = 0x00000040 [inherited]

Definition at line 108 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001 [inherited]

Definition at line 99 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT = 0x00000004 [inherited]

Definition at line 102 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_INSERT_CHILD = 0x00000010 [inherited]

Definition at line 105 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000 [inherited]

Definition at line 117 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_CHILD = 0x00000100 [inherited]

Definition at line 111 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400 [inherited]

Definition at line 114 of file nsIXTFElement.idl.

Determines whether this control is already on the deferred bind list.

Definition at line 59 of file nsIXFormsControlBase.idl.

const unsigned long nsIChannelEventSink::REDIRECT_INTERNAL = 1 << 2 [inherited]

This is an internal redirect, i.e.

it was not initiated by the remote server, but is specific to the channel implementation.

The new URI may be identical to the old one.

Definition at line 81 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_PERMANENT = 1 << 1 [inherited]

This is a permanent redirect.

New requests for this resource should use the URI of the new channel (This might be an HTTP 301 reponse). If this flag is not set, this is a temporary redirect.

The new URI may be identical to the old one.

Definition at line 73 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_TEMPORARY = 1 << 0 [inherited]

This is a temporary redirect.

New requests for this resource should continue to use the URI of the old channel.

The new URI may be identical to the old one.

Definition at line 64 of file nsIChannelEventSink.idl.

Is true when the control is getting its instance data node binding from a model bind element, ie.

it has a |bind| attribute.

Definition at line 105 of file nsIXFormsControl.idl.

Is true when the control uses single node binding.

Will return false when the control uses node-set binding (i.e. repeat and itemset).

Definition at line 111 of file nsIXFormsControl.idl.

attribute DOMString nsIDelegateInternal::value [inherited]

The value bound to the XForms control.

Definition at line 51 of file nsIDelegateInternal.idl.


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