Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes
nsIContent Class Reference

A node of content in a document's content model. More...

#include <nsIContent.h>

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

List of all members.

Public Types

enum  {
  eTEXT = 0x00000001, eELEMENT = 0x00000002, eHTML = 0x00000004, eHTML_FORM_CONTROL = 0x00000008,
  eXUL = 0x00000010, ePROCESSING_INSTRUCTION = 0x00000020, eSVG = 0x00000040, eCOMMENT = 0x00000080
}
 Bit-flags to pass (or'ed together) to IsContentOfType() More...
enum  ETabFocusType { eTabFocus_formElementsMask = (1<<1), eTabFocus_linksMask = (1<<2), eTabFocus_any = 1 + (1<<1) + (1<<2) }

Public Member Functions

 nsIContent ()
virtual nsIDocumentGetDocument () const =0
 DEPRECATED - Use GetCurrentDoc or GetOwnerDoc.
virtual nsresult BindToTree (nsIDocument *aDocument, nsIContent *aParent, nsIContent *aBindingParent, PRBool aCompileEventHandlers)=0
 Bind this content node to a tree.
virtual void UnbindFromTree (PRBool aDeep=PR_TRUE, PRBool aNullParent=PR_TRUE)=0
 Unbind this content node from a tree.
virtual PRBool IsInDoc () const =0
 Returns true if the content has an ancestor that is a document.
nsIDocumentGetCurrentDoc () const
 Get the document that this content is currently in, if any.
virtual nsIDocumentGetOwnerDoc () const =0
 Get the ownerDocument for this content.
nsIContentGetParent () const
 Get the parent content for this content.
virtual PRBool IsNativeAnonymous () const =0
 Get whether this content is C++-generated anonymous content.
virtual void SetNativeAnonymous (PRBool aAnonymous)=0
 Set whether this content is anonymous.
virtual PRInt32 GetNameSpaceID () const =0
 Get the namespace that this element's tag is defined in.
virtual nsIAtomTag () const =0
 Get the tag for this element.
virtual nsINodeInfoGetNodeInfo () const =0
 Get the NodeInfo for this element.
virtual PRUint32 GetChildCount () const =0
 Get the number of children.
virtual nsIContentGetChildAt (PRUint32 aIndex) const =0
 Get a child by index.
virtual PRInt32 IndexOf (nsIContent *aPossibleChild) const =0
 Get the index of a child within this content.
virtual nsresult InsertChildAt (nsIContent *aKid, PRUint32 aIndex, PRBool aNotify)=0
 Insert a content node at a particular index.
virtual nsresult AppendChildTo (nsIContent *aKid, PRBool aNotify)=0
 Append a content node to the end of the child list.
virtual nsresult RemoveChildAt (PRUint32 aIndex, PRBool aNotify)=0
 Remove a child from this content node.
virtual nsIAtomGetIDAttributeName () const =0
 Returns an atom holding the name of the attribute of type ID on this content node (if applicable).
virtual already_AddRefed
< nsINodeInfo
GetExistingAttrNameFromQName (const nsAString &aStr) const =0
 Normalizes an attribute name and returns it as a nodeinfo if an attribute with that name exists.
nsresult SetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, const nsAString &aValue, PRBool aNotify)
 Set attribute values.
virtual nsresult SetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, nsIAtom *aPrefix, const nsAString &aValue, PRBool aNotify)=0
 Set attribute values.
virtual nsresult GetAttr (PRInt32 aNameSpaceID, nsIAtom *aName, nsAString &aResult) const =0
 Get the current value of the attribute.
virtual PRBool HasAttr (PRInt32 aNameSpaceID, nsIAtom *aName) const =0
 Determine if an attribute has been set (empty string or otherwise).
virtual nsresult UnsetAttr (PRInt32 aNameSpaceID, nsIAtom *aAttr, PRBool aNotify)=0
 Remove an attribute so that it is no longer explicitly specified.
virtual nsresult GetAttrNameAt (PRUint32 aIndex, PRInt32 *aNameSpaceID, nsIAtom **aName, nsIAtom **aPrefix) const =0
 Get the namespace / name / prefix of a given attribute.
virtual PRUint32 GetAttrCount () const =0
 Get the number of all specified attributes.
virtual nsresult RangeAdd (nsIDOMRange *aRange)=0
 Inform content of range ownership changes.
virtual void RangeRemove (nsIDOMRange *aRange)=0
 Inform content that it no longer owns either range endpoint.
virtual const nsVoidArrayGetRangeList () const =0
 Get the list of ranges that have either endpoint in this content item.
virtual nsresult HandleDOMEvent (nsPresContext *aPresContext, nsEvent *aEvent, nsIDOMEvent **aDOMEvent, PRUint32 aFlags, nsEventStatus *aEventStatus)=0
 Handle a DOM event for this piece of content.
virtual PRUint32 ContentID () const =0
 Get a unique ID for this piece of content.
virtual void SetContentID (PRUint32 aID)
 Set the unique content ID for this content.
virtual void SetFocus (nsPresContext *aPresContext)
 Set the focus on this content.
virtual void RemoveFocus (nsPresContext *aPresContext)
 Remove the focus on this content.
virtual PRBool IsFocusable (PRInt32 *aTabIndex=nsnull)
 Check if this content is focusable and in the current tab order.
virtual nsIContentGetBindingParent () const =0
 Gets content node with the binding responsible for our construction (and existence).
virtual PRBool IsContentOfType (PRUint32 aFlags) const =0
 API for doing a quick check if a content object is of a given type, such as HTML, XUL, Text, ...
virtual nsresult GetListenerManager (nsIEventListenerManager **aResult)=0
 Get the event listener manager, the guy you talk to to register for events on this element.
virtual already_AddRefed< nsIURIGetBaseURI () const =0
 Get the base URI for any relative URIs within this piece of content.
virtual void DoneCreatingElement ()
 This method is called when the parser finishes creating the element.
virtual void SetMayHaveFrame (PRBool aMayHaveFrame)
 Call to let the content node know that it may now have a frame.
virtual PRBool MayHaveFrame () const
 Returns PR_TRUE if there is a chance that the content node has a frame, PR_FALSE otherwise.
virtual void BeginAddingChildren ()
 This method is called when the parser begins creating the element's children, if any are present.
virtual void DoneAddingChildren ()
 This method is called when the parser finishes creating the element's children, if any are present.
virtual PRBool IsDoneAddingChildren ()
 For HTML textarea, select, applet, and object elements, returns PR_TRUE if all children have been added OR if the element was not created by the parser.
virtual PRInt32 IntrinsicState () const
 Method to get the intrinsic content state of this content node.
virtual voidGetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull) const
virtual nsresult SetProperty (nsIAtom *aPropertyName, void *aValue, NSPropertyDtorFunc aDtor=nsnull)
virtual nsresult DeleteProperty (nsIAtom *aPropertyName)
virtual voidUnsetProperty (nsIAtom *aPropertyName, nsresult *aStatus=nsnull)
virtual nsIDOMGCParticipantGetSCCIndex ()=0
 Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.
virtual void AppendReachableList (nsCOMArray< nsIDOMGCParticipant > &aArray)=0
 Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.

Static Public Attributes

static PRInt32 sTabFocusModel = eTabFocus_any
static PRBool sTabFocusModelAppliesToXUL = PR_FALSE

Protected Types

enum  { kParentBitMask = 0x3 }
typedef PRWord PtrBits

Protected Attributes

PtrBits mParentPtrBits

Detailed Description

A node of content in a document's content model.

This interface is supported by all content objects.

Definition at line 72 of file nsIContent.h.


Member Typedef Documentation

typedef PRWord nsIContent::PtrBits [protected]

Reimplemented in nsGenericDOMDataNode.

Definition at line 726 of file nsIContent.h.


Member Enumeration Documentation

anonymous enum

