xmlengnode.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : xmlengnode.h
00004 *  Part of     : XMLEngine / DOM Xpath C++ Wrapper
00005 *  Interface   : Domain, XML Engine DOM API
00006 *  Description : Node class declaration
00007 *  Version     : %version: 2 %
00008 *
00009 *  Copyright © 2004-2006 Nokia. All rights reserved.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia. All rights are reserved. Copying, including 
00013 *  reproducing, storing, adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef XMLENGINE_NODE_H_INCLUDED
00022 #define XMLENGINE_NODE_H_INCLUDED
00023 
00024 #include <e32base.h>
00025 
00026 // forward declaration
00027 class TXmlEngNode;
00028 
00029 // Forward declarations
00030 template<class T> class RXmlEngNodeList;
00031 
00032 class RXmlEngDocument;
00033 class TXmlEngElement;
00034 class TXmlEngAttr;
00035 class TXmlEngTextNode;
00036 class TXmlEngNamespace;
00037 class TXmlEngComment;
00038 class TXmlEngCDATASection;
00039 class TXmlEngDocumentFragment;
00040 class TXmlEngEntityReference;
00041 class TXmlEngProcessingInstruction;
00042 class MXmlEngUserData;
00043 class TXmlEngBinaryContainer;
00044 class TXmlEngChunkContainer;
00045 class TXmlEngDataContainer;
00046 class TXmlEngFileContainer;
00047 //
00048 
00077 class TXmlEngNode
00078 {
00079 public:
00087     enum TXmlEngDOMNodeType {
00088         EElement                =        1,
00089         EAttribute              =        2,
00090         EText                   =        3,
00091         ECDATASection           =        4,
00092         EEntityReference        =        5,
00093         EEntity                 =        6,  //> Not supported currently
00094         EProcessingInstruction  =        7,
00095         EComment                =        8,
00096         EDocument               =        9,
00097         EDocumentType           =        10, //> Not supported currently
00098         EDocumentFragment       =        11,
00099         ENotation               =        12, //> Not supported currently
00100         ENamespaceDeclaration   =        18, //> Not in DOM spec
00101                 EBinaryContainer                =                30, //> Not in DOM spec
00102                 EChunkContainer                 =                31, //> Not in DOM spec
00103                 EFileContainer                  =                32  //> Not in DOM spec
00104     };
00105 
00106 public:
00112     inline TXmlEngNode();
00113 
00120     inline TXmlEngNode(void* aInternal);
00121 
00128     inline TBool IsNull() const;
00129 
00136     inline TBool NotNull()const;
00137 
00148     inline    TXmlEngAttr&                    AsAttr() const;
00149 
00160     inline    TXmlEngTextNode&                AsText() const;
00161 
00172     inline    TXmlEngBinaryContainer&            AsBinaryContainer() const;
00173 
00184     inline    TXmlEngChunkContainer&             AsChunkContainer() const;
00185 
00196     inline    TXmlEngFileContainer&              AsFileContainer() const;
00197 
00208     inline    TXmlEngDataContainer&              AsDataContainer() const;
00209 
00220     inline TXmlEngElement& AsElement() const;
00221 
00232     inline TXmlEngComment& AsComment() const;
00233 
00244     inline TXmlEngNamespace& AsNamespace() const;
00245 
00256     inline TXmlEngCDATASection& AsCDATASection() const;
00257 
00268     inline TXmlEngEntityReference& AsEntityReference() const;
00269 
00280     inline TXmlEngProcessingInstruction& AsProcessingInstruction() const;
00281 
00291     IMPORT_C TInt InnerXmlL(RBuf8& aBuffer);
00292     
00302     IMPORT_C TInt OuterXmlL(RBuf8& aBuffer);
00303 
00310     IMPORT_C void SetAsFirstSibling();
00311 
00318     IMPORT_C void SetAsLastSibling();
00319 
00328     IMPORT_C void MoveBeforeSibling(TXmlEngNode aSiblingNode);
00329 
00338     IMPORT_C void MoveAfterSibling(TXmlEngNode aSiblingNode);
00339 
00352     inline  TXmlEngNode MoveTo(TXmlEngNode aParent);
00353 
00365     IMPORT_C TXmlEngNode Unlink();
00366 
00390     IMPORT_C void ReconcileNamespacesL();
00391 
00399     IMPORT_C void Remove();
00400 
00418     IMPORT_C void ReplaceWith(TXmlEngNode aNode);
00419 
00438     IMPORT_C TXmlEngNode SubstituteForL(TXmlEngNode aNode);
00439 
00450     IMPORT_C TXmlEngNamespace NamespaceDeclaration() const;
00451 
00465     IMPORT_C TBool AddUserData(MXmlEngUserData* aData);
00466 
00473     IMPORT_C MXmlEngUserData* UserData() const;
00474 
00482     IMPORT_C MXmlEngUserData* RemoveUserData();
00483 
00494     IMPORT_C TXmlEngNode CopyL() const;
00495 
00504     IMPORT_C TXmlEngNode CopyToL(TXmlEngNode aParent) const;
00505 
00518     IMPORT_C TXmlEngNode AppendChildL(TXmlEngNode aNewChild);
00519 
00526     IMPORT_C void GetChildNodes(RXmlEngNodeList<TXmlEngNode>& aList) const;
00527 
00534     IMPORT_C TXmlEngNode ParentNode() const;
00535 
00542     IMPORT_C TXmlEngNode FirstChild() const;
00543 
00550     IMPORT_C TXmlEngNode LastChild() const;
00551 
00558     IMPORT_C TXmlEngNode PreviousSibling() const;
00559 
00566     IMPORT_C TXmlEngNode NextSibling() const;
00567 
00576     IMPORT_C RXmlEngDocument OwnerDocument() const;
00577 
00587     IMPORT_C TPtrC8 Value() const;
00588 
00597     IMPORT_C void WholeTextContentsCopyL(RBuf8& aOutput) const;
00598 
00605     IMPORT_C void SetValueL(const TDesC8& aValue);
00606 
00631     IMPORT_C TBool IsSimpleTextContents() const;
00632 
00642     IMPORT_C TXmlEngDOMNodeType NodeType() const;
00643 
00671     IMPORT_C TPtrC8 Name() const;
00672 
00673 
00680     IMPORT_C TBool HasChildNodes() const;
00681 
00690     IMPORT_C TBool HasAttributes() const;
00691 
00699     IMPORT_C void BaseUriL(RBuf8& aBaseUri) const;
00700 
00711     inline TBool IsSameNode(TXmlEngNode aOther) const;
00712 
00726     IMPORT_C TPtrC8 NamespaceUri() const;
00727 
00737     IMPORT_C TPtrC8 Prefix() const;
00738 
00748     IMPORT_C TBool IsDefaultNamespaceL(const TDesC8& aNamespaceUri) const;
00749 
00760     IMPORT_C TPtrC8 LookupPrefixL(const TDesC8& aNamespaceUri) const;
00761 
00771     IMPORT_C TPtrC8 LookupNamespaceUriL(const TDesC8& aPrefix) const;
00772 
00773 protected:
00782     void DoUnlinkNode();
00783 
00792     void LinkBefore(TXmlEngNode aNode);
00793 
00794 protected:
00796     void* iInternal;
00797 
00798 };
00799 
00800 #include "xmlengnode.inl"
00801 
00802 #endif /* XMLENGINE_NODE_H_INCLUDED */

Copyright © Nokia Corporation 2001-2007
Back to top