|
1 /* |
|
2 * Copyright (c) 2006 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: Simple Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <s32strm.h> |
|
25 #include <SenBaseElement.h> |
|
26 #include <SenBaseAttribute.h> |
|
27 #include <SenXmlUtils.h> |
|
28 #include <SenXmlReader.h> |
|
29 #include <SenDomFragment.h> |
|
30 |
|
31 // own simple |
|
32 #include "simplecommon.h" |
|
33 #include "simpleelement.h" |
|
34 #include "simplenamespace.h" |
|
35 #include "simpleattribute.h" |
|
36 #include "simplebasedocument.h" |
|
37 #include "simpleutils.h" |
|
38 #include "simplefilter.h" |
|
39 |
|
40 // ================= MEMBER FUNCTIONS ======================= |
|
41 // |
|
42 |
|
43 // ---------------------------------------------------------- |
|
44 // CSimpleFilter::CSimpleFilter |
|
45 // ---------------------------------------------------------- |
|
46 // |
|
47 CSimpleFilter::CSimpleFilter( ) |
|
48 : CSimpleBaseDocument() |
|
49 { |
|
50 } |
|
51 |
|
52 // ---------------------------------------------------------- |
|
53 // CSimpleFilter::~CSimpleFilter |
|
54 // ---------------------------------------------------------- |
|
55 // |
|
56 CSimpleFilter::~CSimpleFilter() |
|
57 { |
|
58 } |
|
59 |
|
60 // ---------------------------------------------------------- |
|
61 // CSimpleFilter::ConstructL |
|
62 // ---------------------------------------------------------- |
|
63 // |
|
64 void CSimpleFilter::ConstructL( |
|
65 const TDesC8& aNsUri, |
|
66 const TDesC8& aLocalName ) |
|
67 { |
|
68 BaseConstructL(aNsUri, aLocalName); |
|
69 } |
|
70 |
|
71 // ---------------------------------------------------------- |
|
72 // CSimpleFilter::ConstructL |
|
73 // ---------------------------------------------------------- |
|
74 // |
|
75 void CSimpleFilter::ConstructL( |
|
76 const TDesC8& aXml ) |
|
77 { |
|
78 BaseConstructL( aXml ); |
|
79 } |
|
80 |
|
81 // ---------------------------------------------------------- |
|
82 // CSimpleFilter::NewL |
|
83 // ---------------------------------------------------------- |
|
84 // |
|
85 CSimpleFilter* CSimpleFilter::NewL( ) |
|
86 { |
|
87 CSimpleFilter* self = new (ELeave) CSimpleFilter( ); |
|
88 CleanupStack::PushL( self ); |
|
89 self->ConstructL( KSimpleNsFilter, KFilterLocalName ); |
|
90 CleanupStack::Pop( self ); |
|
91 return self; |
|
92 } |
|
93 |
|
94 // ---------------------------------------------------------- |
|
95 // CSimpleFilter::NewL |
|
96 // ---------------------------------------------------------- |
|
97 // |
|
98 CSimpleFilter* CSimpleFilter::NewL( const TDesC8& aXml ) |
|
99 { |
|
100 CSimpleFilter* self = new (ELeave) CSimpleFilter( ); |
|
101 CleanupStack::PushL( self ); |
|
102 self->ConstructL( aXml ); |
|
103 CleanupStack::Pop( self ); |
|
104 return self; |
|
105 } |
|
106 |
|
107 // ---------------------------------------------------------- |
|
108 // CSimpleFilter::ValidateXmlL |
|
109 // ---------------------------------------------------------- |
|
110 // |
|
111 void CSimpleFilter::ValidateXmlL( const TDesC8& aName ) |
|
112 { |
|
113 if ( aName.CompareF( KFilterLocalName ) ) |
|
114 { |
|
115 User::Leave( KErrCorrupt ); |
|
116 } |
|
117 } |
|
118 |
|
119 // ---------------------------------------------------------- |
|
120 // CSimpleFilter::DefaultNamespace |
|
121 // ---------------------------------------------------------- |
|
122 // |
|
123 TPtrC8 CSimpleFilter::DefaultNamespace() |
|
124 { |
|
125 return CSimpleBaseDocument::DefaultNamespace(); |
|
126 } |
|
127 |
|
128 // ---------------------------------------------------------- |
|
129 // CSimpleFilter::AddNamespaceL |
|
130 // ---------------------------------------------------------- |
|
131 // |
|
132 void CSimpleFilter::AddNamespaceL( |
|
133 const TDesC8& aPrefix, |
|
134 const TDesC8& aUri ) |
|
135 { |
|
136 CSimpleBaseDocument::AddNamespaceL( aPrefix, aUri ); |
|
137 } |
|
138 |
|
139 // ---------------------------------------------------------- |
|
140 // CSimpleFilter::NamespacesL |
|
141 // ---------------------------------------------------------- |
|
142 // |
|
143 RPointerArray<MSimpleNamespace>& CSimpleFilter::NamespacesL() |
|
144 { |
|
145 return CSimpleBaseDocument::NamespacesL(); |
|
146 } |
|
147 |
|
148 // ---------------------------------------------------------- |
|
149 // CSimpleFilter::ExternalizeL |
|
150 // ---------------------------------------------------------- |
|
151 // |
|
152 void CSimpleFilter::ExternalizeL( RWriteStream& aStream ) |
|
153 { |
|
154 CSimpleBaseDocument::ExternalizeL( aStream ); |
|
155 } |
|
156 |
|
157 // ---------------------------------------------------------- |
|
158 // CSimpleFilter::Close |
|
159 // ---------------------------------------------------------- |
|
160 // |
|
161 void CSimpleFilter::Close() |
|
162 { |
|
163 CSimpleBaseDocument::Close(); |
|
164 } |
|
165 |
|
166 // ---------------------------------------------------------- |
|
167 // CSimpleFilter::LocalName |
|
168 // ---------------------------------------------------------- |
|
169 // |
|
170 const TDesC8& CSimpleFilter::LocalName() |
|
171 { |
|
172 return CSimpleBaseDocument::LocalName(); |
|
173 } |
|
174 |
|
175 // ---------------------------------------------------------- |
|
176 // CSimpleFilter::DefNamespaceL |
|
177 // ---------------------------------------------------------- |
|
178 // |
|
179 MSimpleNamespace* CSimpleFilter::DefNamespaceL() |
|
180 { |
|
181 return CSimpleBaseDocument::DefNamespaceL(); |
|
182 } |
|
183 |
|
184 // ---------------------------------------------------------- |
|
185 // CSimpleFilter::HasContent |
|
186 // ---------------------------------------------------------- |
|
187 // |
|
188 TBool CSimpleFilter::HasContent() |
|
189 { |
|
190 return CSimpleBaseDocument::HasContent(); |
|
191 } |
|
192 |
|
193 // ---------------------------------------------------------- |
|
194 // CSimpleFilter::ContentUnicodeL |
|
195 // ---------------------------------------------------------- |
|
196 // |
|
197 HBufC* CSimpleFilter::ContentUnicodeL() |
|
198 { |
|
199 return CSimpleBaseDocument::ContentUnicodeL(); |
|
200 } |
|
201 |
|
202 // ---------------------------------------------------------- |
|
203 // CSimpleFilter::SetContentUnicodeL |
|
204 // ---------------------------------------------------------- |
|
205 // |
|
206 void CSimpleFilter::SetContentUnicodeL( const TDesC& aContent ) |
|
207 { |
|
208 CSimpleBaseDocument::SetContentUnicodeL( aContent ); |
|
209 } |
|
210 |
|
211 // ---------------------------------------------------------- |
|
212 // CSimpleFilter::SimpleElementsL |
|
213 // ---------------------------------------------------------- |
|
214 // |
|
215 TInt CSimpleFilter::SimpleElementsL( RPointerArray<MSimpleElement>& aElementArray ) |
|
216 { |
|
217 return CSimpleBaseDocument::SimpleElementsL( aElementArray ); |
|
218 } |
|
219 |
|
220 // ---------------------------------------------------------- |
|
221 // CSimpleFilter::AttrValueLC |
|
222 // ---------------------------------------------------------- |
|
223 // |
|
224 HBufC* CSimpleFilter::AttrValueLC( const TDesC8& aName ) |
|
225 { |
|
226 return CSimpleBaseDocument::AttrValueLC( aName ); |
|
227 } |
|
228 |
|
229 // ---------------------------------------------------------- |
|
230 // CSimpleFilter::AttrValue |
|
231 // ---------------------------------------------------------- |
|
232 // |
|
233 const TDesC8* CSimpleFilter::AttrValue( const TDesC8& aName ) |
|
234 { |
|
235 return CSimpleBaseDocument::AttrValue( aName ); |
|
236 } |
|
237 |
|
238 // ---------------------------------------------------------- |
|
239 // CSimpleFilter::AddAttrL |
|
240 // ---------------------------------------------------------- |
|
241 // |
|
242 void CSimpleFilter::AddAttrL( const TDesC8& aName, const TDesC& aValue ) |
|
243 { |
|
244 CSimpleBaseDocument::AddAttrL( aName, aValue ); |
|
245 } |
|
246 |
|
247 // ---------------------------------------------------------- |
|
248 // CSimpleFilter::SimpleAttributesL |
|
249 // ---------------------------------------------------------- |
|
250 // |
|
251 TInt CSimpleFilter::SimpleAttributesL( RPointerArray<MSimpleAttribute>& aArray ) |
|
252 { |
|
253 return CSimpleBaseDocument::SimpleAttributesL( aArray ); |
|
254 } |
|
255 |
|
256 // ---------------------------------------------------------- |
|
257 // CSimpleFilter::SimpleParentL |
|
258 // ---------------------------------------------------------- |
|
259 // |
|
260 MSimpleElement* CSimpleFilter::SimpleParentL() |
|
261 { |
|
262 return CSimpleBaseDocument::SimpleParentL( ); |
|
263 } |
|
264 |
|
265 // ---------------------------------------------------------- |
|
266 // CSimpleFilter::DetachSimpleL |
|
267 // ---------------------------------------------------------- |
|
268 // |
|
269 void CSimpleFilter::DetachSimpleL() |
|
270 { |
|
271 User::Leave( KErrNotFound ); |
|
272 } |
|
273 |
|
274 // ---------------------------------------------------------- |
|
275 // CSimpleFilter::AddSimpleElementL |
|
276 // ---------------------------------------------------------- |
|
277 // |
|
278 MSimpleElement* CSimpleFilter::AddSimpleElementL( |
|
279 const TDesC8& aNsUri, |
|
280 const TDesC8& aLocalName ) |
|
281 { |
|
282 return CSimpleBaseDocument::AddSimpleElementL( aNsUri, aLocalName ); |
|
283 } |
|
284 |
|
285 // ---------------------------------------------------------- |
|
286 // CSimpleFilter::AddSimpleElementL |
|
287 // ---------------------------------------------------------- |
|
288 // |
|
289 MSimpleElement* CSimpleFilter::AddSimpleElementL( |
|
290 const TDesC8& aLocalName ) |
|
291 { |
|
292 return CSimpleBaseDocument::AddSimpleElementL( aLocalName ); |
|
293 } |
|
294 |
|
295 // ---------------------------------------------------------- |
|
296 // CSimpleFilter::RemoveSimpleElement |
|
297 // ---------------------------------------------------------- |
|
298 // |
|
299 void CSimpleFilter::RemoveSimpleElement( |
|
300 const TDesC8& aNsUri, |
|
301 const TDesC8& aLocalName ) |
|
302 { |
|
303 CSimpleBaseDocument::RemoveSimpleElement( aNsUri, aLocalName ); |
|
304 } |
|
305 |
|
306 |
|
307 |
|
308 |