Bit-flags to pass (or'ed together) to IsContentOfType()

Enumerator:
eTEXT 

text elements

eELEMENT 

dom elements

eHTML 

html elements

eHTML_FORM_CONTROL 

form controls

eXUL 

XUL elements.

ePROCESSING_INSTRUCTION 

xml processing instructions

eSVG 

svg elements

eCOMMENT 

comment nodes

Definition at line 524 of file nsIContent.h.

       {
    eTEXT                = 0x00000001,
    eELEMENT             = 0x00000002,
    eHTML                = 0x00000004,
    eHTML_FORM_CONTROL   = 0x00000008,
    eXUL                 = 0x00000010,
    ePROCESSING_INSTRUCTION = 0x00000020,
    eSVG                 = 0x00000040,
    eCOMMENT             = 0x00000080
  };
anonymous enum [protected]
Enumerator:
kParentBitMask 

Definition at line 729 of file nsIContent.h.

{ kParentBitMask = 0x3 };
Enumerator:
eTabFocus_formElementsMask 
eTabFocus_linksMask 
eTabFocus_any 

Definition at line 711 of file nsIContent.h.

                     {
  //eTabFocus_textControlsMask = (1<<0),  // unused - textboxes always tabbable
    eTabFocus_formElementsMask = (1<<1),  // non-text form elements
    eTabFocus_linksMask = (1<<2),         // links
    eTabFocus_any = 1 + (1<<1) + (1<<2)   // everything that can be focused
  };

Constructor & Destructor Documentation

nsIContent::nsIContent ( ) [inline]

Definition at line 76 of file nsIContent.h.

    : mParentPtrBits(0) { }

Member Function Documentation

virtual nsresult nsIContent::AppendChildTo ( nsIContent aKid,
PRBool  aNotify 
) [pure virtual]

Append a content node to the end of the child list.

Parameters:
aKidthe content to append
aNotifywhether to notify the document and appropriate mutation event listeners that the replace has occurred

Implemented in nsXULElement, nsGenericElement, nsHTMLScriptElement, nsHTMLSelectElement, nsGenericDOMDataNode, nsHTMLTextAreaElement, nsSVGScriptElement, nsXTFElementWrapper, nsHTMLOptGroupElement, nsHTMLStyleElement, and nsSVGStyleElement.

Here is the caller graph for this function:

virtual void nsIDOMGCParticipant::AppendReachableList ( nsCOMArray< nsIDOMGCParticipant > &  aArray) [pure virtual, inherited]

Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.

The caller is responsible for taking the transitive closure of |AppendReachableList|.

This will only be called on objects that are returned by GetSCCIndex.

null pointers may be appended; they will be ignored by the caller.

Implemented in nsDocument, nsGenericElement, nsGlobalWindow, nsGenericDOMDataNode, nsXMLHttpRequest, nsWindowRoot, nsDOMAttribute, and nsTreeWalker.

Here is the caller graph for this function:

virtual void nsIContent::BeginAddingChildren ( ) [inline, virtual]

This method is called when the parser begins creating the element's children, if any are present.

This is only called for XTF elements currently.

Reimplemented in nsXTFElementWrapper.

Definition at line 626 of file nsIContent.h.

  {
  }
virtual nsresult nsIContent::BindToTree ( nsIDocument aDocument,
nsIContent aParent,
nsIContent aBindingParent,
PRBool  aCompileEventHandlers 
) [pure virtual]

Bind this content node to a tree.

If this method throws, the caller must call UnbindFromTree() on the node. In the typical case of a node being appended to a parent, this will be called after the node has been added to the parent's child list and before nsIDocumentObserver notifications for the addition are dispatched.

Parameters:
aDocumentThe new document for the content node. Must match the current document of aParent, if aParent is not null. May not be null if aParent is null.
aParentThe new parent for the content node. May be null if the node is being bound as a direct child of the document.
aBindingParentThe new binding parent for the content node. This is allowed to be null. In that case, the binding parent of aParent, if any, will be used.
aCompileEventHandlerswhether to initialize the event handlers in the document (used by nsXULElement)
Note:
either aDocument or aParent must be non-null. If both are null, this method will crash.
This method must not be called by consumers of nsIContent on a node that is already bound to a tree. Call UnbindFromTree first.
This method will handle rebinding descendants appropriately (eg changing their binding parent as needed).
This method does not add the content node to aParent's child list
Exceptions:
NS_ERROR_OUT_OF_MEMORYif that happens

Implemented in nsGenericHTMLFrameElement, nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsHTMLScriptElement, nsHTMLInputElement, nsGenericHTMLElement, nsGenericDOMDataNode, nsHTMLFormElement, nsHTMLImageElement, nsAttributeTextNode, nsHTMLAnchorElement, nsSVGScriptElement, nsHTMLAreaElement, nsHTMLLinkElement, nsHTMLLabelElement, nsHTMLLegendElement, nsHTMLStyleElement, nsXTFElementWrapper, nsSVGElement, nsSVGStyleElement, nsHTMLMapElement, and nsXMLStylesheetPI.

Here is the caller graph for this function:

virtual PRUint32 nsIContent::ContentID ( ) const [pure virtual]

Get a unique ID for this piece of content.

This ID is used as a key to store state information about this content object and its associated frame object. The state information is stored in a dictionary that is manipulated by the frame manager (nsIFrameManager) inside layout. An opaque pointer to this dictionary is passed to the session history as a handle associated with the current document's state

These methods are DEPRECATED, DON'T USE THEM!!!

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual nsresult nsIContent::DeleteProperty ( nsIAtom aPropertyName) [inline, virtual]

Reimplemented in nsGenericElement.

Definition at line 686 of file nsIContent.h.

virtual void nsIContent::DoneAddingChildren ( ) [inline, virtual]

This method is called when the parser finishes creating the element's children, if any are present.

NOTE: this is currently only called for textarea, select, applet, and object elements in the HTML content sink. If you want to call it on your element, modify the content sink of your choice to do so. This is an efficiency measure.

If you also need to determine whether the parser is the one creating your element (through createElement() or cloneNode() generally) then add a boolean aFromParser to the NS_NewXXX() constructor for your element and have the parser pass true. See nsHTMLInputElement.cpp and nsHTMLContentSink::MakeContentObject().

Reimplemented in nsHTMLSelectElement, nsHTMLTextAreaElement, nsXTFElementWrapper, nsHTMLObjectElement, and nsHTMLAppletElement.

Definition at line 645 of file nsIContent.h.

  {
  }

Here is the caller graph for this function:

virtual void nsIContent::DoneCreatingElement ( ) [inline, virtual]

This method is called when the parser finishes creating the element.

This particularly means that it has done everything you would expect it to have done after it encounters the > at the end of the tag (for HTML or XML). This includes setting the attributes, setting the document / form, and placing the element into the tree at its proper place.

For container elements, this is called before any of the children are created or added into the tree.

NOTE: this is currently only called for input and button, in the HTML content sink. If you want to call it on your element, modify the content sink of your choice to do so. This is an efficiency measure.

If you also need to determine whether the parser is the one creating your element (through createElement() or cloneNode() generally) then add a boolean aFromParser to the NS_NewXXX() constructor for your element and have the parser pass true. See nsHTMLInputElement.cpp and nsHTMLContentSink::MakeContentObject().

DO NOT USE THIS METHOD to get around the fact that it's hard to deal with attributes dynamically. If you make attributes affect your element from this method, it will only happen on initialization and JavaScript will not be able to create elements (which requires them to first create the element and then call setAttribute() directly, at which point DoneCreatingElement() has already been called and is out of the picture).

Reimplemented in nsHTMLInputElement.

Definition at line 598 of file nsIContent.h.

  {
  }
virtual nsresult nsIContent::GetAttr ( PRInt32  aNameSpaceID,
nsIAtom aName,
nsAString &  aResult 
) const [pure virtual]

Get the current value of the attribute.

This returns a form that is suitable for passing back into SetAttr.

Parameters:
aNameSpaceIDthe namespace of the attr
aNamethe name of the attr
aResultthe value (may legitimately be the empty string) [OUT]
Exceptions:
NS_CONTENT_ATTR_NOT_THEREif the attribute is not set and has no default value
NS_CONTENT_ATTR_NO_VALUEif the attribute exists but has no value
NS_CONTENT_ATTR_HAS_VALUEif the attribute exists and has a non-empty value (==NS_OK)

Implemented in nsXULElement, nsGenericElement, nsGenericDOMDataNode, nsGenericHTMLElement, nsDocumentFragment, and nsXTFElementWrapper.

virtual PRUint32 nsIContent::GetAttrCount ( ) const [pure virtual]

Get the number of all specified attributes.

Returns:
the number of attributes

Implemented in nsXULElement, nsGenericElement, nsGenericDOMDataNode, and nsXTFElementWrapper.

Here is the caller graph for this function:

virtual nsresult nsIContent::GetAttrNameAt ( PRUint32  aIndex,
PRInt32 aNameSpaceID,
nsIAtom **  aName,
nsIAtom **  aPrefix 
) const [pure virtual]

Get the namespace / name / prefix of a given attribute.

Parameters:
aIndexthe index of the attribute name
aNameSpacethe name space ID of the attribute name [OUT]
aNamethe attribute name [OUT]
aPrefixthe attribute prefix [OUT]

Implemented in nsXULElement, nsGenericElement, nsGenericDOMDataNode, nsDocumentFragment, and nsXTFElementWrapper.

Here is the caller graph for this function:

virtual already_AddRefed<nsIURI> nsIContent::GetBaseURI ( ) const [pure virtual]

Get the base URI for any relative URIs within this piece of content.

Generally, this is the document's base URI, but certain content carries a local base for backward compatibility, and XML supports setting a per-node base URI.

Returns:
the base URI

Implemented in nsGenericElement, nsGenericHTMLElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual nsIContent* nsIContent::GetBindingParent ( ) const [pure virtual]

Gets content node with the binding responsible for our construction (and existence).

Used by anonymous content (XBL-generated). null for all explicit content.

Returns:
the binding parent

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual nsIContent* nsIContent::GetChildAt ( PRUint32  aIndex) const [pure virtual]

Get a child by index.

Parameters:
aIndexthe index of the child to get, or null if index out of bounds
Returns:
the child

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

virtual PRUint32 nsIContent::GetChildCount ( ) const [pure virtual]

Get the number of children.

Returns:
the number of children

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Get the document that this content is currently in, if any.

This will be null if the content has no ancestor that is a document.

Returns:
the current document

Reimplemented in nsGenericDOMDataNode.

Definition at line 145 of file nsIContent.h.

  {
    // XXX This should become:
    // return IsInDoc() ? GetOwnerDoc() : nsnull;
    return GetDocument();
  }

Here is the call graph for this function:

virtual nsIDocument* nsIContent::GetDocument ( ) const [pure virtual]

DEPRECATED - Use GetCurrentDoc or GetOwnerDoc.

Get the document for this content.

Returns:
the document

Implemented in nsGenericElement, and nsGenericDOMDataNode.

virtual already_AddRefed<nsINodeInfo> nsIContent::GetExistingAttrNameFromQName ( const nsAString &  aStr) const [pure virtual]

Normalizes an attribute name and returns it as a nodeinfo if an attribute with that name exists.

This method is intended for character case conversion if the content object is case insensitive (e.g. HTML). Returns the nodeinfo of the attribute with the specified name if one exists or null otherwise.

Parameters:
aStrthe unparsed attribute string
Returns:
the node info. May be nsnull.

Implemented in nsGenericElement, nsGenericDOMDataNode, and nsXTFElementWrapper.

Here is the caller graph for this function:

virtual nsIAtom* nsIContent::GetIDAttributeName ( ) const [pure virtual]

Returns an atom holding the name of the attribute of type ID on this content node (if applicable).

Returns null for non-element content nodes.

Implemented in nsXULElement, nsGenericElement, nsGenericHTMLElement, nsGenericDOMDataNode, nsXTFElementWrapper, nsSVGElement, and nsXMLEventsElement.

Here is the caller graph for this function:

virtual nsresult nsIContent::GetListenerManager ( nsIEventListenerManager **  aResult) [pure virtual]

Get the event listener manager, the guy you talk to to register for events on this element.

Parameters:
aResultthe event listener manager [OUT]

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual PRInt32 nsIContent::GetNameSpaceID ( ) const [pure virtual]

Get the namespace that this element's tag is defined in.

Returns:
the namespace

Implemented in nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual nsINodeInfo* nsIContent::GetNodeInfo ( ) const [pure virtual]

Get the NodeInfo for this element.

Returns:
the nodes node info

Implemented in nsGenericElement, and nsGenericDOMDataNode.

virtual nsIDocument* nsIContent::GetOwnerDoc ( ) const [pure virtual]

Get the ownerDocument for this content.

Returns:
the ownerDocument

Implemented in nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

nsIContent* nsIContent::GetParent ( ) const [inline]

Get the parent content for this content.

Returns:
the parent, or null if no parent

Definition at line 163 of file nsIContent.h.

virtual void* nsIContent::GetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) const [inline, virtual]

Reimplemented in nsGenericElement.

Definition at line 677 of file nsIContent.h.

  { if (aStatus) *aStatus = NS_ERROR_NOT_IMPLEMENTED; return nsnull; }
virtual const nsVoidArray* nsIContent::GetRangeList ( ) const [pure virtual]

Get the list of ranges that have either endpoint in this content item.

Returns:
the list of ranges owned partially by this content. The nsVoidArray is owned by the content object and its lifetime is controlled completely by the content object.

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual nsIDOMGCParticipant* nsIDOMGCParticipant::GetSCCIndex ( ) [pure virtual, inherited]

Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.

For example, DOM trees are strongly connected, so can return the root node to greatly reduce the number of nodes on which we need to run graph algorithms.

Note that it's acceptable for nodes in a single strongly connected component to return different values for GetSCCIndex, as long as those two values claim that they're reachable from each other in AppendReachableList.

Implemented in nsDocument, nsGenericElement, nsGlobalWindow, nsGenericDOMDataNode, nsXMLHttpRequest, nsWindowRoot, nsDOMAttribute, and nsTreeWalker.

Here is the caller graph for this function:

virtual nsresult nsIContent::HandleDOMEvent ( nsPresContext aPresContext,
nsEvent aEvent,
nsIDOMEvent **  aDOMEvent,
PRUint32  aFlags,
nsEventStatus aEventStatus 
) [pure virtual]

Handle a DOM event for this piece of content.

This method is responsible for handling and controlling all three stages of events, capture, local and bubble. It also does strange things to anonymous content which whiz right by this author's head.

Here are some beginning explanations:

  • if in INIT or CAPTURE mode, it must pass the event to its parent in CAPTURE mode (this happens before the event is fired, therefore the firing of events will occur from the root up to the target).
  • The event is fired to listeners.
  • If in INIT or BUBBLE mode, it passes the event to its parent in BUBBLE mode. This means that the events will be fired up the chain starting from the target to the ancestor.

NOTE: if you are extending nsGenericElement and have to do a default action, call super::HandleDOMEvent() first and check for aEventStatus != nsEventStatus_eIgnore and make sure you are not in CAPTURE mode before proceeding.

XXX Go comment that method, Will Robinson.

Parameters:
aPresContextthe current presentation context
aEventthe event that is being propagated
aDOMEventa special event that may contain a modified target. Pass in null here or aDOMEvent if you are in HandleDOMEvent already; don't worry your pretty little head about it.
aFlagsflags that describe what mode we are in. Generally NS_EVENT_FLAG_CAPTURE, NS_EVENT_FLAG_BUBBLE and NS_EVENT_FLAG_INIT are the ones that matter.
aEventStatusthe status returned from the function. Generally nsEventStatus_eIgnore

Implemented in nsXULElement, nsGenericElement, nsHTMLSelectElement, nsGenericDOMDataNode, nsHTMLInputElement, nsHTMLFormElement, nsDocumentFragment, nsHTMLTextAreaElement, nsHTMLImageElement, nsXTFElementWrapper, nsHTMLAnchorElement, nsHTMLLinkElement, nsHTMLButtonElement, nsHTMLLabelElement, nsHTMLAreaElement, nsHTMLOptGroupElement, and nsXMLElement.

Here is the caller graph for this function:

virtual PRBool nsIContent::HasAttr ( PRInt32  aNameSpaceID,
nsIAtom aName 
) const [pure virtual]

Determine if an attribute has been set (empty string or otherwise).

Parameters:
aNameSpaceIdthe namespace id of the attribute
aAttrthe attribute name
Returns:
whether an attribute exists

Implemented in nsXULElement, nsGenericElement, nsGenericDOMDataNode, and nsXTFElementWrapper.

Here is the caller graph for this function:

virtual PRInt32 nsIContent::IndexOf ( nsIContent aPossibleChild) const [pure virtual]

