|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 #include <s32strm.h> // RWriteStream |
|
29 #include <SenXmlReader.h> |
|
30 #include "senlayeredtransportproperties.h" |
|
31 #include <SenTransportProperties.h> |
|
32 #include "senpropertieselement.h" // private: Utils\inc |
|
33 #include "senpropertiesfragment.h" // private: Utils\inc |
|
34 #include "senxmldebug.h" |
|
35 |
|
36 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL() |
|
37 { |
|
38 CSenLayeredTransportProperties* pNew = NewLC(); |
|
39 CleanupStack::Pop(); // pNew |
|
40 return pNew; |
|
41 } |
|
42 |
|
43 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC() |
|
44 { |
|
45 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
46 CleanupStack::PushL(pNew); |
|
47 |
|
48 // omit parsing by passing zero-length descriptor |
|
49 pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, |
|
50 KNullDesC8, |
|
51 NULL); |
|
52 return pNew; |
|
53 } |
|
54 |
|
55 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const TDesC8& aXmlUtf8, |
|
56 CSenXmlReader& aParser) |
|
57 { |
|
58 CSenLayeredTransportProperties* pNew = NewLC(aXmlUtf8, aParser); |
|
59 CleanupStack::Pop(); // pNew |
|
60 return pNew; |
|
61 } |
|
62 |
|
63 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const TDesC8& aXmlUtf8, |
|
64 CSenXmlReader& aParser) |
|
65 { |
|
66 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
67 CleanupStack::PushL(pNew); |
|
68 |
|
69 // parse the XML document descriptor into DOM fragment |
|
70 pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, |
|
71 aXmlUtf8, |
|
72 &aParser); |
|
73 return pNew; |
|
74 } |
|
75 |
|
76 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const CSenElement& aElement) |
|
77 { |
|
78 CSenLayeredTransportProperties* pNew = NewLC(aElement); |
|
79 CleanupStack::Pop(); // pNew |
|
80 return pNew; |
|
81 } |
|
82 |
|
83 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const CSenElement& aElement) |
|
84 { |
|
85 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
86 CleanupStack::PushL(pNew); |
|
87 |
|
88 // parse the XML document descriptor into DOM fragment |
|
89 pNew->BaseConstructL(aElement); |
|
90 return pNew; |
|
91 } |
|
92 |
|
93 |
|
94 // The RStringPool variants: |
|
95 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(RStringPool& aStringPool) |
|
96 { |
|
97 CSenLayeredTransportProperties* pNew = NewLC(aStringPool); |
|
98 CleanupStack::Pop(); // pNew |
|
99 return pNew; |
|
100 } |
|
101 |
|
102 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(RStringPool& aStringPool) |
|
103 { |
|
104 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
105 CleanupStack::PushL(pNew); |
|
106 |
|
107 // omit parsing by passing zero-length descriptor |
|
108 pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, |
|
109 KNullDesC8, |
|
110 NULL, |
|
111 &aStringPool); |
|
112 return pNew; |
|
113 } |
|
114 |
|
115 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const TDesC8& aXmlUtf8, |
|
116 CSenXmlReader& aParser, |
|
117 RStringPool& aStringPool) |
|
118 { |
|
119 CSenLayeredTransportProperties* pNew = NewLC(aXmlUtf8, aParser, aStringPool); |
|
120 CleanupStack::Pop(); // pNew |
|
121 return pNew; |
|
122 } |
|
123 |
|
124 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const TDesC8& aXmlUtf8, |
|
125 CSenXmlReader& aParser, |
|
126 RStringPool& aStringPool) |
|
127 { |
|
128 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
129 CleanupStack::PushL(pNew); |
|
130 |
|
131 // parse the XML document descriptor into DOM fragment |
|
132 pNew->BaseConstructL(KSenLayeredXmlPropertiesLocalname, |
|
133 aXmlUtf8, |
|
134 &aParser, |
|
135 &aStringPool); |
|
136 return pNew; |
|
137 } |
|
138 |
|
139 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewL(const CSenElement& aElement, |
|
140 RStringPool& aStringPool) |
|
141 { |
|
142 CSenLayeredTransportProperties* pNew = NewLC(aElement, aStringPool); |
|
143 CleanupStack::Pop(); // pNew |
|
144 return pNew; |
|
145 } |
|
146 |
|
147 EXPORT_C CSenLayeredTransportProperties* CSenLayeredTransportProperties::NewLC(const CSenElement& aElement, |
|
148 RStringPool& aStringPool) |
|
149 { |
|
150 CSenLayeredTransportProperties* pNew = new (ELeave) CSenLayeredTransportProperties; |
|
151 CleanupStack::PushL(pNew); |
|
152 |
|
153 // Pparse the XML document descriptor into DOM fragment |
|
154 pNew->BaseConstructL(aElement, &aStringPool); |
|
155 return pNew; |
|
156 } |
|
157 |
|
158 |
|
159 |
|
160 EXPORT_C void CSenLayeredTransportProperties::SetReader(CSenXmlReader& aReader) |
|
161 { |
|
162 CSenLayeredXmlProperties::SetReader(aReader); |
|
163 } |
|
164 |
|
165 EXPORT_C MSenProperties::TSenPropertiesClassType CSenLayeredTransportProperties::PropertiesClassType() |
|
166 { |
|
167 return ESenLayeredTransportProperties; |
|
168 } |
|
169 |
|
170 EXPORT_C void CSenLayeredTransportProperties::WriteToL(RWriteStream& aWriteStream) |
|
171 { |
|
172 CSenLayeredXmlProperties::WriteToL(aWriteStream); |
|
173 } |
|
174 |
|
175 EXPORT_C void CSenLayeredTransportProperties::ReadFromL(const TDesC8& aBuffer) |
|
176 { |
|
177 CSenLayeredXmlProperties::ReadFromL(aBuffer); |
|
178 } |
|
179 |
|
180 EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8L() |
|
181 { |
|
182 return CSenLayeredXmlProperties::AsUtf8L(); |
|
183 } |
|
184 |
|
185 EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8LC() |
|
186 { |
|
187 return CSenLayeredXmlProperties::AsUtf8LC(); |
|
188 } |
|
189 |
|
190 |
|
191 EXPORT_C TBool CSenLayeredTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass) |
|
192 { |
|
193 if ( aClass == MSenProperties::ESenLayeredTransportProperties ) |
|
194 { |
|
195 return ETrue; |
|
196 } |
|
197 else |
|
198 { |
|
199 return CSenLayeredXmlProperties::IsSafeToCast( aClass ); |
|
200 } |
|
201 } |
|
202 |
|
203 EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName, |
|
204 const TDesC8& aValue) |
|
205 { |
|
206 return CSenLayeredXmlProperties::SetPropertyL(aName, aValue); |
|
207 } |
|
208 |
|
209 EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, |
|
210 TPtrC8& aValue) |
|
211 { |
|
212 return CSenLayeredXmlProperties::PropertyL(aName, aValue); |
|
213 } |
|
214 |
|
215 |
|
216 EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, |
|
217 MSenProperty*& aValue, |
|
218 TSenPropertiesLayer aLayer) |
|
219 { |
|
220 return CSenLayeredXmlProperties::PropertyL(aName, aValue, aLayer); |
|
221 } |
|
222 |
|
223 EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, |
|
224 MSenProperty*& aValue) |
|
225 { |
|
226 return CSenLayeredXmlProperties::PropertyL(aName, aValue); |
|
227 } |
|
228 |
|
229 EXPORT_C TInt CSenLayeredTransportProperties::PropertiesByTypeL( |
|
230 const TDesC8& aType, |
|
231 RPointerArray<MSenProperty>& aArray) |
|
232 { |
|
233 return CSenLayeredXmlProperties::PropertiesByTypeL(aType, aArray); |
|
234 } |
|
235 |
|
236 EXPORT_C TInt CSenLayeredTransportProperties::SetIntPropertyL(const TDesC8& aName, |
|
237 const TInt aValue) |
|
238 { |
|
239 return CSenLayeredXmlProperties::SetIntPropertyL(aName, aValue); |
|
240 } |
|
241 |
|
242 EXPORT_C TInt CSenLayeredTransportProperties::IntPropertyL(const TDesC8& aName, |
|
243 TInt& aValue) |
|
244 { |
|
245 return CSenLayeredXmlProperties::IntPropertyL(aName, aValue); |
|
246 } |
|
247 |
|
248 EXPORT_C TInt CSenLayeredTransportProperties::SetBoolPropertyL(const TDesC8& aName, |
|
249 const TBool aValue) |
|
250 { |
|
251 return CSenLayeredXmlProperties::SetBoolPropertyL(aName, aValue); |
|
252 } |
|
253 |
|
254 EXPORT_C TInt CSenLayeredTransportProperties::BoolPropertyL(const TDesC8& aName, |
|
255 TBool& aValue) |
|
256 { |
|
257 return CSenLayeredXmlProperties::BoolPropertyL(aName, aValue); |
|
258 } |
|
259 |
|
260 EXPORT_C void CSenLayeredTransportProperties::WriteToL(RWriteStream& aWriteStream, TSenPropertiesLayer aLayer) |
|
261 { |
|
262 CSenLayeredXmlProperties::WriteToL(aWriteStream, aLayer); |
|
263 } |
|
264 |
|
265 EXPORT_C void CSenLayeredTransportProperties::ReadFromL(const TDesC8& aBuffer, TSenPropertiesLayer aLayer) |
|
266 { |
|
267 CSenLayeredXmlProperties::ReadFromL(aBuffer, aLayer); |
|
268 } |
|
269 |
|
270 EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8L(TSenPropertiesLayer aLayer) |
|
271 { |
|
272 return CSenLayeredXmlProperties::AsUtf8L(aLayer); |
|
273 } |
|
274 |
|
275 EXPORT_C HBufC8* CSenLayeredTransportProperties::AsUtf8LC(TSenPropertiesLayer aLayer) |
|
276 { |
|
277 return CSenLayeredXmlProperties::AsUtf8LC(aLayer); |
|
278 } |
|
279 |
|
280 EXPORT_C TInt CSenLayeredTransportProperties::ShrinkTo(TSenPropertiesLayer aLayer) |
|
281 { |
|
282 return CSenLayeredXmlProperties::ShrinkTo(aLayer); |
|
283 } |
|
284 |
|
285 EXPORT_C void CSenLayeredTransportProperties::ExpandToL(TSenPropertiesLayer aLayer) |
|
286 { |
|
287 CSenLayeredXmlProperties::ExpandToL(aLayer); |
|
288 } |
|
289 |
|
290 EXPORT_C MSenLayeredProperties::TSenPropertiesLayer CSenLayeredTransportProperties::TopLayer() |
|
291 { |
|
292 return CSenLayeredXmlProperties::TopLayer(); |
|
293 } |
|
294 |
|
295 EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName, |
|
296 const TDesC8& aValue, |
|
297 TSenPropertiesLayer aLayer) |
|
298 { |
|
299 return CSenLayeredXmlProperties::SetPropertyL(aName, aValue, aLayer); |
|
300 } |
|
301 |
|
302 EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, |
|
303 TPtrC8& aValue, |
|
304 TSenPropertiesLayer aLayer) |
|
305 { |
|
306 return CSenLayeredXmlProperties::PropertyL(aName, aValue, aLayer); |
|
307 } |
|
308 |
|
309 EXPORT_C TInt CSenLayeredTransportProperties::SetIntPropertyL(const TDesC8& aName, |
|
310 const TInt aValue, |
|
311 TSenPropertiesLayer aLayer) |
|
312 { |
|
313 return CSenLayeredXmlProperties::SetIntPropertyL(aName, aValue, aLayer); |
|
314 } |
|
315 |
|
316 EXPORT_C TInt CSenLayeredTransportProperties::IntPropertyL(const TDesC8& aName, |
|
317 TInt& aValue, |
|
318 TSenPropertiesLayer aLayer) |
|
319 { |
|
320 return CSenLayeredXmlProperties::IntPropertyL(aName, aValue, aLayer); |
|
321 } |
|
322 |
|
323 EXPORT_C TInt CSenLayeredTransportProperties::SetBoolPropertyL(const TDesC8& aName, |
|
324 const TBool aValue, |
|
325 TSenPropertiesLayer aLayer) |
|
326 { |
|
327 return CSenLayeredXmlProperties::SetBoolPropertyL(aName, aValue, aLayer); |
|
328 } |
|
329 |
|
330 EXPORT_C TInt CSenLayeredTransportProperties::BoolPropertyL(const TDesC8& aName, |
|
331 TBool& aValue, |
|
332 TSenPropertiesLayer aLayer) |
|
333 { |
|
334 return CSenLayeredXmlProperties::BoolPropertyL(aName, aValue, aLayer); |
|
335 } |
|
336 |
|
337 EXPORT_C TInt CSenLayeredTransportProperties::SetPropertyL(const TDesC8& aName, |
|
338 const TDesC8& aValue, |
|
339 const TDesC8& aType) |
|
340 { |
|
341 return CSenLayeredXmlProperties::SetPropertyL(aName, aValue, aType); |
|
342 } |
|
343 |
|
344 EXPORT_C TInt CSenLayeredTransportProperties::PropertyL(const TDesC8& aName, |
|
345 TPtrC8& aValue, |
|
346 TPtrC8& aType) |
|
347 { |
|
348 return CSenLayeredXmlProperties::PropertyL(aName, aValue, aType); |
|
349 } |
|
350 EXPORT_C MSenProperties* CSenLayeredTransportProperties::CloneL() const |
|
351 { |
|
352 CSenElement& element = ipFragment->AsElement(); |
|
353 |
|
354 CSenLayeredTransportProperties* pProperties = NewLC(element); |
|
355 if ( ipChildProperties ) |
|
356 { |
|
357 CSenLayeredTransportProperties* pChildProperties = |
|
358 (CSenLayeredTransportProperties*)ipChildProperties->CloneL(); |
|
359 pProperties->ipChildProperties = pChildProperties; |
|
360 } |
|
361 |
|
362 CleanupStack::Pop(pProperties); |
|
363 return pProperties; |
|
364 } |
|
365 |
|
366 EXPORT_C MSenProperties* CSenLayeredTransportProperties::Clone(TInt& aOkOrError) const |
|
367 { |
|
368 MSenProperties* pClone = NULL; |
|
369 TRAP( aOkOrError, pClone = CloneL(); ) |
|
370 return pClone; |
|
371 } |
|
372 |
|
373 EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aLocalname, |
|
374 const TDesC8& aXml, |
|
375 CSenXmlReader* aParser, |
|
376 RStringPool* aStringPool) |
|
377 { |
|
378 CSenLayeredXmlProperties::BaseConstructL(aLocalname, aXml, aParser, aStringPool); |
|
379 } |
|
380 |
|
381 EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aNamespace, |
|
382 const TDesC8& aLocalname, |
|
383 const TDesC8& aXml, |
|
384 CSenXmlReader* aParser, |
|
385 RStringPool* aStringPool) |
|
386 { |
|
387 CSenLayeredXmlProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser, aStringPool); |
|
388 } |
|
389 |
|
390 EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const TDesC8& aNamespace, |
|
391 const TDesC8& aLocalname, |
|
392 const TDesC8& aQualifiedName, |
|
393 const TDesC8& aXml, |
|
394 CSenXmlReader* aParser, |
|
395 RStringPool* aStringPool) |
|
396 { |
|
397 CSenLayeredXmlProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, |
|
398 aXml, aParser, aStringPool); |
|
399 } |
|
400 |
|
401 EXPORT_C void CSenLayeredTransportProperties::BaseConstructL(const CSenElement& aElement, |
|
402 RStringPool* aStringPool) |
|
403 { |
|
404 CSenLayeredXmlProperties::BaseConstructL(aElement, aStringPool); |
|
405 } |
|
406 |
|
407 EXPORT_C CSenLayeredTransportProperties::CSenLayeredTransportProperties() |
|
408 { |
|
409 } |
|
410 |
|
411 EXPORT_C CSenLayeredTransportProperties::~CSenLayeredTransportProperties() |
|
412 { |
|
413 } |
|
414 |
|
415 EXPORT_C TInt CSenLayeredTransportProperties::DeviceIDL(TPtrC8& aDeviceID) |
|
416 { |
|
417 return PropertyL(KDeviceIDLocalName, aDeviceID); |
|
418 } |
|
419 |
|
420 EXPORT_C TInt CSenLayeredTransportProperties::SoapActionL(TPtrC8& aAction) |
|
421 { |
|
422 return PropertyL(KSoapActionLocalName, aAction); |
|
423 } |
|
424 |
|
425 EXPORT_C TInt CSenLayeredTransportProperties::IapIdL(TUint32& aCurrentIapId) |
|
426 { |
|
427 TPtrC8 value; |
|
428 TInt retVal = PropertyL(KIapIdLocalName, value); |
|
429 |
|
430 if ( retVal == KErrNone ) |
|
431 { |
|
432 TLex8 lex(value); |
|
433 retVal = lex.Val(aCurrentIapId, EDecimal); |
|
434 } |
|
435 if(aCurrentIapId > 0) return retVal; |
|
436 else return KErrNotFound; |
|
437 } |
|
438 |
|
439 EXPORT_C TInt CSenLayeredTransportProperties::SnapIdL(TUint32& aCurrentSnapId) |
|
440 { |
|
441 TPtrC8 value; |
|
442 TInt retVal = PropertyL(KSnapIdLocalName, value); |
|
443 |
|
444 if ( retVal == KErrNone ) |
|
445 { |
|
446 TLex8 lex(value); |
|
447 retVal = lex.Val(aCurrentSnapId, EDecimal); |
|
448 } |
|
449 |
|
450 if(aCurrentSnapId > 0) return retVal; |
|
451 else return KErrNotFound; |
|
452 } |
|
453 |
|
454 EXPORT_C TInt CSenLayeredTransportProperties::ProxyPortL(TInt& aProxyPort) |
|
455 { |
|
456 TPtrC8 value; |
|
457 TInt retVal = PropertyL(KProxyPortLocalName, value); |
|
458 if ( retVal == KErrNone ) |
|
459 { |
|
460 TLex8 lex(value); |
|
461 TUint proxyPort; |
|
462 retVal = lex.Val(proxyPort, EDecimal); |
|
463 if ( retVal == KErrNone ) |
|
464 { |
|
465 aProxyPort = proxyPort; |
|
466 } |
|
467 } |
|
468 |
|
469 return retVal; |
|
470 } |
|
471 |
|
472 EXPORT_C TInt CSenLayeredTransportProperties::HeartbeatL(TInt& aHeartbeat) |
|
473 { |
|
474 return IntPropertyL(KSenConnectionHeartbeat, aHeartbeat); |
|
475 } |
|
476 |
|
477 EXPORT_C TInt CSenLayeredTransportProperties::MaxTimeToLiveL(TInt& aMax) |
|
478 { |
|
479 return IntPropertyL(KSenConnectionHeartbeatMaxTTL, aMax); |
|
480 } |
|
481 |
|
482 EXPORT_C TInt CSenLayeredTransportProperties::MinTimeToLiveL(TInt& aMin) |
|
483 { |
|
484 return IntPropertyL(KSenConnectionHeartbeatMinTTL, aMin); |
|
485 } |
|
486 |
|
487 EXPORT_C TInt CSenLayeredTransportProperties::ProxyHostL(TPtrC8& aProxyHost) |
|
488 { |
|
489 return PropertyL(KProxyHostLocalName, aProxyHost); |
|
490 } |
|
491 |
|
492 EXPORT_C TInt CSenLayeredTransportProperties::ProxyUsageL(TBool& aValue) |
|
493 { |
|
494 return BoolPropertyL(KProxyUsageLocalName, aValue); |
|
495 } |
|
496 |
|
497 EXPORT_C TInt CSenLayeredTransportProperties::IAPDialogL(TBool& aValue) |
|
498 { |
|
499 return BoolPropertyL(KSenIAPDoNotPrompt, aValue); |
|
500 } |
|
501 |
|
502 EXPORT_C TInt CSenLayeredTransportProperties::SnapDialogL(TBool& aValue) |
|
503 { |
|
504 return BoolPropertyL(KSenSNAPDoNotPrompt, aValue); |
|
505 } |
|
506 EXPORT_C TInt CSenLayeredTransportProperties::UserAgentL(TPtrC8& aUserAgent) |
|
507 { |
|
508 return PropertyL(KUserAgentLocalName, aUserAgent); |
|
509 } |
|
510 EXPORT_C TInt CSenLayeredTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder) |
|
511 { |
|
512 return PropertyL(KDownloadFolderLocalName, aDownloadFolder); |
|
513 } |
|
514 EXPORT_C TInt CSenLayeredTransportProperties::SetMaxRetryTTLL(TInt aMaxRetryTTL) |
|
515 { |
|
516 return SetIntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL ); |
|
517 } |
|
518 |
|
519 EXPORT_C TInt CSenLayeredTransportProperties::MaxRetryTTLL(TInt& aMaxRetryTTL) |
|
520 { |
|
521 return IntPropertyL( KSenConnectionRetryMaxTTL, aMaxRetryTTL ); |
|
522 } |
|
523 |
|
524 EXPORT_C TInt CSenLayeredTransportProperties::SetMinRetryTTLL(TInt aMinRetryTTL) |
|
525 { |
|
526 return SetIntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL ); |
|
527 } |
|
528 |
|
529 EXPORT_C TInt CSenLayeredTransportProperties::MinRetryTTLL(TInt& aMinRetryTTL) |
|
530 { |
|
531 return IntPropertyL( KSenConnectionRetryMinTTL, aMinRetryTTL ); |
|
532 } |
|
533 |
|
534 EXPORT_C TInt CSenLayeredTransportProperties::SetRetryDeltaTimeoutL(TInt aTimeout) |
|
535 { |
|
536 return SetIntPropertyL( KSenConnectionRetryDelta, aTimeout ); |
|
537 } |
|
538 |
|
539 EXPORT_C TInt CSenLayeredTransportProperties::RetryDeltaTimeoutL(TInt& aTimeout) |
|
540 { |
|
541 return IntPropertyL( KSenConnectionRetryDelta, aTimeout ); |
|
542 } |
|
543 |
|
544 |
|
545 |
|
546 EXPORT_C TInt CSenLayeredTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName) |
|
547 { |
|
548 _LIT8(KAttachment,"Attachment"); |
|
549 TPtrC8 pFileAttachments; |
|
550 TInt err(KErrNone); |
|
551 err = PropertyL(KFileAttachmentsLocalName,pFileAttachments); |
|
552 if (err!=KErrNone) |
|
553 { |
|
554 return err; |
|
555 } |
|
556 else |
|
557 { |
|
558 CSenXmlReader* reader = CSenXmlReader::NewL(KXmlParserMimeType); // use libxml2 sax parser |
|
559 CleanupStack::PushL(reader); |
|
560 CSenDomFragment* pFragment = CSenDomFragment::NewL(); |
|
561 CleanupStack::PushL(pFragment); |
|
562 pFragment->SetReader(*reader); |
|
563 pFragment->BuildFrom(pFileAttachments); |
|
564 HBufC8* pLocalName = HBufC8::NewLC(KAttachment().Length()+aCid.Length()); |
|
565 TPtr8 localNameDes = pLocalName->Des(); |
|
566 localNameDes.Append(KAttachment); |
|
567 localNameDes.Append(aCid); |
|
568 CSenElement* pElement = pFragment->AsElement().Element(*pLocalName); |
|
569 if(pElement) |
|
570 { |
|
571 if (aFileName) |
|
572 { |
|
573 delete aFileName; |
|
574 aFileName = NULL; |
|
575 } |
|
576 aFileName = HBufC8::NewL(pElement->Content().Length()); |
|
577 TPtr8 fileNameDes = aFileName->Des(); //CodeScannerWarnings |
|
578 fileNameDes.Append(pElement->Content()); |
|
579 CleanupStack::PopAndDestroy(pLocalName); |
|
580 CleanupStack::PopAndDestroy(pFragment); |
|
581 CleanupStack::PopAndDestroy(reader); |
|
582 return KErrNone; |
|
583 } |
|
584 else |
|
585 { |
|
586 CleanupStack::PopAndDestroy(pLocalName); |
|
587 CleanupStack::PopAndDestroy(pFragment); |
|
588 CleanupStack::PopAndDestroy(reader); |
|
589 return KErrNotFound; |
|
590 } |
|
591 } |
|
592 } |
|
593 |
|
594 EXPORT_C TInt CSenLayeredTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace) |
|
595 { |
|
596 return PropertyL(KMwsNamespaceLocalName, aMwsNamespace); |
|
597 } |
|
598 // END OF FILE |
|
599 |
|
600 |