|
1 /* |
|
2 * Copyright (c) 2004 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: WV Client Info implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "CPEngWVAttributeConstructBase.h" |
|
20 #include "CPEngWVAttributeModelBase.h" |
|
21 #include "CPEngWVClientInfoConstruct.h" |
|
22 #include "PEngWVAttributeModelDataHelper.h" |
|
23 #include "PresenceAttributeDefValueCRKeys.h" |
|
24 |
|
25 |
|
26 #include "MPEngXMLSerializer.h" |
|
27 #include "MPEngXMLParser.h" |
|
28 |
|
29 #include <MPEngPresenceAttrModel2.h> |
|
30 #include <E32Base.h> |
|
31 #include <S32Strm.h> |
|
32 #include <centralrepository.h> |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 // DATA TYPES |
|
38 /** |
|
39 * Client Info CSP name table, |
|
40 * |
|
41 * @since 3.0 |
|
42 */ |
|
43 const TWVCspAttributeNameEntry KClientInfoCspNameTable[] = |
|
44 { |
|
45 { |
|
46 EWVCspV11, |
|
47 LIT_AS_DESC8_PTR( KClientInfoXMLTag ), |
|
48 LIT_AS_DESC8_PTR( KPresenceSubListAttributesNS ) |
|
49 }, |
|
50 { |
|
51 EWVCspV12, |
|
52 LIT_AS_DESC8_PTR( KClientInfoXMLTag ), |
|
53 LIT_AS_DESC8_PTR( KPresenceSubListAttributesNS_CSP12 ) |
|
54 } |
|
55 }; |
|
56 |
|
57 const TInt KClientInfoCspNameTableCount = sizeof( KClientInfoCspNameTable ) / sizeof( TWVCspAttributeNameEntry ); |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 /** |
|
63 * Implemention restriction for maximum device detail |
|
64 * field length. Used when streaming the device details. |
|
65 */ |
|
66 const TInt KDeviceDetailDynamicMaxLength = 512; |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 // =============== LOCAL HELPER FUNCTIONS =============== |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CenRepValueL() |
|
75 // Loads device detail value from CenRep. |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 HBufC* CenRepValueL( CRepository& aCenRep, TInt aId ) |
|
79 { |
|
80 HBufC* valueBuffer = HBufC::NewLC( KDeviceDetailDynamicMaxLength ); |
|
81 TPtr value( valueBuffer->Des() ); |
|
82 |
|
83 //CenRep load status can be ignored |
|
84 //If the value isn't found or it doesn't fit to max size buffer |
|
85 //==> empty value is used |
|
86 aCenRep.Get( aId, value ); |
|
87 |
|
88 HBufC* tmp = value.AllocL(); |
|
89 CleanupStack::PopAndDestroy( valueBuffer ); |
|
90 |
|
91 return tmp; |
|
92 } |
|
93 |
|
94 |
|
95 |
|
96 // =============== CPEngWVClientInfoConstruct MEMBER FUNCTIONS =============== |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CPEngWVClientInfoConstruct::NewL() |
|
100 // Two-phased constructor. |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 CPEngWVClientInfoConstruct* CPEngWVClientInfoConstruct::NewL( TPEngWVCspVersion aCurrentCspVer ) |
|
104 { |
|
105 CPEngWVClientInfoConstruct* self = new ( ELeave ) CPEngWVClientInfoConstruct( |
|
106 aCurrentCspVer ); |
|
107 |
|
108 CleanupStack::PushL( self ); |
|
109 self->ConstructL(); |
|
110 CleanupStack::Pop(); |
|
111 return self; |
|
112 } |
|
113 |
|
114 |
|
115 |
|
116 // Destructor |
|
117 CPEngWVClientInfoConstruct::~CPEngWVClientInfoConstruct() |
|
118 { |
|
119 delete iUserDeviceManufacturer; |
|
120 delete iUserDeviceModel; |
|
121 delete iUserClientProducer; |
|
122 delete iUserClientVersion; |
|
123 delete iUserClientLanguage; |
|
124 } |
|
125 |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CPEngWVClientInfoConstruct::CPEngWVClientInfoConstruct |
|
129 // C++ constructor can NOT contain any code, that |
|
130 // might leave. |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 CPEngWVClientInfoConstruct::CPEngWVClientInfoConstruct( TPEngWVCspVersion aCurrentCspVer ) |
|
134 : CPEngWVAttributeConstructBase( aCurrentCspVer, |
|
135 KClientInfoCspNameTable, |
|
136 KClientInfoCspNameTableCount ) |
|
137 { |
|
138 } |
|
139 |
|
140 |
|
141 // ----------------------------------------------------------------------------- |
|
142 // CPEngWVClientInfoConstruct::ConstructL() |
|
143 // Symbian 2nd phase constructor can leave. |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 void CPEngWVClientInfoConstruct::ConstructL() |
|
147 { |
|
148 CRepository* cenRep = CRepository::NewLC( KCRUIDPresenceAttributeDefValue ); |
|
149 |
|
150 iUserDeviceManufacturer = CenRepValueL( *cenRep, KPAWVClientInfoDevManufacturer ); |
|
151 iUserDeviceModel = CenRepValueL( *cenRep, KPAWVClientInfoModel ); |
|
152 |
|
153 iUserClientProducer = CenRepValueL( *cenRep, KPAWVClientInfoClientProducer ); |
|
154 |
|
155 iUserClientVersion = CenRepValueL( *cenRep, KPAWVClientInfoClientVersion ); |
|
156 iUserClientLanguage = CenRepValueL( *cenRep, KPAWVClientInfoLanguage ); |
|
157 |
|
158 CleanupStack::PopAndDestroy(); //cenRep |
|
159 } |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // CPEngWVClientInfoConstruct::NewAttributeInstanceLC() |
|
166 // ----------------------------------------------------------------------------- |
|
167 // |
|
168 MPEngPresenceAttrModelTypeImp* CPEngWVClientInfoConstruct::NewAttributeInstanceLC( |
|
169 TBool aUserOwnAttribute ) const |
|
170 { |
|
171 CPEngWVClientInfoModel* model = new ( ELeave ) CPEngWVClientInfoModel( |
|
172 *this, |
|
173 aUserOwnAttribute ); |
|
174 CleanupStack::PushL( model ); |
|
175 model->ResetDataL(); |
|
176 return model; |
|
177 } |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 // ================= CPEngWVClientInfoModel MEMBER FUNCTIONS ================= |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // CPEngWVClientInfoConstruct::CPEngWVClientInfoConstruct::CPEngWVClientInfoModel |
|
186 // C++ constructor can NOT contain any code, that |
|
187 // might leave. |
|
188 // ----------------------------------------------------------------------------- |
|
189 // |
|
190 CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::CPEngWVClientInfoModel( |
|
191 const CPEngWVClientInfoConstruct& aConstructor, |
|
192 TBool aUserOwnAttribute ) |
|
193 : CPEngWVAttributeModelBase( aUserOwnAttribute ), |
|
194 iConstructor( aConstructor ) |
|
195 { |
|
196 } |
|
197 |
|
198 |
|
199 // Destructor |
|
200 CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::~CPEngWVClientInfoModel() |
|
201 { |
|
202 delete iDeviceManufacturer; |
|
203 delete iClientProducer; |
|
204 delete iDeviceModel; |
|
205 delete iClientVersion; |
|
206 delete iClientLanguage; |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::GetData() |
|
212 // ----------------------------------------------------------------------------- |
|
213 // |
|
214 TBool CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::GetData( TInt* aIntData, |
|
215 TPtrC8* /*a8Data*/, |
|
216 TPtrC16* a16Data, |
|
217 TInt aField, |
|
218 TInt aGroup ) const |
|
219 { |
|
220 TBool handled = EFalse; |
|
221 |
|
222 if ( aGroup == KPEngDefaultAttrValueGroup ) |
|
223 { |
|
224 if ( aIntData && ( aField == EPEngCliInfDeviceType ) ) |
|
225 { |
|
226 *aIntData = iDeviceType; |
|
227 handled = ETrue; |
|
228 } |
|
229 |
|
230 |
|
231 else if ( a16Data ) |
|
232 { |
|
233 switch ( aField ) //from TPEngWVClientInfoDesC16Fields |
|
234 { |
|
235 case EPEngCliInfDeviceManufacturer: |
|
236 { |
|
237 a16Data->Set( *iDeviceManufacturer ); |
|
238 handled = ETrue; |
|
239 break; |
|
240 } |
|
241 |
|
242 case EPEngCliInfClientProducer: |
|
243 { |
|
244 a16Data->Set( *iClientProducer ); |
|
245 handled = ETrue; |
|
246 break; |
|
247 } |
|
248 |
|
249 case EPEngCliInfDeviceModel: |
|
250 { |
|
251 a16Data->Set( *iDeviceModel ); |
|
252 handled = ETrue; |
|
253 break; |
|
254 } |
|
255 |
|
256 case EPEngCliInfClientVersion: |
|
257 { |
|
258 a16Data->Set( *iClientVersion ); |
|
259 handled = ETrue; |
|
260 break; |
|
261 } |
|
262 |
|
263 case EPEngCliInfClientLanguage: |
|
264 { |
|
265 a16Data->Set( *iClientLanguage ); |
|
266 handled = ETrue; |
|
267 break; |
|
268 } |
|
269 }; |
|
270 } |
|
271 } |
|
272 |
|
273 return handled; |
|
274 } |
|
275 |
|
276 |
|
277 // ----------------------------------------------------------------------------- |
|
278 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::GetData() |
|
279 // ----------------------------------------------------------------------------- |
|
280 // |
|
281 TBool CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::SetDataL( TInt* /*aIntData*/, |
|
282 const TDesC8* /*a8Data*/, |
|
283 const TDesC16* a16Data, |
|
284 TInt aField, |
|
285 TInt aGroup ) |
|
286 { |
|
287 TBool handled = EFalse; |
|
288 |
|
289 if ( aGroup == KPEngDefaultAttrValueGroup ) |
|
290 { |
|
291 if ( a16Data ) |
|
292 { |
|
293 //check the data length |
|
294 if ( a16Data->Length() > KPEngMaxWVStatusTextLength ) |
|
295 { |
|
296 User::Leave( KErrArgument ); |
|
297 } |
|
298 |
|
299 switch ( aField ) //from TPEngWVClientInfoDesC16Fields |
|
300 { |
|
301 case EPEngCliInfDeviceManufacturer: |
|
302 { |
|
303 DoSetDescL( iDeviceManufacturer, *a16Data ); |
|
304 handled = ETrue; |
|
305 break; |
|
306 } |
|
307 |
|
308 case EPEngCliInfClientProducer: |
|
309 { |
|
310 DoSetDescL( iClientProducer, *a16Data ); |
|
311 handled = ETrue; |
|
312 break; |
|
313 } |
|
314 |
|
315 case EPEngCliInfDeviceModel: |
|
316 { |
|
317 DoSetDescL( iDeviceModel, *a16Data ); |
|
318 handled = ETrue; |
|
319 break; |
|
320 } |
|
321 |
|
322 case EPEngCliInfClientVersion: |
|
323 { |
|
324 DoSetDescL( iClientVersion, *a16Data ); |
|
325 handled = ETrue; |
|
326 break; |
|
327 } |
|
328 |
|
329 case EPEngCliInfClientLanguage: |
|
330 { |
|
331 DoSetDescL( iClientLanguage, *a16Data ); |
|
332 handled = ETrue; |
|
333 break; |
|
334 } |
|
335 }; |
|
336 } |
|
337 } |
|
338 |
|
339 return handled; |
|
340 } |
|
341 |
|
342 |
|
343 // ----------------------------------------------------------------------------- |
|
344 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::EncodeDataToXmlL() |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 void CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::EncodeDataToXmlL( |
|
348 MPEngXMLSerializer& aSerializer ) const |
|
349 { |
|
350 // Client type |
|
351 aSerializer.StartTagL( KClientTypeXMLTag ); |
|
352 { |
|
353 switch ( iDeviceType ) |
|
354 { |
|
355 case EPEngCliDevTypeMobilePhone: |
|
356 { |
|
357 aSerializer.RawValueL( KClientTypeMobilePhoneXMLTag ); |
|
358 break; |
|
359 } |
|
360 case EPEngCliDevTypeComputer: |
|
361 { |
|
362 aSerializer.RawValueL( KClientTypeComputerXMLTag ); |
|
363 break; |
|
364 } |
|
365 case EPEngCliDevTypePDA: |
|
366 { |
|
367 aSerializer.RawValueL( KClientTypePDAXMLTag ); |
|
368 break; |
|
369 } |
|
370 case EPEngCliDevTypeCLI: |
|
371 { |
|
372 aSerializer.RawValueL( KClientTypeCLIXMLTag ); |
|
373 break; |
|
374 } |
|
375 case EPEngCliDevTypeOther: |
|
376 default: |
|
377 { |
|
378 aSerializer.RawValueL( KClientTypeOtherXMLTag ); |
|
379 break; |
|
380 } |
|
381 } |
|
382 } |
|
383 aSerializer.EndTagL( KClientTypeXMLTag ); |
|
384 |
|
385 // Device manufacturer |
|
386 aSerializer.StartTagL( KDevManufacturerXMLTag ) |
|
387 .UnicodeTextL( *iDeviceManufacturer ) |
|
388 .EndTagL( KDevManufacturerXMLTag ); |
|
389 |
|
390 // Client Producer |
|
391 aSerializer.StartTagL( KClientProducerXMLTag ) |
|
392 .UnicodeTextL( *iClientProducer ) |
|
393 .EndTagL( KClientProducerXMLTag ); |
|
394 |
|
395 // Device Model |
|
396 aSerializer.StartTagL( KDeviceModelXMLTag ) |
|
397 .UnicodeTextL( *iDeviceModel ) |
|
398 .EndTagL( KDeviceModelXMLTag ); |
|
399 |
|
400 // Client version |
|
401 aSerializer.StartTagL( KClientVersionXMLTag ) |
|
402 .UnicodeTextL( *iClientVersion ) |
|
403 .EndTagL( KClientVersionXMLTag ); |
|
404 |
|
405 // Client language |
|
406 // Client languages are actually enumerations |
|
407 // ==> empty string in XML not allowed |
|
408 if ( iClientLanguage->Length() > 0 ) |
|
409 { |
|
410 aSerializer.StartTagL( KClientLanguageXMLTag ) |
|
411 .UnicodeTextL( *iClientLanguage ) |
|
412 .EndTagL( KClientLanguageXMLTag ); |
|
413 } |
|
414 } |
|
415 |
|
416 |
|
417 |
|
418 // ----------------------------------------------------------------------------- |
|
419 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::DecodeDataFromXmlL() |
|
420 // ----------------------------------------------------------------------------- |
|
421 // |
|
422 void CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::DecodeDataFromXmlL( |
|
423 MPEngXMLParser& aParser, |
|
424 const TDesC8& aValueBlock ) |
|
425 { |
|
426 // parse client type first |
|
427 if ( aParser.DecodeL( aValueBlock, KClientTypeXMLTag, EFalse ) ) |
|
428 { |
|
429 if ( aParser.ResultL().CompareF( KClientTypeMobilePhoneXMLTag ) == 0 ) |
|
430 { |
|
431 iDeviceType = EPEngCliDevTypeMobilePhone; |
|
432 } |
|
433 else if ( aParser.ResultL().CompareF( KClientTypeComputerXMLTag ) == 0 ) |
|
434 { |
|
435 iDeviceType = EPEngCliDevTypeComputer; |
|
436 } |
|
437 else if ( aParser.ResultL().CompareF( KClientTypePDAXMLTag ) == 0 ) |
|
438 { |
|
439 iDeviceType = EPEngCliDevTypePDA; |
|
440 } |
|
441 else if ( aParser.ResultL().CompareF( KClientTypeCLIXMLTag ) == 0 ) |
|
442 { |
|
443 iDeviceType = EPEngCliDevTypeCLI; |
|
444 } |
|
445 else |
|
446 { |
|
447 iDeviceType = EPEngCliDevTypeOther; |
|
448 } |
|
449 } |
|
450 |
|
451 // Parse device manufacturer |
|
452 if ( aParser.DecodeL( aValueBlock, KDevManufacturerXMLTag, EFalse ) ) |
|
453 { |
|
454 HBufC* tmpData = aParser.ResultAsUnicodeTextL(); |
|
455 delete iDeviceManufacturer; |
|
456 iDeviceManufacturer = tmpData; |
|
457 } |
|
458 |
|
459 // Parse client producer |
|
460 if ( aParser.DecodeL( aValueBlock, KClientProducerXMLTag, EFalse ) ) |
|
461 { |
|
462 HBufC* tmpData = aParser.ResultAsUnicodeTextL(); |
|
463 delete iClientProducer; |
|
464 iClientProducer = tmpData; |
|
465 } |
|
466 |
|
467 // Parse device model |
|
468 if ( aParser.DecodeL( aValueBlock, KDeviceModelXMLTag, EFalse ) ) |
|
469 { |
|
470 HBufC* tmpData = aParser.ResultAsUnicodeTextL(); |
|
471 delete iDeviceModel; |
|
472 iDeviceModel = tmpData; |
|
473 } |
|
474 |
|
475 // Parse client version |
|
476 if ( aParser.DecodeL( aValueBlock, KClientVersionXMLTag, EFalse ) ) |
|
477 { |
|
478 HBufC* tmpData = aParser.ResultAsUnicodeTextL(); |
|
479 delete iClientVersion; |
|
480 iClientVersion = tmpData; |
|
481 } |
|
482 |
|
483 // Parse client language |
|
484 if ( aParser.DecodeL( aValueBlock, KClientLanguageXMLTag, EFalse ) ) |
|
485 { |
|
486 HBufC* tmpData = aParser.ResultAsUnicodeTextL(); |
|
487 delete iClientLanguage; |
|
488 iClientLanguage = tmpData; |
|
489 } |
|
490 } |
|
491 |
|
492 |
|
493 |
|
494 // ----------------------------------------------------------------------------- |
|
495 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::ResetDataL() |
|
496 // ----------------------------------------------------------------------------- |
|
497 // |
|
498 void CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::ResetDataL() |
|
499 { |
|
500 HBufC* tmpDeviceManufacturer; |
|
501 HBufC* tmpDeviceModel; |
|
502 HBufC* tmpClientProducer; |
|
503 HBufC* tmpClientVersion; |
|
504 HBufC* tmpClientLanguage; |
|
505 |
|
506 |
|
507 if ( iUserOwnModel ) |
|
508 { |
|
509 tmpDeviceManufacturer = iConstructor.iUserDeviceManufacturer->AllocLC(); |
|
510 tmpDeviceModel = iConstructor.iUserDeviceModel->AllocLC(); |
|
511 tmpClientProducer = iConstructor.iUserClientProducer->AllocLC(); |
|
512 tmpClientVersion = iConstructor.iUserClientVersion->AllocLC(); |
|
513 tmpClientLanguage = iConstructor.iUserClientLanguage->AllocLC(); |
|
514 iDeviceType = EPEngCliDevTypeMobilePhone; |
|
515 } |
|
516 else |
|
517 { |
|
518 tmpDeviceManufacturer = HBufC::NewLC( 0 ); |
|
519 tmpDeviceModel = HBufC::NewLC( 0 ); |
|
520 tmpClientProducer = HBufC::NewLC( 0 ); |
|
521 tmpClientVersion = HBufC::NewLC( 0 ); |
|
522 tmpClientLanguage = HBufC::NewLC( 0 ); |
|
523 iDeviceType = EPEngCliDevTypeOther; |
|
524 } |
|
525 |
|
526 |
|
527 delete iDeviceManufacturer; |
|
528 delete iClientProducer; |
|
529 delete iDeviceModel; |
|
530 delete iClientVersion; |
|
531 delete iClientLanguage; |
|
532 |
|
533 |
|
534 |
|
535 iClientLanguage = tmpClientLanguage; |
|
536 CleanupStack::Pop(); //tmpClientLanguage |
|
537 |
|
538 iClientVersion = tmpClientVersion; |
|
539 CleanupStack::Pop(); //tmpClientVersion |
|
540 |
|
541 iDeviceModel = tmpDeviceModel; |
|
542 CleanupStack::Pop(); //tmpDeviceModel |
|
543 |
|
544 iClientProducer = tmpClientProducer; |
|
545 CleanupStack::Pop(); //tmpClientProducer |
|
546 |
|
547 iDeviceManufacturer = tmpDeviceManufacturer; |
|
548 CleanupStack::Pop(); //tmpDeviceManufacturer |
|
549 } |
|
550 |
|
551 |
|
552 // ----------------------------------------------------------------------------- |
|
553 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::DataExternalizeSize() |
|
554 // ----------------------------------------------------------------------------- |
|
555 // |
|
556 TInt CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::DataExternalizeSize() const |
|
557 { |
|
558 TInt size = 1; //iDeviceType is stored in one byte |
|
559 |
|
560 size += iDeviceManufacturer->Size(); |
|
561 size += 4; //4 bytes for descriptor length |
|
562 |
|
563 size += iClientProducer->Size(); |
|
564 size += 4; //4 bytes for descriptor length |
|
565 |
|
566 size += iDeviceModel->Size(); |
|
567 size += 4; //4 bytes for descriptor length |
|
568 |
|
569 size += iClientVersion->Size(); |
|
570 size += 4; //4 bytes for descriptor length |
|
571 |
|
572 size += iClientLanguage->Size(); |
|
573 size += 4; //4 bytes for descriptor length |
|
574 |
|
575 return size; |
|
576 } |
|
577 |
|
578 |
|
579 |
|
580 // ----------------------------------------------------------------------------- |
|
581 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::ExternalizeDataL() |
|
582 // ----------------------------------------------------------------------------- |
|
583 // |
|
584 void CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::ExternalizeDataL( |
|
585 RWriteStream& aStream ) const |
|
586 { |
|
587 aStream.WriteInt8L( iDeviceType ); // device type |
|
588 |
|
589 aStream << iDeviceManufacturer->Left( KDeviceDetailDynamicMaxLength ); |
|
590 aStream << iClientProducer->Left( KDeviceDetailDynamicMaxLength ); |
|
591 aStream << iDeviceModel->Left( KDeviceDetailDynamicMaxLength ); |
|
592 aStream << iClientVersion->Left( KDeviceDetailDynamicMaxLength ); |
|
593 aStream << iClientLanguage->Left( KDeviceDetailDynamicMaxLength ); |
|
594 } |
|
595 |
|
596 |
|
597 // ----------------------------------------------------------------------------- |
|
598 // CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::InternalizeDataL() |
|
599 // ----------------------------------------------------------------------------- |
|
600 // |
|
601 void CPEngWVClientInfoConstruct::CPEngWVClientInfoModel::InternalizeDataL( |
|
602 RReadStream& aStream ) |
|
603 { |
|
604 iDeviceType = static_cast<TPEngWVCliInfDeviceTypeValues> ( aStream.ReadInt8L() ); |
|
605 |
|
606 HBufC* tmpDeviceManufacturer = HBufC::NewLC( aStream, KDeviceDetailDynamicMaxLength ); |
|
607 HBufC* tmpClientProducer = HBufC::NewLC( aStream, KDeviceDetailDynamicMaxLength ); |
|
608 HBufC* tmpDeviceModel = HBufC::NewLC( aStream, KDeviceDetailDynamicMaxLength ); |
|
609 HBufC* tmpClientVersion = HBufC::NewLC( aStream, KDeviceDetailDynamicMaxLength ); |
|
610 HBufC* tmpClientLanguage = HBufC::NewLC( aStream, KDeviceDetailDynamicMaxLength ); |
|
611 |
|
612 delete iDeviceManufacturer; |
|
613 delete iClientProducer; |
|
614 delete iDeviceModel; |
|
615 delete iClientVersion; |
|
616 delete iClientLanguage; |
|
617 |
|
618 iClientLanguage = tmpClientLanguage; |
|
619 CleanupStack::Pop(); //tmpClientLanguage |
|
620 |
|
621 iClientVersion = tmpClientVersion; |
|
622 CleanupStack::Pop(); //tmpClientVersion |
|
623 |
|
624 iDeviceModel = tmpDeviceModel; |
|
625 CleanupStack::Pop(); //tmpDeviceModel |
|
626 |
|
627 iClientProducer = tmpClientProducer; |
|
628 CleanupStack::Pop(); //tmpClientProducer |
|
629 |
|
630 iDeviceManufacturer = tmpDeviceManufacturer; |
|
631 CleanupStack::Pop(); //tmpDeviceManufacturer |
|
632 } |
|
633 |
|
634 |
|
635 |
|
636 // End of File |
|
637 |
|
638 |