Get the index of a child within this content.

Parameters:
aPossibleChildthe child to get the index
Returns:
the index of the child, or -1 if not a child

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

virtual nsresult nsIContent::InsertChildAt ( nsIContent aKid,
PRUint32  aIndex,
PRBool  aNotify 
) [pure virtual]

Insert a content node at a particular index.

Parameters:
aKidthe content to insert
aIndexthe index it is being inserted at (the index it will have after it is inserted)
aNotifywhether to notify the document and appropriate mutation event listeners that the insert has occurred

Implemented in nsXULElement, nsGenericElement, nsHTMLScriptElement, nsHTMLSelectElement, nsGenericDOMDataNode, nsHTMLTextAreaElement, nsSVGScriptElement, nsXTFElementWrapper, nsHTMLOptGroupElement, nsHTMLStyleElement, and nsSVGStyleElement.

Here is the caller graph for this function:

virtual PRInt32 nsIContent::IntrinsicState ( ) const [inline, virtual]

Method to get the intrinsic content state of this content node.

This is the state that is independent of the node's presentation. To get the full content state, use nsIEventStateManager. Also see nsIEventStateManager for the possible bits that could be set here.

Reimplemented in nsGenericHTMLFormElement, nsHTMLInputElement, nsHTMLOptionElement, nsXTFElementWrapper, and nsHTMLOptGroupElement.

Definition at line 667 of file nsIContent.h.

  {
    return 0;
  }

Here is the caller graph for this function:

virtual PRBool nsIContent::IsContentOfType ( PRUint32  aFlags) const [pure virtual]

API for doing a quick check if a content object is of a given type, such as HTML, XUL, Text, ...

Use this when you can instead of checking the tag.

Parameters:
aFlagswhat types you want to test for (see above, eTEXT, eELEMENT, eHTML, eHTML_FORM_CONTROL, eXUL)
Returns:
whether the content matches ALL flags passed in

Implemented in nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsGenericDOMDataNode, nsGenericHTMLElement, nsSVGElement, nsTextNode, nsXMLCDATASection, nsXMLProcessingInstruction, and nsCommentNode.

virtual PRBool nsIContent::IsDoneAddingChildren ( ) [inline, virtual]

For HTML textarea, select, applet, and object elements, returns PR_TRUE if all children have been added OR if the element was not created by the parser.

Returns PR_TRUE for all other elements.

Reimplemented in nsHTMLSelectElement, nsHTMLTextAreaElement, nsHTMLObjectElement, and nsHTMLAppletElement.

Definition at line 654 of file nsIContent.h.

  {
    return PR_TRUE;
  }

Here is the caller graph for this function:

virtual PRBool nsIContent::IsFocusable ( PRInt32 aTabIndex = nsnull) [inline, virtual]

Check if this content is focusable and in the current tab order.

Note: most callers should use nsIFrame::IsFocusable() instead as it checks visibility and other layout factors as well. Tabbable is indicated by a nonnegative tabindex & is a subset of focusable. For example, only the selected radio button in a group is in the tab order, unless the radio group has no selection in which case all of the visible, non-disabled radio buttons in the group are in the tab order. On the other hand, all of the visible, non-disabled radio buttons are always focusable via clicking or script. Also, depending on either the accessibility.tabfocus pref or a system setting (nowadays: Full keyboard access, mac only) some widgets may be focusable but removed from the tab order.

Parameters:
[inout,optional]aTabIndex the computed tab index In: default tabindex for element (-1 nonfocusable, == 0 focusable) Out: computed tabindex
[optional]aTabIndex the computed tab index < 0 if not tabbable == 0 if in normal tab order > 0 can be tabbed to in the order specified by this value
Returns:
whether the content is focusable via mouse, kbd or script.

Reimplemented in nsGenericHTMLFrameElement, nsXULElement, nsHTMLSelectElement, nsGenericHTMLElement, nsHTMLInputElement, nsHTMLSharedElement, nsHTMLImageElement, nsHTMLButtonElement, nsHTMLAppletElement, nsXMLElement, nsHTMLObjectElement, and nsHTMLObjectElement.

Definition at line 505 of file nsIContent.h.

  {
    if (aTabIndex) 
      *aTabIndex = -1; // Default, not tabbable
    return PR_FALSE;
  }

Here is the caller graph for this function:

virtual PRBool nsIContent::IsInDoc ( ) const [pure virtual]

Returns true if the content has an ancestor that is a document.

Returns:
whether this content is in a document tree

Implemented in nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual PRBool nsIContent::IsNativeAnonymous ( ) const [pure virtual]

Get whether this content is C++-generated anonymous content.

See also:
nsIAnonymousContentCreator
Returns:
whether this content is anonymous

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

Here is the caller graph for this function:

virtual PRBool nsIContent::MayHaveFrame ( ) const [inline, virtual]

Returns PR_TRUE if there is a chance that the content node has a frame, PR_FALSE otherwise.

Reimplemented in nsGenericElement, nsGenericDOMDataNode, nsXMLProcessingInstruction, and nsCommentNode.

