CMDXMLNode Class Reference

class CMDXMLNode : public CBase

Abstract base class for DOM node classes.

It stores the node type and name, and manages a list of child nodes. The node name and type are set in the derived class's constructor and cannot be changed.

The list of child nodes is managed as a doubly-linked list, not an array or similar structure.

Derived classes that are not allowed children override the operations to manipulate the child list.

Inherits from

Constructor & Destructor Documentation

CMDXMLNode(TDOMNodeType, TBool, CMDXMLDocument *)

CMDXMLNode(TDOMNodeTypeaNodeType,
TBoolaCanHaveChildren,
CMDXMLDocument *aOwnerDocument
)[protected]

Parameters

TDOMNodeType aNodeType
TBool aCanHaveChildren
CMDXMLDocument * aOwnerDocument

~CMDXMLNode()

IMPORT_C~CMDXMLNode()[virtual]

Destructor.

When a node is deleted, it:

1. links its previous and next siblings

2. deletes all its children

3. corrects its parents first and last child pointers if necessary

Member Functions Documentation

AppendChild(CMDXMLNode *)

IMPORT_C TIntAppendChild(CMDXMLNode *aChildToInsert)

Appends a new child at the end of the child list.

Parameters

CMDXMLNode * aChildToInsertPointer to the new child node to append.

CanHaveChildNodes()

TBool CanHaveChildNodes()[inline]

Tests if the node can have child nodes.

CheckChildren()

IMPORT_C TBoolCheckChildren()[pure virtual]

Checks the children of this node for validity.

ElementType()

TInt ElementType()[inline]

Gets the element type as an enumerated value.

This function is quicker to use than NodeName().

FirstChild()

CMDXMLNode *FirstChild()[inline]

Gets a pointer to the first child node, if any.

HasChildNodes()

TBool HasChildNodes()[inline]

Tests if the node has any child nodes.

InsertBefore(CMDXMLNode *, CMDXMLNode *)

IMPORT_C TIntInsertBefore(CMDXMLNode *aInsertBeforeChild,
CMDXMLNode *aChildToInsert
)

Inserts a new child node at a specific point in the child list.

Parameters

CMDXMLNode * aInsertBeforeChildPointer to the element before which the new child should be inserted. UseNULL to insert at the start of the list.
CMDXMLNode * aChildToInsertPointer to the new child node to insert

LastChild()

CMDXMLNode *LastChild()[inline]

Gets a pointer to the last child node, if any.

NextSameTypeSibling()

IMPORT_C CMDXMLNode *NextSameTypeSibling()[protected]

Gets a pointer to the next sibling node of the same type if any, otherwise returns NULL

NextSibling()

CMDXMLNode *NextSibling()[inline]

Gets a pointer to the next sibling node, if any.

NodeName()

IMPORT_C TPtrCNodeName()

Gets the name of the node.

NodeType()

TDOMNodeType NodeType()[inline]

Gets the node type of the node.

OwnerDocument()

CMDXMLDocument *OwnerDocument()[inline]

Gets a pointer to the document which is the owner of the DOM tree.

ParentNode()

CMDXMLNode *ParentNode()[inline]

Gets a pointer to the parent node, if any.

PreviousSameTypeSibling()

IMPORT_C CMDXMLNode *PreviousSameTypeSibling()[protected]

Gets a pointer to the previous sibling node of the same type if any, otherwise returns NULL

PreviousSibling()

CMDXMLNode *PreviousSibling()[inline]

Gets a pointer to the previous sibling node, if any.

RemoveChild(CMDXMLNode *)

IMPORT_C TIntRemoveChild(CMDXMLNode *aChildToRemove)

Removes a child from the list of child nodes.

The child node is not deleted: that is the responsibility of the caller.

Parameters

CMDXMLNode * aChildToRemovePointer to child to remove from the list

ReplaceChild(CMDXMLNode *, CMDXMLNode *)

IMPORT_C TIntReplaceChild(CMDXMLNode *aChildToInsert,
CMDXMLNode *aChildToReplace
)

Inserts a new child node while removing an existing one.

The old child is not deleted.

Parameters

CMDXMLNode * aChildToInsertPointer to the new child node to insert
CMDXMLNode * aChildToReplacePointer to the child node to be replaced

SetElementType(TInt)

voidSetElementType(TIntaElementType)[protected, inline]

Sets the enumerated element type (same information as node name but faster to access)

Parameters

TInt aElementType

SetNodeNameL(const TDesC &)

IMPORT_C voidSetNodeNameL(const TDesC &aNodeName)[protected]
Set the node name - normally on creation
leave
Can Leave due to OOM

Parameters

const TDesC & aNodeNameThe node name - commonly an element tag name - _not_ any unique identifier

Member Enumerations Documentation

Enum TDOMNodeType

XML DOM node types.

The values are taken from the DOM definition, but only some of them are used for the SMIL API.

Enumerators

EElementNode = 1
ETextNode = 3
ECDATASectionNode = 4
EProcessingInstructionNode = 7
ECommentNode = 8
EDocumentNode = 9

Member Data Documentation

TBool iCanHaveChildren

TBool iCanHaveChildren[private]

TInt iElementType

TInt iElementType[private]

CMDXMLNode * iFirstChildPtr

CMDXMLNode *iFirstChildPtr[private]

CMDXMLNode * iLastChildPtr

CMDXMLNode *iLastChildPtr[private]

CMDXMLNode * iNextSiblingPtr

CMDXMLNode *iNextSiblingPtr[private]

HBufC * iNodeName

HBufC *iNodeName[private]

TDOMNodeType iNodeType

TDOMNodeType iNodeType[private]

CMDXMLDocument * iOwnerDocument

CMDXMLDocument *iOwnerDocument[protected]

CMDXMLNode * iParentPtr

CMDXMLNode *iParentPtr[private]

CMDXMLNode * iPrevSiblingPtr

CMDXMLNode *iPrevSiblingPtr[private]