|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: XML DOM Implementation header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SVGXMLELEMENT_H |
|
20 #define SVGXMLELEMENT_H |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 class MXmlDocument; |
|
27 |
|
28 |
|
29 /** |
|
30 * Class description |
|
31 */ |
|
32 class MXmlElement |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Set attribute interface for an XML element |
|
37 * |
|
38 * @since 1.0 |
|
39 * @param aName - A string buffer containing the name of the attribute |
|
40 * @param aValue - A string buffer containing the value of the attribute |
|
41 * @return An integer containing success/failure for this action |
|
42 */ |
|
43 virtual TInt SetAttributeL( const TDesC& aName, |
|
44 const TDesC& aValue ) = 0; |
|
45 |
|
46 /** |
|
47 * Remove attribute interface for an XML element |
|
48 * |
|
49 * @since 1.0 |
|
50 * @param aName - A string buffer containing the name of the attribute to |
|
51 * be removed |
|
52 * @return An integer containing success/failure for this action |
|
53 */ |
|
54 virtual TInt RemoveAttribute( const TDesC& aName ) = 0; |
|
55 |
|
56 |
|
57 /** |
|
58 * Accessor interface for the tag name of an XML element |
|
59 * |
|
60 * @since 1.0 |
|
61 * @param None |
|
62 * @return A string buffer containing the tag name |
|
63 */ |
|
64 virtual const TDesC& TagName() = 0; |
|
65 |
|
66 |
|
67 /** |
|
68 * Append child interface for an XML element |
|
69 * |
|
70 * @since 1.0 |
|
71 * @param aAppendChild - The element object that needs to be appended |
|
72 * @return NULL if failed to append; |
|
73 * A MXmlElement pointer to the object that was just appended |
|
74 */ |
|
75 virtual MXmlElement* AppendChildL( MXmlElement* aAppendChild, TBool aIsJSR226Element = EFalse ) = 0; |
|
76 |
|
77 |
|
78 /** |
|
79 * Remove child interface for an XML element |
|
80 * |
|
81 * @since 1.0 |
|
82 * @param aRemoveChild - A pointer to the object that is to be removed |
|
83 * @return None |
|
84 */ |
|
85 virtual void RemoveChild ( MXmlElement* aRemoveChild ) = 0; |
|
86 |
|
87 |
|
88 /** |
|
89 * 'Has child nodes' interface that finds out if the current element has any child |
|
90 * nodes |
|
91 * |
|
92 * @since 1.0 |
|
93 * @param None |
|
94 * @return A boolean |
|
95 * ETrue if there are child nodes; EFalse otherwise |
|
96 */ |
|
97 virtual TBool HasChildNodes() = 0 ; |
|
98 |
|
99 |
|
100 /** |
|
101 * Accessor interface for 'first child' of an XML element |
|
102 * |
|
103 * @since 1.0 |
|
104 * @param None |
|
105 * @return An MXmlElement pointer to the first child of the current XML element |
|
106 */ |
|
107 virtual MXmlElement* FirstChild() = 0; |
|
108 |
|
109 |
|
110 /** |
|
111 * Accessor interface for 'last child' of an XML element |
|
112 * |
|
113 * @since 1.0 |
|
114 * @param None |
|
115 * @return An MXmlElement pointer to the last child of the current XML element |
|
116 */ |
|
117 virtual MXmlElement* LastChild() = 0; |
|
118 |
|
119 |
|
120 /** |
|
121 * Accessor interface for 'owner document' of an XML element |
|
122 * |
|
123 * @since 1.0 |
|
124 * @param None |
|
125 * @return A MXmlDocument pointer to the document object for this XML document |
|
126 */ |
|
127 virtual MXmlDocument* OwnerDocument() = 0; |
|
128 |
|
129 |
|
130 /** |
|
131 * Accessor interface for 'next sibling' of an XML element |
|
132 * |
|
133 * @since 1.0 |
|
134 * @param None |
|
135 * @return An MXmlElement pointer to the next sibling of the current XML element |
|
136 */ |
|
137 virtual MXmlElement* NextSibling() = 0; |
|
138 |
|
139 /** |
|
140 * Accessor interface for 'parent node' of an XML element |
|
141 * |
|
142 * @since 1.0 |
|
143 * @param None |
|
144 * @return An MXmlElement pointer to the parent node of the current XML element |
|
145 */ |
|
146 virtual MXmlElement* ParentNode() = 0; |
|
147 |
|
148 |
|
149 /** |
|
150 * Accessor to set first child of an XML element |
|
151 * |
|
152 * @since 1.0 |
|
153 * @param An MXmlElement pointer to the object that is being set as first child |
|
154 * @return None |
|
155 */ |
|
156 void virtual SetFirstChild( MXmlElement* ) = 0; |
|
157 |
|
158 |
|
159 /** |
|
160 * Accessor to set last child of an XML element |
|
161 * |
|
162 * @since 1.0 |
|
163 * @param An MXmlElement pointer to the object that is being set as last child |
|
164 * @return None |
|
165 */ |
|
166 void virtual SetLastChild( MXmlElement* ) = 0; |
|
167 |
|
168 |
|
169 /** |
|
170 * Accessor to set owner document of an XML element |
|
171 * |
|
172 * @since 1.0 |
|
173 * @param An MXmlDocument pointer to the object that is being set as owner document |
|
174 * @return None |
|
175 */ |
|
176 void virtual SetOwnerDocument( MXmlDocument* ) = 0; |
|
177 |
|
178 |
|
179 /** |
|
180 * Accessor to set next sibling of an XML element |
|
181 * |
|
182 * @since 1.0 |
|
183 * @param An MXmlElement pointer to the object that is being set as next sibling |
|
184 * @return None |
|
185 */ |
|
186 void virtual SetNextSibling( MXmlElement* ) = 0; |
|
187 |
|
188 |
|
189 /** |
|
190 * Accessor to set parent node of an XML element |
|
191 * |
|
192 * @since 1.0 |
|
193 * @param An MXmlElement pointer to the object that is being set as parent node |
|
194 * @return None |
|
195 */ |
|
196 void virtual SetParentNode( MXmlElement* ) = 0; |
|
197 |
|
198 |
|
199 /** |
|
200 * A method to (deep) clone the current element |
|
201 * |
|
202 * @since 1.0 |
|
203 * @param None |
|
204 * @return An MXmlElement pointer to the object that is a copy of the current element |
|
205 */ |
|
206 virtual MXmlElement* CloneL(MXmlElement* aParentElement) = 0; |
|
207 |
|
208 }; |
|
209 |
|
210 #endif // SVGXMLELEMENT_H |