Definition at line 615 of file nsIContent.h.

  {
    return PR_TRUE;
  }

Here is the caller graph for this function:

virtual nsresult nsIContent::RangeAdd ( nsIDOMRange aRange) [pure virtual]

Inform content of range ownership changes.

This allows content to do the right thing to ranges in the face of changes to the content model. RangeRemove -- informs content that it no longer owns a range endpoint GetRangeList -- returns the list of ranges that have one or both endpoints within this content item Inform content that it owns one or both range endpoints

Parameters:
aRangethe range the content owns

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

virtual void nsIContent::RangeRemove ( nsIDOMRange aRange) [pure virtual]

Inform content that it no longer owns either range endpoint.

Parameters:
aRangethe range the content no longer owns

Implemented in nsXULElement, nsGenericElement, and nsGenericDOMDataNode.

virtual nsresult nsIContent::RemoveChildAt ( PRUint32  aIndex,
PRBool  aNotify 
) [pure virtual]

Remove a child from this content node.

Parameters:
aIndexthe index of the child to remove
aNotifywhether to notify the document and appropriate mutation event listeners that the replace has occurred

Implemented in nsXULElement, nsGenericElement, nsHTMLSelectElement, nsGenericDOMDataNode, nsHTMLTextAreaElement, nsXTFElementWrapper, nsHTMLOptGroupElement, nsHTMLStyleElement, and nsSVGStyleElement.

Here is the caller graph for this function:

virtual void nsIContent::RemoveFocus ( nsPresContext aPresContext) [inline, virtual]

Remove the focus on this content.

This is generally something for the event state manager to do, not ordinary people. Ordinary people should do something like nsGenericHTMLElement::SetElementFocus(). This method is the end result, the point where the content finds out it has been focused.

All content elements are potentially focusable.

Parameters:
aPresContextthe pres context
See also:
nsGenericHTMLElement::SetElementFocus()

Reimplemented in nsXULElement, and nsGenericHTMLElement.

Definition at line 479 of file nsIContent.h.

  {
  }
nsresult nsIContent::SetAttr ( PRInt32  aNameSpaceID,
nsIAtom aName,
const nsAString &  aValue,
PRBool  aNotify 
) [inline]

Set attribute values.

All attribute values are assumed to have a canonical string representation that can be used for these methods. The SetAttr method is assumed to perform a translation of the canonical form into the underlying content specific form.

Parameters:
aNameSpaceIDthe namespace of the attribute
aNamethe name of the attribute
aValuethe value to set
aNotifyspecifies how whether or not the document and appropriate mutation event listeners should be notified of the attribute change.

Reimplemented in nsGenericHTMLFrameElement, nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsHTMLScriptElement, nsHTMLInputElement, nsGenericDOMDataNode, nsGenericHTMLElement, nsHTMLFormElement, nsHTMLImageElement, nsDocumentFragment, nsHTMLOptionElement, nsHTMLAnchorElement, nsHTMLCanvasElement, nsHTMLLinkElement, nsHTMLAreaElement, nsHTMLLabelElement, nsHTMLLegendElement, nsHTMLOptGroupElement, nsHTMLStyleElement, nsSVGElement, nsSVGStyleElement, nsXMLElement, and nsHTMLFrameSetElement.

Definition at line 284 of file nsIContent.h.

  {
    return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
  }
virtual nsresult nsIContent::SetAttr ( PRInt32  aNameSpaceID,
nsIAtom aName,
nsIAtom aPrefix,
const nsAString &  aValue,
PRBool  aNotify 
) [pure virtual]

Set attribute values.

All attribute values are assumed to have a canonical String representation that can be used for these methods. The SetAttr method is assumed to perform a translation of the canonical form into the underlying content specific form.

Parameters:
aNameSpaceIDthe namespace of the attribute
aNamethe name of the attribute
aPrefixthe prefix of the attribute
aValuethe value to set
aNotifyspecifies how whether or not the document and appropriate mutation event listeners should be notified of the attribute change.

Implemented in nsGenericHTMLFrameElement, nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsHTMLScriptElement, nsHTMLInputElement, nsGenericDOMDataNode, nsGenericHTMLElement, nsHTMLFormElement, nsHTMLImageElement, nsDocumentFragment, nsHTMLOptionElement, nsHTMLAnchorElement, nsHTMLCanvasElement, nsHTMLLinkElement, nsHTMLAreaElement, nsHTMLLabelElement, nsHTMLLegendElement, nsHTMLOptGroupElement, nsHTMLStyleElement, nsXTFElementWrapper, nsSVGElement, nsSVGStyleElement, nsXMLElement, nsHTMLFrameSetElement, and nsXMLEventsElement.

virtual void nsIContent::SetContentID ( PRUint32  aID) [inline, virtual]

Set the unique content ID for this content.

Parameters:
aIDthe ID to set

Reimplemented in nsXULElement, and nsGenericElement.

Definition at line 449 of file nsIContent.h.

  {
  }
