Back to index

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

#include <nsXFormsActionElement.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMEVENTLISTENER
NS_DECL_NSIXFORMSACTIONELEMENT
NS_DECL_NSIXFORMSACTIONMODULEELEMENT
NS_IMETHOD 
OnCreated (nsIXTFBindableElementWrapper *aWrapper)
 This sets the notification mask and initializes mElement.
NS_IMETHOD OnDestroyed ()
NS_IMETHOD WillChangeDocument (nsIDOMDocument *aNewDocument)
NS_IMETHOD DocumentChanged (nsIDOMDocument *aNewDocument)
NS_IMETHOD WillChangeParent (nsIDOMElement *aNewParent)
NS_IMETHOD ParentChanged (nsIDOMElement *aNewParent)
virtual nsIDOMElementGetElement ()
virtual nsresult HandleSingleAction (nsIDOMEvent *aEvent, nsIXFormsActionElement *aParentAction)
 With the while attribute, actions can potentially be iterated.
NS_IMETHOD HandleDefault (nsIDOMEvent *aEvent, PRBool *aHandled)
NS_IMETHOD WillSetAttribute (nsIAtom *aName, const nsAString &aValue)
NS_IMETHOD AttributeSet (nsIAtom *aName, const nsAString &aValue)
NS_IMETHOD WillRemoveAttribute (nsIAtom *aName)
NS_IMETHOD AttributeRemoved (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 Refresh ()
NS_IMETHOD GetOnDeferredBindList (PRBool *onList)
NS_IMETHOD SetOnDeferredBindList (PRBool putOnList)
NS_IMETHOD TryFocus (PRBool *aOK)
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)
void setRebuild (in nsIModelElementPrivate aModel, in boolean aEnable)
void setRecalculate (in nsIModelElementPrivate aModel, in boolean aEnable)
void setRevalidate (in nsIModelElementPrivate aModel, in boolean aEnable)
void setRefresh (in nsIModelElementPrivate aModel, in boolean aEnable)
void handleAction (in nsIDOMEvent aEvent, in nsIXFormsActionElement aParentAction)
nsIDOMEvent getCurrentEvent ()
 Get the event currently being processed in handleAction.
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.
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

Protected Member Functions

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

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 Attributes

nsCOMPtr< nsIXFormsActionElementmParentAction
nsDataHashtable
< nsISupportsHashKey, PRUint32
mDeferredUpdates

Detailed Description

Definition at line 49 of file nsXFormsActionElement.h.


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.
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 nsXFormsControlStubBase.

Reimplemented in nsXFormsMessageElement, and nsXFormsLabelElement.

Definition at line 417 of file nsXFormsControlStub.h.

void nsIXTFElement::attributeSet ( in nsIAtom  name,
in AString  newValue 
) [inherited]
NS_IMETHOD nsXFormsBindableControlStub::AttributeSet ( nsIAtom aName,
const nsAString &  aValue 
) [inline, inherited]

Reimplemented from nsXFormsControlStubBase.

Reimplemented in nsXFormsMessageElement, and nsXFormsLabelElement.

Definition at line 407 of file nsXFormsControlStub.h.

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]

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 nsXFormsBindableControlStub.

Definition at line 105 of file nsXFormsActionElement.cpp.

{
  mHasDoc = aNewDocument != nsnull;

  nsCOMPtr<nsIDOMNode> parent;
  mElement->GetParentNode(getter_AddRefs(parent));
  UpdateRepeatState(parent);
  return NS_OK;
}

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:

virtual nsIDOMElement* nsXFormsActionElement::GetElement ( ) [inline, virtual]

Implements nsXFormsActionModuleHelper.

Definition at line 67 of file nsXFormsActionElement.h.

{ return mElement; }

Definition at line 123 of file nsXFormsControlStub.cpp.

{
  NS_IF_ADDREF(*aElement = mElement);
  return NS_OK;  
}

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;
}
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:

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.

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 153 of file nsXFormsActionElement.cpp.

{
  if (!mDeferredUpdates.IsInitialized()) {
    NS_ENSURE_TRUE(mDeferredUpdates.Init(), NS_ERROR_OUT_OF_MEMORY);
  } else {
    mDeferredUpdates.Clear();
  }

  mParentAction = aParentAction;
  nsCOMPtr<nsIDOMNodeList> childNodes;
  mElement->GetChildNodes(getter_AddRefs(childNodes));
  if (!childNodes) {
    return NS_OK;
  }

  PRUint32 count;
  childNodes->GetLength(&count);
  nsCOMPtr<nsIXFormsActionModuleElement> actionChild;
  nsCOMPtr<nsIDOMEvent> event(aEvent);
  for (PRUint32 i = 0; i < count; ++i) {
    nsCOMPtr<nsIDOMNode> child;
    childNodes->Item(i, getter_AddRefs(child));
    actionChild = do_QueryInterface(child);
    if (actionChild) {
      actionChild->HandleAction(event, this);
    }
  }
  if (!aParentAction) { //Otherwise parent will handle deferred updates
    mDeferredUpdates.EnumerateRead(DoDeferredActions, nsnull);
  }
  return NS_OK;
}

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:

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:

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

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:

This sets the notification mask and initializes mElement.

Reimplemented from nsXFormsBindableControlStub.

Definition at line 62 of file nsXFormsActionElement.cpp.

Here is the call graph for this function:

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).

Reimplemented from nsXFormsBindableControlStub.

Definition at line 76 of file nsXFormsActionElement.cpp.

Reimplemented from nsXFormsBindableControlStub.

Definition at line 90 of file nsXFormsActionElement.cpp.

{
  mHasParent = aNewParent != nsnull;
  UpdateRepeatState(aNewParent);
  return NS_OK;
}

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 in nsXFormsRepeatElement, nsXFormsItemElement, nsXFormsOutputElement, nsXFormsItemSetElement, nsXFormsDelegateStub, nsXFormsLabelElement, nsXFormsSelect1Element, and nsXFormsSelectElement.

Definition at line 242 of file nsXFormsControlStub.cpp.

{
  // XXX: In theory refresh should never be called when there is no model,
  // but that's definately not the case now.
  return (mModel && !mAppearDisabled) ? mModel->SetStates(this, mBoundNode)
                                      : NS_OK;
}

Here is the caller 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:

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:

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

Definition at line 66 of file nsXFormsActionModuleBase.h.

{ mCurrentEvent = aEvent; }

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:

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

Reimplemented in nsXFormsRepeatElement, nsXFormsGroupElement, and nsXFormsDelegateStub.

Definition at line 251 of file nsXFormsControlStub.cpp.

{
  *aOK = PR_FALSE;
  return NS_OK;
}

Here is the caller 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:

Reimplemented from nsXFormsBindableControlStub.

Definition at line 98 of file nsXFormsActionElement.cpp.

Here is the call graph for this function:

Reimplemented from nsXFormsBindableControlStub.

Definition at line 83 of file nsXFormsActionElement.cpp.

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.

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.

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.

The event currently being processed.

Definition at line 90 of file nsXFormsActionModuleBase.h.

Definition at line 72 of file nsXFormsActionElement.h.

Array of nsIDOMNodes that the control depends on.

Definition at line 195 of file nsXFormsControlStub.h.

The nsIXTFElementWrapper.

Definition at line 185 of file nsXFormsControlStub.h.

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 71 of file nsXFormsActionElement.h.

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.

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.

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.


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