Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsIForm Class Reference

This interface provides a complete set of methods dealing with elements which belong to a form element. More...

#include <nsIForm.h>

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

List of all members.

Public Member Functions

NS_IMETHOD AddElement (nsIFormControl *aElement)=0
 Add an element to end of this form's list of elements.
NS_IMETHOD AddElementToTable (nsIFormControl *aElement, const nsAString &aName)=0
 Add an element to the lookup table mainted by the form.
NS_IMETHOD GetElementAt (PRInt32 aIndex, nsIFormControl **aElement) const =0
 Get the element at a specified index position in form.elements.
NS_IMETHOD GetElementCount (PRUint32 *aCount) const =0
 Get the number of elements in form.elements.
NS_IMETHOD RemoveElement (nsIFormControl *aElement)=0
 Remove an element from this form's list of elements.
NS_IMETHOD RemoveElementFromTable (nsIFormControl *aElement, const nsAString &aName)=0
 Remove an element from the lookup table mainted by the form.
NS_IMETHOD ResolveName (const nsAString &aName, nsISupports **aResult)=0
 Resolve a name in the scope of the form object, this means find form controls in this form with the correct value in the name attribute.
NS_IMETHOD IndexOfControl (nsIFormControl *aControl, PRInt32 *aIndex)=0
 Get the index of the given control within form.elements.
NS_IMETHOD GetControlEnumerator (nsISimpleEnumerator **aEnum)=0
 Get an enumeration that goes through all controls, including images and that ilk.
NS_IMETHOD OnSubmitClickBegin ()=0
 Flag the form to know that a button or image triggered scripted form submission.
NS_IMETHOD OnSubmitClickEnd ()=0
NS_IMETHOD FlushPendingSubmission ()=0
 Flush a possible pending submission.
NS_IMETHOD ForgetPendingSubmission ()=0
 Forget a possible pending submission.
NS_IMETHOD GetActionURL (nsIURI **aActionURL)=0
 Get the full URL to submit to.

Detailed Description

This interface provides a complete set of methods dealing with elements which belong to a form element.

When nsIDOMHTMLCollection allows write operations

Definition at line 68 of file nsIForm.h.


Member Function Documentation

NS_IMETHOD nsIForm::AddElement ( nsIFormControl aElement) [pure virtual]

Add an element to end of this form's list of elements.

Parameters:
aElementthe element to add
Returns:
NS_OK if the element was successfully added

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::AddElementToTable ( nsIFormControl aElement,
const nsAString &  aName 
) [pure virtual]

Add an element to the lookup table mainted by the form.

We can't fold this method into AddElement() because when AddElement() is called, the form control has no attributes. The name or id attributes of the form control are used as a key into the table.

Implemented in nsHTMLFormElement.

Flush a possible pending submission.

If there was a scripted submission triggered by a button or image, the submission was defered. This method forces the pending submission to be submitted. (happens when the handler returns false or there is an action/target change in the script)

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:

Forget a possible pending submission.

Same as above but this time we get rid of the pending submission cause the handler returned true so we will rebuild the submission with the name/value of the triggering element

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::GetActionURL ( nsIURI **  aActionURL) [pure virtual]

Get the full URL to submit to.

Do not submit if the returned URL is null.

Parameters:
aActionURLthe full, unadulterated URL you'll be submitting to [OUT]

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:

Get an enumeration that goes through all controls, including images and that ilk.

Parameters:
aEnumthe enumeration [OUT]

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:

NS_IMETHOD nsIForm::GetElementAt ( PRInt32  aIndex,
nsIFormControl **  aElement 
) const [pure virtual]

Get the element at a specified index position in form.elements.

Parameters:
aIndexthe index
aElementthe element at that index
Returns:
NS_OK if there was an element at that position, -1 otherwise

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::GetElementCount ( PRUint32 aCount) const [pure virtual]

Get the number of elements in form.elements.

Parameters:
aCountthe number of elements
Returns:
NS_OK if there was an element at that position, -1 otherwise

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::IndexOfControl ( nsIFormControl aControl,
PRInt32 aIndex 
) [pure virtual]

Get the index of the given control within form.elements.

Parameters:
aControlthe control to find the index of
aIndexthe index [OUT]

Implemented in nsHTMLFormElement.

Flag the form to know that a button or image triggered scripted form submission.

In that case the form will defer the submission until the script handler returns and the return value is known.

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:

NS_IMETHOD nsIForm::RemoveElement ( nsIFormControl aElement) [pure virtual]

Remove an element from this form's list of elements.

Parameters:
aElementthe element to remove
Returns:
NS_OK if the element was successfully removed.

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::RemoveElementFromTable ( nsIFormControl aElement,
const nsAString &  aName 
) [pure virtual]

Remove an element from the lookup table mainted by the form.

We can't fold this method into RemoveElement() because when RemoveElement() is called it doesn't know if the element is removed because the id attribute has changed, or bacause the name attribute has changed.

Parameters:
aElementthe element to remove
aNamethe name or id of the element to remove
Returns:
NS_OK if the element was successfully removed.

Implemented in nsHTMLFormElement.

NS_IMETHOD nsIForm::ResolveName ( const nsAString &  aName,
nsISupports **  aResult 
) [pure virtual]

Resolve a name in the scope of the form object, this means find form controls in this form with the correct value in the name attribute.

Parameters:
aElementthe element to remove
aNamethe name or id of the element to remove
Returns:
NS_OK if the element was successfully removed.

Implemented in nsHTMLFormElement.

Here is the caller graph for this function:


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