virtual void nsIContent::SetFocus ( nsPresContext aPresContext) [inline, virtual]

Set the focus on this content.

This is generally something for the event state manager to do, not ordinary people. Ordinary people should do something like nsGenericHTMLElement::SetElementFocus(). This method is the end result, the point where the content finds out it has been focused.

All content elements are potentially focusable.

Parameters:
aPresContextthe pres context
See also:
nsGenericHTMLElement::SetElementFocus()

Reimplemented in nsXULElement, nsGenericElement, nsHTMLSelectElement, nsHTMLInputElement, nsHTMLSharedElement, nsHTMLTextAreaElement, nsHTMLAnchorElement, nsHTMLButtonElement, nsHTMLLabelElement, nsHTMLAreaElement, nsHTMLLegendElement, nsHTMLAppletElement, and nsHTMLObjectElement.

Definition at line 464 of file nsIContent.h.

  {
  }

Here is the caller graph for this function:

virtual void nsIContent::SetMayHaveFrame ( PRBool  aMayHaveFrame) [inline, virtual]

Call to let the content node know that it may now have a frame.

The content node may use this to determine what MayHaveFrame returns.

Reimplemented in nsGenericElement.

Definition at line 607 of file nsIContent.h.

  {
  }

Here is the caller graph for this function:

virtual void nsIContent::SetNativeAnonymous ( PRBool  aAnonymous) [pure virtual]

Set whether this content is anonymous.

See also:
nsIAnonymousContentCreator
Parameters:
aAnonymouswhether this content is anonymous

Implemented in nsGenericElement, and nsGenericDOMDataNode.

virtual nsresult nsIContent::SetProperty ( nsIAtom aPropertyName,
void aValue,
NSPropertyDtorFunc  aDtor = nsnull 
) [inline, virtual]

Reimplemented in nsGenericElement.

Definition at line 681 of file nsIContent.h.

virtual nsIAtom* nsIContent::Tag ( ) const [pure virtual]

Get the tag for this element.

This will always return a non-null atom pointer (as implied by the naming of the method).

Implemented in nsGenericElement, nsDOMDocumentType, nsTextNode, nsXMLCDATASection, nsXMLProcessingInstruction, and nsCommentNode.

virtual void nsIContent::UnbindFromTree ( PRBool  aDeep = PR_TRUE,
PRBool  aNullParent = PR_TRUE 
) [pure virtual]

Unbind this content node from a tree.

This will set its current document and binding parent to null. In the typical case of a node being removed from a parent, this will be called after it has been removed from the parent's child list and after the nsIDocumentObserver notifications for the removal have been dispatched.

Parameters:
aDeepWhether to recursively unbind the entire subtree rooted at this node. The only time PR_FALSE should be passed is when the parent node of the content is being destroyed.
aNullParentWhether to null out the parent pointer as well. This is usually desirable. This argument should only be false while recursively calling UnbindFromTree when a subtree is detached.
Note:
This method is safe to call on nodes that are not bound to a tree.

Implemented in nsGenericHTMLFrameElement, nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsHTMLInputElement, nsGenericDOMDataNode, nsHTMLFormElement, nsAttributeTextNode, nsHTMLBodyElement, nsHTMLAnchorElement, nsHTMLAreaElement, nsHTMLLinkElement, nsHTMLLabelElement, nsHTMLLegendElement, nsHTMLStyleElement, nsXTFElementWrapper, nsSVGElement, nsSVGStyleElement, nsHTMLMapElement, and nsXMLStylesheetPI.

Here is the caller graph for this function:

virtual nsresult nsIContent::UnsetAttr ( PRInt32  aNameSpaceID,
nsIAtom aAttr,
PRBool  aNotify 
) [pure virtual]

Remove an attribute so that it is no longer explicitly specified.

Parameters:
aNameSpaceIDthe namespace id of the attribute
aAttrthe name of the attribute to unset
aNotifyspecifies whether or not the document and appropriate mutation event listeners should be notified of the attribute change

Implemented in nsGenericHTMLFormElement, nsXULElement, nsGenericElement, nsHTMLInputElement, nsGenericDOMDataNode, nsGenericHTMLElement, nsDocumentFragment, nsHTMLOptionElement, nsHTMLAnchorElement, nsHTMLLinkElement, nsHTMLAreaElement, nsHTMLLabelElement, nsHTMLOptGroupElement, nsHTMLLegendElement, nsXTFElementWrapper, nsHTMLStyleElement, nsSVGElement, and nsSVGStyleElement.

Here is the caller graph for this function:

virtual void* nsIContent::UnsetProperty ( nsIAtom aPropertyName,
nsresult aStatus = nsnull 
) [inline, virtual]

Reimplemented in nsGenericElement.

Definition at line 689 of file nsIContent.h.

  { if (aStatus) *aStatus = NS_ERROR_NOT_IMPLEMENTED; return nsnull; }

Member Data Documentation

Definition at line 731 of file nsIContent.h.

Definition at line 719 of file nsIContent.h.

Definition at line 723 of file nsIContent.h.


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