|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // XForms instance map declaration |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGCXFORMSINSTANCEMAP_H |
|
25 #define XMLENGCXFORMSINSTANCEMAP_H |
|
26 |
|
27 #include <e32base.h> |
|
28 |
|
29 class RXmlEngDocument; |
|
30 |
|
31 /** |
|
32 This class associates DOM Documents with a string name. |
|
33 Entries can be added and removed. |
|
34 */ |
|
35 class CXmlEngXFormsInstanceMap : public CBase |
|
36 { |
|
37 friend class RXmlEngXPathExpression; |
|
38 |
|
39 public: |
|
40 /** |
|
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. |
|
45 */ |
|
46 IMPORT_C static CXmlEngXFormsInstanceMap* NewL(); |
|
47 |
|
48 /** |
|
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. |
|
54 */ |
|
55 IMPORT_C static CXmlEngXFormsInstanceMap* NewLC(); |
|
56 |
|
57 public: |
|
58 /** |
|
59 Destructor. Frees internal storage, but does not free the Document |
|
60 instances that were added. These are owned by the caller. |
|
61 */ |
|
62 IMPORT_C ~CXmlEngXFormsInstanceMap(); |
|
63 |
|
64 /** |
|
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. |
|
67 |
|
68 Ownership of the document is not transferred. |
|
69 |
|
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. |
|
74 */ |
|
75 IMPORT_C void AddEntryL(RXmlEngDocument& aInstance, const TDesC8& aName); |
|
76 |
|
77 /** |
|
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. |
|
80 |
|
81 @param aName Name of entry to remove. |
|
82 @leave KErrNoMemory Memory allocation failure |
|
83 @leave - Otherwise, any of the system wide errors. |
|
84 */ |
|
85 IMPORT_C void RemoveEntryL(const TDesC8& aName); |
|
86 |
|
87 private: |
|
88 /** Second phase constructor */ |
|
89 void ConstructL(); |
|
90 |
|
91 /** Default constructor */ |
|
92 CXmlEngXFormsInstanceMap() {} |
|
93 |
|
94 private: |
|
95 void *iInternal; |
|
96 }; |
|
97 |
|
98 #endif // XMLENGCXFORMSINSTANCEMAP_H |
|
99 |