Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIXFormsControl Interface Reference

Interface implemented by all XForms form control classes. More...

import "nsIXFormsControl.idl";

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

List of all members.

Public Member Functions

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.

Public Attributes

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.

Detailed Description

Interface implemented by all XForms form control classes.

Definition at line 53 of file nsIXFormsControl.idl.


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.

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

Returns:
Did the binding change the context?

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?
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="".

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

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.

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

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


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.

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 interface was generated from the following file: