1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // XForms instance map declaration
24 #ifndef XMLENGCXFORMSINSTANCEMAP_H
25 #define XMLENGCXFORMSINSTANCEMAP_H
29 class RXmlEngDocument;
32 This class associates DOM Documents with a string name.
33 Entries can be added and removed.
35 class CXmlEngXFormsInstanceMap : public CBase
37 friend class RXmlEngXPathExpression;
41 Allocates and constructs a new CXmlENgXFormsInstanceMap object.
42 @return A new CXmlEngXFormsInstanceMap object.
43 @leave KErrNoMemory Memory allocation failure
44 @leave - Otherwise, any of the system wide errors.
46 IMPORT_C static CXmlEngXFormsInstanceMap* NewL();
49 Allocates and constructs a new CXmlENgXFormsInstanceMap object, and leaves
50 it on the cleanup stack.
51 @return A new CXmlEngXFormsInstanceMap object.
52 @leave KErrNoMemory Memory allocation failure
53 @leave - Otherwise, any of the system wide errors.
55 IMPORT_C static CXmlEngXFormsInstanceMap* NewLC();
59 Destructor. Frees internal storage, but does not free the Document
60 instances that were added. These are owned by the caller.
62 IMPORT_C ~CXmlEngXFormsInstanceMap();
65 Adds an entry to the map. The document is associated with a name. If an
66 entry with the same name already exists this method does nothing.
68 Ownership of the document is not transferred.
70 @param aInstance The DOM document to be stored.
71 @param aName The name that to be associated with the document.
72 @leave KErrNoMemory Memory allocation failure
73 @leave - Otherwise, any of the system wide errors.
75 IMPORT_C void AddEntryL(RXmlEngDocument& aInstance, const TDesC8& aName);
78 Removes an entry from the map. If the entry does not exist, the
79 method does nothing. Note that the document is not freed.
81 @param aName Name of entry to remove.
82 @leave KErrNoMemory Memory allocation failure
83 @leave - Otherwise, any of the system wide errors.
85 IMPORT_C void RemoveEntryL(const TDesC8& aName);
88 /** Second phase constructor */
91 /** Default constructor */
92 CXmlEngXFormsInstanceMap() {}
98 #endif // XMLENGCXFORMSINSTANCEMAP_H