epoc32/include/xmlengdocument.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/xmlengdocument.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/xmlengdocument.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,573 @@
     1.4 -xmlengdocument.h
     1.5 +/*
     1.6 +* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:       Document node functions
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +#ifndef XMLENGINE_DOCUMENT_H_INCLUDED
    1.28 +#define XMLENGINE_DOCUMENT_H_INCLUDED
    1.29 +
    1.30 +#include <f32file.h> 
    1.31 +
    1.32 +#include "xmlengnode.h"
    1.33 +#include "xmlengserializationoptions.h"
    1.34 +
    1.35 +// FORWARD DECLARATION
    1.36 +class RXmlEngDOMImplementation;
    1.37 +
    1.38 +/**
    1.39 + * Instance of RXmlEngDocument class represents an XML document in the DOM tree.
    1.40 + * 
    1.41 + * Is a storage all nodes and information about XML data.
    1.42 + * 
    1.43 + * @lib XmlEngineDOM.lib
    1.44 + * @since S60 v3.1
    1.45 + */
    1.46 +class RXmlEngDocument : public TXmlEngNode
    1.47 +{
    1.48 +public:    
    1.49 +    /**
    1.50 +     * Default constructor.
    1.51 +     *
    1.52 +     * Instance of RXmlEngDocument must be "opened" with one of OpenL() overloads.
    1.53 +     *
    1.54 +     * @since S60 v3.1
    1.55 +	 */
    1.56 +    IMPORT_C RXmlEngDocument();
    1.57 +    
    1.58 +    /** 
    1.59 +     * Opens the document.
    1.60 +     *
    1.61 +	 * @since S60 v3.2
    1.62 +	 * @param aDOMImpl DOM implementation object
    1.63 +     * @return KErrNone if succeed.
    1.64 +     */
    1.65 +    IMPORT_C void OpenL(RXmlEngDOMImplementation& aDOMImpl);
    1.66 +	
    1.67 +	/** 
    1.68 +     * Opens the document.
    1.69 +     *
    1.70 +	 * @since S60 v3.2
    1.71 +	 * @param aDOMImpl DOM implementation object
    1.72 + 	 * @param aInternal Document pointer
    1.73 +     * @return KErrNone if succeed.
    1.74 +     */
    1.75 +    IMPORT_C void OpenL(RXmlEngDOMImplementation& aDOMImpl, void* aInternal);
    1.76 +    
    1.77 +    /** 
    1.78 +     * Opens the document.
    1.79 +     *
    1.80 +	 * @since S60 v3.2
    1.81 +	 * @param aDOMImpl DOM implementation object
    1.82 + 	 * @param aRoot element taht will be root of the DOM tree
    1.83 +     * @return KErrNone if succeed.
    1.84 +     */
    1.85 +    IMPORT_C void OpenL(RXmlEngDOMImplementation& aDOMImpl, TXmlEngElement aRoot);
    1.86 +    
    1.87 +    /**
    1.88 +     * Closes document
    1.89 +     *
    1.90 +     * @since S60 v3.1
    1.91 +	 */
    1.92 +    IMPORT_C  void Close();
    1.93 +
    1.94 +    /**
    1.95 +     * Serializes document tree into a file. For nodes containing binary data in the form of BinaryDataContainer,
    1.96 +     * FileContainer or ChunkContainer, client can implement custom serialization by implementing the interface
    1.97 +     * MXmlEngDataSerializer and specify the pointer in iDataSerializer member of aSaveOptions parameter. If no
    1.98 +     * custom serialization is specified, the binary data container nodes are serialized like text nodes.
    1.99 +     *
   1.100 +     * @since S60 v3.2
   1.101 +	 * @param aFileName A file name (with path)
   1.102 + 	 * @param aRoot Root node to be serialized	
   1.103 +	 * @param aSaveOptions Options that control how serialization is performed 
   1.104 +     * @return Number of byte written
   1.105 +     * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding, KErrDiskFull.
   1.106 +     */
   1.107 +    IMPORT_C TInt SaveL( const TDesC& aFileName,
   1.108 +    					 TXmlEngNode aRoot = TXmlEngNode(),
   1.109 +    					 const TXmlEngSerializationOptions& aSaveOptions = TXmlEngSerializationOptions() ) const;
   1.110 +   
   1.111 +    /**
   1.112 +     * Serializes document tree into a file.  For nodes containing binary data in the form of BinaryDataContainer,
   1.113 +     * FileContainer or ChunkContainer, client can implement custom serialization by implementing the interface
   1.114 +     * MXmlEngDataSerializer and specify the pointer in iDataSerializer member of aSaveOptions parameter. If no
   1.115 +     * custom serialization is specified, the binary data container nodes are serialized like text nodes.
   1.116 +     *
   1.117 +     * @since S60 v3.2
   1.118 +	 * @param aRFs File Server session
   1.119 +	 * @param aFileName A file name (with path)	 
   1.120 + 	 * @param aRoot Root node to be serialized	
   1.121 +	 * @param aSaveOptions Options that control how serialization is performed 
   1.122 +     * @return Number of byte written
   1.123 +     * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding, KErrDiskFull.
   1.124 +     */                        
   1.125 +    IMPORT_C TInt SaveL( RFs& aRFs,
   1.126 +                         const TDesC& aFileName,
   1.127 +                         TXmlEngNode aRoot = TXmlEngNode(),
   1.128 +                         const TXmlEngSerializationOptions& aSaveOptions = TXmlEngSerializationOptions() ) const;
   1.129 +    
   1.130 +    /**
   1.131 +     * Serializes a document tree into provided output stream, which supports progressive writing of data.
   1.132 +     * For nodes containing binary data in the form of BinaryDataContainer, FileContainer or ChunkContainer,
   1.133 +     * client can implement custom serialization by implementing the interface MXmlEngDataSerializer and specify
   1.134 +     * the pointer in iDataSerializer member of aSaveOptions parameter. If no custom serialization is specified,
   1.135 +     * the binary data container nodes are serialized like text nodes.
   1.136 +     *
   1.137 +     * @since S60 v3.1
   1.138 +	 * @param aStream  An output stream to write serialized DOM tree
   1.139 +	 * @param aRoot Root node to be serialized
   1.140 +	 * @param aSaveOptions Options that control how serialization is performed	 	 
   1.141 +     * @return Number of byte written
   1.142 +     * @leave KXmlEngErrWrongUseOfAPI or one of general codes (e.g.KErrNoMemory)
   1.143 +     * @see MXmlEngOutputStream
   1.144 +     */
   1.145 +    IMPORT_C TInt SaveL( MXmlEngOutputStream& aStream,
   1.146 +						 TXmlEngNode aRoot = TXmlEngNode(),
   1.147 +						 const TXmlEngSerializationOptions& aSaveOptions = TXmlEngSerializationOptions() ) const;
   1.148 +
   1.149 +    /**
   1.150 +     * Saves document tree into memory buffer
   1.151 +     *
   1.152 +     * @since S60 v3.1
   1.153 +	 * @param aBuffer Resulting buffer
   1.154 +     * @param aRoot A "root" of the subtree to serialize
   1.155 +     * @param aSaveOptions Various options to be effective during serialization
   1.156 +     * @return Number of bytes in updated buffer     
   1.157 +     * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding.
   1.158 +     *
   1.159 +     * @note Result returned via aBuffer argument owns the memory buffer; it is up to 
   1.160 +     *      method caller to free it like in this sample:
   1.161 +     *
   1.162 +     * @see TXmlEngSerializationOptions
   1.163 +     */
   1.164 +    IMPORT_C TInt SaveL(RBuf8& aBuffer, 
   1.165 +    					TXmlEngNode aRoot = TXmlEngNode(), 
   1.166 +                        const TXmlEngSerializationOptions& aSaveOptions = TXmlEngSerializationOptions()) const;
   1.167 +   
   1.168 +    /**
   1.169 +     * Creates complete copy of the document
   1.170 +     *
   1.171 +     * @since S60 v3.1
   1.172 +	 * @return Complete copy of the document tree
   1.173 +     */
   1.174 +	IMPORT_C RXmlEngDocument CloneDocumentL() const;
   1.175 +
   1.176 +    /**
   1.177 +     * Creates new element from specific namespace to be a root of the document tree.
   1.178 +     * Any existing document element of the document is destroyed
   1.179 +     *
   1.180 +     * @since S60 v3.1
   1.181 +	 * @param aName Element name
   1.182 +     * @param aNamespaceUri Element namespace URI
   1.183 +     * @param aPrefix Element namemespace prefix
   1.184 +     * @return A new root element
   1.185 +     */
   1.186 +    IMPORT_C TXmlEngElement CreateDocumentElementL(const TDesC8& aName, 
   1.187 +                                             const TDesC8& aNamespaceUri = KNullDesC8, 
   1.188 +                                             const TDesC8& aPrefix = KNullDesC8);
   1.189 +
   1.190 +    /**
   1.191 +     * Replaces (and destroys) document element with another one
   1.192 +     * New document element is added as the last child to the document node
   1.193 +     *
   1.194 +     * @since S60 v3.1
   1.195 +	 * @param aNewDocElement New document tree
   1.196 +     *
   1.197 +     * @note Use TXmlEngElement::ReconcileNamespacesL() on the new document element
   1.198 +     *      if it or its descendants can contain references to namespace declarations
   1.199 +     *      out of the element
   1.200 +     * @see TXmlEngElement::ReconcileNamespacesL()
   1.201 +     */
   1.202 +    IMPORT_C void SetDocumentElement(TXmlEngElement aNewDocElement);
   1.203 +
   1.204 +    /**
   1.205 +     * Get document encoding
   1.206 +     *
   1.207 +     * @since S60 v3.1
   1.208 +	 * @return Encoding of the source XML data.
   1.209 +     */
   1.210 +    IMPORT_C TPtrC8 XmlEncoding() const;
   1.211 +
   1.212 +    /**
   1.213 +     * Get xml version
   1.214 +     *
   1.215 +     * @since S60 v3.1
   1.216 +	 * @return Version number of XML taken from XML declaration
   1.217 +     */
   1.218 +    IMPORT_C TPtrC8 XmlVersion() const;
   1.219 +  
   1.220 +    /**
   1.221 +     * Retrieves base URI (if defined) of the document or NULL
   1.222 +     *
   1.223 +     * @since S60 v3.1
   1.224 +	 * @return Document URI
   1.225 +     */
   1.226 +    IMPORT_C TPtrC8 DocumentUri() const;
   1.227 +
   1.228 +    /**
   1.229 +     * Check if document is standalone
   1.230 +     *
   1.231 +     * @since S60 v3.1
   1.232 +	 * @return Whether standalone="true" was specified in XML declaration in the source XML file.
   1.233 +     */
   1.234 +    IMPORT_C TBool IsStandalone() const;
   1.235 +
   1.236 +    /**
   1.237 +     * Sets XML version number to be shown in XML declaration when document is serialized.
   1.238 +     *
   1.239 +     * @since S60 v3.1
   1.240 +	 * @param aVersion New version
   1.241 +     */
   1.242 +    IMPORT_C void  SetXmlVersionL(const TDesC8& aVersion);
   1.243 +
   1.244 +    /**
   1.245 +     * Sets location of the document.
   1.246 +     * Document's URI is used as top-level base URI definition.
   1.247 +     *
   1.248 +     * @since S60 v3.1
   1.249 +	 * @param aUri New document URI
   1.250 +     */
   1.251 +    IMPORT_C void  SetDocumentUriL(const TDesC8& aUri);
   1.252 +
   1.253 +    /**
   1.254 +     * Sets 'standalone' attribute of XML declaration for a document
   1.255 +     *
   1.256 +     * @since S60 v3.1
   1.257 +	 * @param aStandalone Is document standalone
   1.258 +     */
   1.259 +    IMPORT_C void  SetStandalone(TBool aStandalone);
   1.260 +
   1.261 +    /**
   1.262 +     * Get dom implementation.
   1.263 +     *
   1.264 +     * @since S60 v3.1
   1.265 +	 * @return Object that represents current DOM implementation
   1.266 +     *
   1.267 +     * @note There is no practical use of implementation object in this version
   1.268 +     *      of API other than for creating new RXmlEngDocument instances, but
   1.269 +     *      it will change in the future, when an implementation object 
   1.270 +     *      is used for changing configuration settings at run-time.
   1.271 +     */
   1.272 +    IMPORT_C RXmlEngDOMImplementation Implementation() const;
   1.273 +    
   1.274 +    /**
   1.275 +     * Get document element
   1.276 +     *
   1.277 +     * @since S60 v3.1
   1.278 +	 * @return A document element - the top-most element in the document tree
   1.279 +     */
   1.280 +    IMPORT_C TXmlEngElement DocumentElement() const;
   1.281 +
   1.282 +    /**
   1.283 +     * Sets "document" property on the node and all its descendants to be this RXmlEngDocument node 
   1.284 +     *
   1.285 +     * @since S60 v3.1
   1.286 +	 * @param aSource Node that should be added.
   1.287 +     * @return Adopted node
   1.288 +     */
   1.289 +    IMPORT_C TXmlEngNode AdoptNodeL(TXmlEngNode aSource);
   1.290 +
   1.291 +    /**
   1.292 +     * Creates new attribute,
   1.293 +     *
   1.294 +     * @since S60 v3.1
   1.295 +	 * @param aName Name of the atribute; no prefix allowed
   1.296 +     * @param aValue Value of the attribute (optional)
   1.297 +     * @return Handler to the newly created attribute 
   1.298 +     * 
   1.299 +     * @note 
   1.300 +     * aValue should represent a correct value of an attribute if it is put as is into XML file
   1.301 +     * (with all characters correctly escaped with entity references when XML spec requires)
   1.302 +     * 
   1.303 +     * TXmlEngElement class provides a rich set of attribute creation methods, which not
   1.304 +     * just create attribute but also link it into element.
   1.305 +     * 
   1.306 +     * There is no way to create attributes with namespace (despite the DOM spec); 
   1.307 +     * you have to use one of the TXmlEngElement::AddNewAttributeL(..) methods instead
   1.308 +     *
   1.309 +     * Returned handler is the only reference to the allocated memory
   1.310 +     * until you have attached the attribute to some element node
   1.311 +     */
   1.312 +    IMPORT_C TXmlEngAttr CreateAttributeL(const TDesC8& aName,
   1.313 +                                    const TDesC8& aValue = KNullDesC8);
   1.314 +
   1.315 +    /**
   1.316 +     * Creates new text node and copies the content string into it.
   1.317 +     *
   1.318 +     * @since S60 v3.1
   1.319 +	 * @param aCharacters Text node content
   1.320 +     * @return Created node
   1.321 +     */
   1.322 +    IMPORT_C TXmlEngTextNode CreateTextNodeL(const TDesC8& aCharacters = KNullDesC8);
   1.323 +
   1.324 +    /**
   1.325 +     * Creates new binary container and copies the content string into it.
   1.326 +     * Pointer to the container is stored in the document's 
   1.327 +     * data container list that can be fetched using GetDataContainerList().
   1.328 +     * @see GetDataContainerList( RArray<TXmlEngDataContainer>& aList )
   1.329 +     *
   1.330 +     * @since S60 v3.2
   1.331 +	 * @param aCid Content identifier     
   1.332 +	 * @param aData Binary octets
   1.333 +     * @return Created node
   1.334 +     */
   1.335 +    IMPORT_C TXmlEngBinaryContainer CreateBinaryContainerL( const TDesC8& aCid,
   1.336 +    												  const TDesC8& aData );
   1.337 +
   1.338 +    /**
   1.339 +     * Creates new chunk container that stores reference to 
   1.340 +     * memory chunk.
   1.341 +     * Pointer to the container is stored in the document's 
   1.342 +     * data container list that can be fetched using GetDataContainerList().
   1.343 +     * @see GetDataContainerList( RArray<TXmlEngDataContainer>& aList )     
   1.344 +     *
   1.345 +     * @since S60 v3.2
   1.346 +	 * @param aCid Content identifier 
   1.347 +	 * @param aChunk RChunk reference
   1.348 +	 * @param aChunkOffset Offset to the binary data in aChunk
   1.349 +	 * @param aDataSize Size of binary data in aChunk
   1.350 +     * @return Created node
   1.351 +     */
   1.352 +    IMPORT_C TXmlEngChunkContainer CreateChunkContainerL( const TDesC8& aCid, 
   1.353 +    												const RChunk& aChunk,
   1.354 +					                                const TInt aChunkOffset,
   1.355 +					                                const TInt aDataSize );
   1.356 +
   1.357 +    /**
   1.358 +     * Creates new file container that stores reference to 
   1.359 +     * file in file system.
   1.360 +     * Pointer to the container is stored in the document's 
   1.361 +     * data container list that can be fetched using GetDataContainerList().
   1.362 +     * @see GetDataContainerList( RArray<TXmlEngDataContainer>& aList )     
   1.363 +     *
   1.364 +     * @since S60 v3.2
   1.365 +	 * @param aCid Content identifier
   1.366 +	 * @param aFile RFile reference
   1.367 +     * @return Created node
   1.368 +     */
   1.369 +    IMPORT_C TXmlEngFileContainer CreateFileContainerL( const TDesC8& aCid, 
   1.370 +    											  const RFile& aFile );
   1.371 +
   1.372 +    /**
   1.373 +     * Creates new element node that belongs to specific namespace.
   1.374 +     * A namespace declaration node is created on the element.
   1.375 +     *
   1.376 +     * @since S60 v3.1
   1.377 +	 * @param aNamespaceUri Namespace of new element
   1.378 +     * @param aPrefix Prefix to use for namespace binding and QName of the element
   1.379 +     * @param aLocalName Local name of the element 
   1.380 +     * @return Created node
   1.381 +     * @note If null namespace uri is provided element will be created without namespace.
   1.382 +     */  
   1.383 +    IMPORT_C TXmlEngElement CreateElementL(const TDesC8& aLocalName, 
   1.384 +                                     const TDesC8& aNamespaceUri = KNullDesC8, 
   1.385 +                                     const TDesC8& aPrefix = KNullDesC8);
   1.386 +
   1.387 +    /**
   1.388 +     * Creates new comment node and copies the content string into it.
   1.389 +     *
   1.390 +     * @since S60 v3.1
   1.391 +	 * @param aText New comment
   1.392 +     * @return Created node
   1.393 +     */
   1.394 +    IMPORT_C TXmlEngComment CreateCommentL(const TDesC8& aText = KNullDesC8);
   1.395 +
   1.396 +    /**
   1.397 +     * Creates new CDATA section node and copies the content into it.
   1.398 +     *
   1.399 +     * @since S60 v3.1
   1.400 +	 * @param aContents CDATASection content
   1.401 +     * @return Created node
   1.402 +     */
   1.403 +    IMPORT_C TXmlEngCDATASection CreateCDATASectionL(const TDesC8& aContents = KNullDesC8);
   1.404 +
   1.405 +    /**
   1.406 +     * Creates new entity reference node for aEntityName entity
   1.407 +     *
   1.408 +     * @since S60 v3.1
   1.409 +	 * @param aEntityRef is a string in one of the forms:
   1.410 +     *     -  <i>name</i>
   1.411 +     *     -  <b>&</b><i>name</i>
   1.412 +     *     -  <b>&</b><i>name</i><b>;</b>
   1.413 +     * where <i>name</i> is the name of the entity
   1.414 +     * @return Created node
   1.415 +     * 
   1.416 +     * @note &lt; , &gt; , &apos; , &quot; and other <b>predefined</b> entity references
   1.417 +     *      should not be created with this method. These entity refs are rather 
   1.418 +     *      "character references" and encoded/decoded automatically.
   1.419 +     */
   1.420 +    IMPORT_C TXmlEngEntityReference CreateEntityReferenceL(const TDesC8& aEntityRef);
   1.421 +
   1.422 +    /**
   1.423 +     * Creates new processing instruction node and set its "target" and "data" values
   1.424 +     *
   1.425 +     * @since S60 v3.1
   1.426 +	 * @param aTarget Target
   1.427 +     * @param aData Data
   1.428 +     * @return Created node
   1.429 +     */
   1.430 +    IMPORT_C TXmlEngProcessingInstruction CreateProcessingInstructionL(const TDesC8& aTarget, 
   1.431 +                                                                 const TDesC8& aData = KNullDesC8);
   1.432 +                                                                 
   1.433 +    /**
   1.434 +     * Registers specified attribute as xml:id.
   1.435 +     * First parametr allows user, to specify sub-tree, not to search whole document.
   1.436 +     * To search whole tree see @see RegisterXmlId(const TDesC8,const TDesC8)
   1.437 +     *
   1.438 +     * @since S60 v3.2
   1.439 +     * @param aStartElement Root of tree to search (should be part of the document)
   1.440 +     * @param aLocalName Name of attribute
   1.441 +	 * @param aNamespaceUri Namespace of new element (default empty)
   1.442 +     */
   1.443 +    IMPORT_C void RegisterXmlIdL(TXmlEngElement aStartElement,
   1.444 +                                 const TDesC8& aLocalName, 
   1.445 +                                 const TDesC8& aNamespaceUri = KNullDesC8);
   1.446 +
   1.447 +    /**
   1.448 +     * Registers specified attribute as xml:id.
   1.449 +     * Not to search whole tree see @see RegisterXmlId(TXmlEngElement,const TDesC8,const TDesC8)
   1.450 +     *
   1.451 +     * @since S60 v3.2
   1.452 +     * @param aLocalName Name of attribute
   1.453 +	 * @param aNamespaceUri Namespace of new element (default empty)
   1.454 +     */
   1.455 +    IMPORT_C void RegisterXmlIdL(const TDesC8& aLocalName, 
   1.456 +                                 const TDesC8& aNamespaceUri = KNullDesC8);
   1.457 +       
   1.458 +    /**
   1.459 +     * Looks for element with specified value of xml:id
   1.460 +     *
   1.461 +     * @since S60 v3.2
   1.462 +	 * @param aValue Name of attribute
   1.463 +     * @return found element or null-element.
   1.464 +     */
   1.465 +    IMPORT_C TXmlEngElement FindElementByXmlIdL(const TDesC8& aValue ) const;  
   1.466 +
   1.467 +    /**
   1.468 +     * Retrieves an array of data containers owned by this document.
   1.469 +     *
   1.470 +	 * @note The document ceases to be the owner of data container when data container
   1.471 +	 *		 (or one of its predecessors) is removed from the document or data container 
   1.472 +	 * 	 	 (or one of its predecessors) becomes a part of another document.
   1.473 +	 *		 Unlinking data container (or one of its predecessors) doesn't remove
   1.474 +	 *		 ownership of data container from the this document so the list might
   1.475 +	 *		 contain containers that are not linked to this document anymore.    
   1.476 +     * @since S60 v3.2
   1.477 +	 * @param aList Array of data containers
   1.478 +     */
   1.479 +    IMPORT_C void GetDataContainerList( RArray<TXmlEngDataContainer>& aList );         
   1.480 +                                                                 
   1.481 +protected:
   1.482 +    friend class RXmlEngDOMParser;
   1.483 +    friend class TXmlEngNode;
   1.484 +    friend class TXmlEngAttr;
   1.485 +    friend class TXmlEngElement;
   1.486 +    friend class RXmlEngDOMImplementation;
   1.487 +
   1.488 +protected:
   1.489 +    /**
   1.490 +     * Constructor
   1.491 +     *
   1.492 +     * @since S60 v3.1
   1.493 +	 * @param aInternal Document pointer
   1.494 +	 */
   1.495 +    inline RXmlEngDocument(void* aInternal);
   1.496 +
   1.497 +    /**
   1.498 +     * DISABLED for document; CloneDocumentL() must be used
   1.499 +     *
   1.500 +     * @since S60 v3.1
   1.501 +	 */
   1.502 +    inline TXmlEngNode CopyL() const; 
   1.503 +
   1.504 +    /**
   1.505 +     * DISABLED for document; Destroy() must be used
   1.506 +     *
   1.507 +     * @since S60 v3.1
   1.508 +	 */    
   1.509 +    inline void Remove();
   1.510 +
   1.511 +    /**
   1.512 +     * DISABLED for document; Destroy() must be used
   1.513 +     *
   1.514 +     * @since S60 v3.1
   1.515 +	 */ 
   1.516 +    inline void ReplaceWith(TXmlEngNode aNode);
   1.517 +private:
   1.518 +    /**
   1.519 +     * Main implementation of SaveL() functions that puts together all common code
   1.520 +     * and serializes to buffer or output stream.
   1.521 +     *
   1.522 +     * @since S60 v3.2
   1.523 +	 * @param aNode Root node to be serialized     
   1.524 +	 * @param aBuffer buffer with serialized data.
   1.525 +	 * @param aOutputStream stream that should be used during serialization
   1.526 +	 * @param aSaveOptions Options that control how serialization is performed
   1.527 +     * @return Number of bytes written
   1.528 +     * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding, KErrDiskFull.     
   1.529 +	 */ 
   1.530 +	TInt SaveNodeL( TXmlEngNode aNode,
   1.531 +					RBuf8& aBuffer,
   1.532 +               	    MXmlEngOutputStream* aOutputStream = NULL,
   1.533 +               	    TXmlEngSerializationOptions aOpt = TXmlEngSerializationOptions()) const;	
   1.534 +
   1.535 +    /**
   1.536 +     * "Secondary" constructor that should be called on every newly created document node.
   1.537 +     * Initializes container for nodes owned by the document.
   1.538 +     *
   1.539 +     * The need for such secondary constructor is in the fact that underlying libxml2
   1.540 +     * library knows nothing about ownership of unlinked nodes -- this feature is
   1.541 +     * implemented in C++ DOM wrapper.
   1.542 +     *
   1.543 +     * @since S60 v3.1
   1.544 +	 */ 
   1.545 +    void InitOwnedNodeListL();
   1.546 +
   1.547 +    /**
   1.548 +     * Adds aNode to the list of owned nodes - the nodes that are not linked yet into a 
   1.549 +     * document tree, but still destroyed with the document that owns them.
   1.550 +     *
   1.551 +     * @since S60 v3.1
   1.552 +	 * @param aNode Node that should be added to document
   1.553 +     *
   1.554 +     * In case of OOM (during growing node list container) the argument node is freed with
   1.555 +     * xmlFreeNode()
   1.556 +     */ 
   1.557 +    void TakeOwnership(TXmlEngNode aNode);
   1.558 +
   1.559 +    /**
   1.560 +     * Remove aNode from the list of owned nodes.
   1.561 +     *
   1.562 +     * @since S60 v3.1
   1.563 +	 * @param aNode Node that should be removed from document
   1.564 +     */
   1.565 +    void RemoveOwnership(TXmlEngNode aNode);
   1.566 +
   1.567 +protected:
   1.568 +    /**  Pointer to DOM implementation object */
   1.569 +    RXmlEngDOMImplementation* iImpl;
   1.570 +
   1.571 +};// class RXmlEngDocument
   1.572 +
   1.573 +
   1.574 +
   1.575 +#include "xmlengdocument.inl"
   1.576 +
   1.577 +#endif /* XMLENGINE_DOCUMENT_H_INCLUDED */