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.
Public Member Functions | |
---|---|
~CMDXMLNode () | |
IMPORT_C TInt | AppendChild ( CMDXMLNode *) |
TBool | CanHaveChildNodes () |
IMPORT_C TBool | CheckChildren () |
TInt | ElementType () |
CMDXMLNode * | FirstChild () |
TBool | HasChildNodes () |
IMPORT_C TInt | InsertBefore ( CMDXMLNode *, CMDXMLNode *) |
CMDXMLNode * | LastChild () |
CMDXMLNode * | NextSibling () |
IMPORT_C TPtrC | NodeName () |
TDOMNodeType | NodeType () |
CMDXMLDocument * | OwnerDocument () |
CMDXMLNode * | ParentNode () |
CMDXMLNode * | PreviousSibling () |
IMPORT_C TInt | RemoveChild ( CMDXMLNode *) |
IMPORT_C TInt | ReplaceChild ( CMDXMLNode *, CMDXMLNode *) |
Protected Member Functions | |
---|---|
CMDXMLNode ( TDOMNodeType , TBool , CMDXMLDocument *) | |
IMPORT_C CMDXMLNode * | NextSameTypeSibling () |
IMPORT_C CMDXMLNode * | PreviousSameTypeSibling () |
void | SetElementType ( TInt ) |
IMPORT_C void | SetNodeNameL (const TDesC &) |
Public Member Enumerations | |
---|---|
enum |
TDOMNodeType
{
EElementNode = 1, ETextNode = 3, ECDATASectionNode = 4, EProcessingInstructionNode = 7, ECommentNode = 8, EDocumentNode = 9 } |
Protected Attributes | |
---|---|
CMDXMLDocument * | iOwnerDocument |
Private Attributes | |
---|---|
TBool | iCanHaveChildren |
TInt | iElementType |
CMDXMLNode * | iFirstChildPtr |
CMDXMLNode * | iLastChildPtr |
CMDXMLNode * | iNextSiblingPtr |
HBufC * | iNodeName |
TDOMNodeType | iNodeType |
CMDXMLNode * | iParentPtr |
CMDXMLNode * | iPrevSiblingPtr |
CMDXMLNode | ( | TDOMNodeType | aNodeType, |
TBool | aCanHaveChildren, | ||
CMDXMLDocument * | aOwnerDocument | ||
) | [protected] |
TDOMNodeType aNodeType | |
TBool aCanHaveChildren | |
CMDXMLDocument * aOwnerDocument |
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
IMPORT_C TInt | AppendChild | ( | CMDXMLNode * | aChildToInsert | ) |
Appends a new child at the end of the child list.
CMDXMLNode * aChildToInsert | Pointer to the new child node to append. |
IMPORT_C TBool | CheckChildren | ( | ) | [pure virtual] |
Checks the children of this node for validity.
IMPORT_C TInt | InsertBefore | ( | CMDXMLNode * | aInsertBeforeChild, |
CMDXMLNode * | aChildToInsert | |||
) |
Inserts a new child node at a specific point in the child list.
CMDXMLNode * aInsertBeforeChild | Pointer to the element before which the new child should be inserted. UseNULL to insert at the start of the list. |
CMDXMLNode * aChildToInsert | Pointer to the new child node to insert |
IMPORT_C CMDXMLNode * | NextSameTypeSibling | ( | ) | [protected] |
Gets a pointer to the next sibling node of the same type if any, otherwise returns NULL
CMDXMLNode * | NextSibling | ( | ) | [inline] |
Gets a pointer to the next sibling node, if any.
CMDXMLDocument * | OwnerDocument | ( | ) | [inline] |
Gets a pointer to the document which is the owner of the DOM tree.
IMPORT_C CMDXMLNode * | PreviousSameTypeSibling | ( | ) | [protected] |
Gets a pointer to the previous sibling node of the same type if any, otherwise returns NULL
CMDXMLNode * | PreviousSibling | ( | ) | [inline] |
Gets a pointer to the previous sibling node, if any.
IMPORT_C TInt | RemoveChild | ( | CMDXMLNode * | aChildToRemove | ) |
Removes a child from the list of child nodes.
The child node is not deleted: that is the responsibility of the caller.
CMDXMLNode * aChildToRemove | Pointer to child to remove from the list |
IMPORT_C TInt | ReplaceChild | ( | CMDXMLNode * | aChildToInsert, |
CMDXMLNode * | aChildToReplace | |||
) |
Inserts a new child node while removing an existing one.
The old child is not deleted.
CMDXMLNode * aChildToInsert | Pointer to the new child node to insert |
CMDXMLNode * aChildToReplace | Pointer to the child node to be replaced |
void | SetElementType | ( | TInt | aElementType | ) | [protected, inline] |
Sets the enumerated element type (same information as node name but faster to access)
TInt aElementType |
IMPORT_C void | SetNodeNameL | ( | const TDesC & | aNodeName | ) | [protected] |
const TDesC & aNodeName | The node name - commonly an element tag name - _not_ any unique identifier |
XML DOM node types.
The values are taken from the DOM definition, but only some of them are used for the SMIL API.
EElementNode = 1 | |
ETextNode = 3 | |
ECDATASectionNode = 4 | |
EProcessingInstructionNode = 7 | |
ECommentNode = 8 | |
EDocumentNode = 9 |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.