1 /* |
|
2 * Copyright (c) 2002-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: Encapsulates the message data for sending services. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <s32file.h> |
|
22 #include <txtrich.h> |
|
23 #include <eikenv.h> |
|
24 #include <s32mem.h> |
|
25 #include <s32std.h> |
|
26 #include <msvstore.h> |
|
27 #include <SendUiConsts.h> |
|
28 |
|
29 #ifdef RD_MULTIPLE_DRIVE |
|
30 #include <driveinfo.h> |
|
31 #endif |
|
32 |
|
33 #include "CMessageDataImpl.h" |
|
34 #include "CSendUiAttachment.h" |
|
35 |
|
36 // CONSTANTS |
|
37 const TInt KMDArrayGranularity = 1; |
|
38 const TInt KMDRichTextStoreGranularity = 512; |
|
39 |
|
40 _LIT( KSenduiTempFile, ":\\system\\temp\\sendui\\%x_%x"); |
|
41 |
|
42 // ============================ MEMBER FUNCTIONS =============================== |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CMessageDataImpl::CMessageDataImpl |
|
46 // C++ default constructor can NOT contain any code, that |
|
47 // might leave. |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CMessageDataImpl::CMessageDataImpl() |
|
51 : iDataType(KSenduiMsgDataBase) |
|
52 { |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CMessageDataImpl::ConstructL |
|
57 // Symbian 2nd phase constructor can leave. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 void CMessageDataImpl::ConstructL() |
|
61 { |
|
62 iAttachments = new ( ELeave ) CDesCArrayFlat( KMDArrayGranularity ); |
|
63 iToAddresses = new ( ELeave ) CMessageAddressArray( KMDArrayGranularity ); |
|
64 iCcAddresses = new ( ELeave ) CMessageAddressArray( KMDArrayGranularity ); |
|
65 iBccAddresses = new ( ELeave ) CMessageAddressArray( KMDArrayGranularity ); |
|
66 |
|
67 CEikonEnv* eikonEnv = CEikonEnv::Static(); |
|
68 iBodyText = CRichText::NewL( eikonEnv->SystemParaFormatLayerL(), |
|
69 eikonEnv->SystemCharFormatLayerL() ); |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CMessageDataImpl::NewL |
|
74 // Two-phased constructor. |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 CMessageDataImpl* CMessageDataImpl::NewL() |
|
78 { |
|
79 CMessageDataImpl* self = CMessageDataImpl::NewLC(); |
|
80 |
|
81 CleanupStack::Pop( self ); |
|
82 |
|
83 return self; |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // CMessageDataImpl::NewLC |
|
88 // Two-phased constructor. |
|
89 // --------------------------------------------------------- |
|
90 // |
|
91 CMessageDataImpl* CMessageDataImpl::NewLC() |
|
92 { |
|
93 CMessageDataImpl* self = new (ELeave) CMessageDataImpl; |
|
94 |
|
95 CleanupStack::PushL( self ); |
|
96 self->ConstructL(); |
|
97 |
|
98 return self; |
|
99 } |
|
100 |
|
101 |
|
102 // Destructor |
|
103 CMessageDataImpl::~CMessageDataImpl() |
|
104 { |
|
105 TInt i = 0; |
|
106 |
|
107 delete iSubject; |
|
108 delete iAttachments; |
|
109 delete iBodyText; |
|
110 delete iOpaqueData; |
|
111 |
|
112 if ( iToAddresses ) |
|
113 { |
|
114 iToAddresses->ResetAndDestroy(); |
|
115 delete iToAddresses; |
|
116 } |
|
117 |
|
118 if ( iCcAddresses ) |
|
119 { |
|
120 iCcAddresses->ResetAndDestroy(); |
|
121 delete iCcAddresses; |
|
122 } |
|
123 |
|
124 if ( iBccAddresses ) |
|
125 { |
|
126 iBccAddresses->ResetAndDestroy(); |
|
127 delete iBccAddresses; |
|
128 } |
|
129 |
|
130 for (i = 0; i < iAttachmentHandles.Count(); i++) |
|
131 { |
|
132 iAttachmentHandles[i].Close(); |
|
133 } |
|
134 iAttachmentHandles.Close(); |
|
135 } |
|
136 |
|
137 // ----------------------------------------------------------------------------- |
|
138 // CMessageDataImpl::SetSubjectL |
|
139 // Set message subject. |
|
140 // (other items were commented in a header). |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 void CMessageDataImpl::SetSubjectL( const TDesC* aSubject ) |
|
144 { |
|
145 delete iSubject; |
|
146 iSubject = NULL; |
|
147 |
|
148 if ( aSubject ) |
|
149 { |
|
150 iSubject = aSubject->AllocL(); |
|
151 } |
|
152 } |
|
153 |
|
154 // ----------------------------------------------------------------------------- |
|
155 // CMessageDataImpl::Subject |
|
156 // Returns message subject. |
|
157 // (other items were commented in a header). |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 const TPtrC CMessageDataImpl::Subject() const |
|
161 { |
|
162 return iSubject ? TPtrC( *iSubject ) : TPtrC(); |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CMessageDataImpl::AppendAttachmentL |
|
167 // Appends attachment file path to the array of attachment file paths. |
|
168 // (other items were commented in a header). |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 void CMessageDataImpl::AppendAttachmentL( const TDesC& aFileName ) |
|
172 { |
|
173 iAttachments->AppendL( aFileName ); |
|
174 } |
|
175 |
|
176 // ----------------------------------------------------------------------------- |
|
177 // CMessageDataImpl::AttachmentArray |
|
178 // Returns array of attachment file paths. |
|
179 // (other items were commented in a header). |
|
180 // ----------------------------------------------------------------------------- |
|
181 // |
|
182 const CDesCArray& CMessageDataImpl::AttachmentArray() const |
|
183 { |
|
184 return *iAttachments; |
|
185 } |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // CMessageDataImpl::ClearAttachmentArray |
|
189 // Clears the array of attachment file paths. |
|
190 // (other items were commented in a header). |
|
191 // ----------------------------------------------------------------------------- |
|
192 // |
|
193 void CMessageDataImpl::ClearAttachmentArray() |
|
194 { |
|
195 TInt i( iAttachmentHandles.Count() ); |
|
196 iAttachments->Reset(); |
|
197 |
|
198 while( i-- ) |
|
199 { |
|
200 iAttachmentHandles[i].Close(); |
|
201 } |
|
202 iAttachmentHandles.Reset(); |
|
203 } |
|
204 |
|
205 // ----------------------------------------------------------------------------- |
|
206 // CMessageDataImpl::AppendToAddressL |
|
207 // Encapsulates address and alias to CMessageAddress and adds to array. |
|
208 // (other items were commented in a header). |
|
209 // ----------------------------------------------------------------------------- |
|
210 // |
|
211 void CMessageDataImpl::AppendToAddressL( |
|
212 const TDesC& aAddress, |
|
213 const TDesC& aAlias) |
|
214 { |
|
215 CMessageAddress* messageAddress = CMessageAddress::NewLC(); |
|
216 |
|
217 messageAddress->SetAddressL( aAddress ); |
|
218 messageAddress->SetAliasL( aAlias ); |
|
219 |
|
220 iToAddresses->AppendL( messageAddress ); |
|
221 |
|
222 CleanupStack::Pop( messageAddress ); |
|
223 } |
|
224 |
|
225 // ----------------------------------------------------------------------------- |
|
226 // CMessageDataImpl::ToAddressArray |
|
227 // Returns array of addresses and aliases. |
|
228 // (other items were commented in a header). |
|
229 // ----------------------------------------------------------------------------- |
|
230 // |
|
231 const CMessageAddressArray& CMessageDataImpl::ToAddressArray() const |
|
232 { |
|
233 return *iToAddresses; |
|
234 } |
|
235 |
|
236 // ----------------------------------------------------------------------------- |
|
237 // CMessageDataImpl::AppendCcAddressL |
|
238 // Encapsulates CC address and alias to CMessageAddress and adds to array. |
|
239 // (other items were commented in a header). |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 void CMessageDataImpl::AppendCcAddressL( |
|
243 const TDesC& aCcAddress, |
|
244 const TDesC& aCcAlias) |
|
245 { |
|
246 CMessageAddress* messageAddress = CMessageAddress::NewLC(); |
|
247 |
|
248 messageAddress->SetAddressL( aCcAddress ); |
|
249 messageAddress->SetAliasL( aCcAlias ); |
|
250 |
|
251 iCcAddresses->AppendL( messageAddress ); |
|
252 |
|
253 CleanupStack::Pop( messageAddress ); |
|
254 } |
|
255 |
|
256 // ----------------------------------------------------------------------------- |
|
257 // CMessageDataImpl::CcAddressArray |
|
258 // Returns array of CC addresses and aliases. |
|
259 // (other items were commented in a header). |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 const CMessageAddressArray& CMessageDataImpl::CcAddressArray() const |
|
263 { |
|
264 return *iCcAddresses; |
|
265 } |
|
266 |
|
267 // ----------------------------------------------------------------------------- |
|
268 // CMessageDataImpl::AppendBccAddressL |
|
269 // Encapsulates Bcc address and alias to CMessageAddress and adds to array. |
|
270 // (other items were commented in a header). |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 void CMessageDataImpl::AppendBccAddressL( |
|
274 const TDesC& aBccAddress, |
|
275 const TDesC& aBccAlias) |
|
276 { |
|
277 CMessageAddress* messageAddress = CMessageAddress::NewLC(); |
|
278 |
|
279 messageAddress->SetAddressL( aBccAddress ); |
|
280 messageAddress->SetAliasL( aBccAlias ); |
|
281 |
|
282 iBccAddresses->AppendL( messageAddress ); |
|
283 |
|
284 CleanupStack::Pop( messageAddress ); |
|
285 } |
|
286 |
|
287 // ----------------------------------------------------------------------------- |
|
288 // CMessageDataImpl::BccAddressArray |
|
289 // Returns array of Bcc addresses and aliases. |
|
290 // (other items were commented in a header). |
|
291 // ----------------------------------------------------------------------------- |
|
292 // |
|
293 const CMessageAddressArray& CMessageDataImpl::BccAddressArray() const |
|
294 { |
|
295 return *iBccAddresses; |
|
296 } |
|
297 |
|
298 // ----------------------------------------------------------------------------- |
|
299 // CMessageDataImpl::SetBodyTextL |
|
300 // Set message body text. |
|
301 // (other items were commented in a header). |
|
302 // ----------------------------------------------------------------------------- |
|
303 // |
|
304 void CMessageDataImpl::SetBodyTextL( const CRichText* aBodyText ) |
|
305 { |
|
306 iBodyText->Reset(); |
|
307 |
|
308 if ( aBodyText ) |
|
309 { |
|
310 // Save and restore the rich text object |
|
311 CStreamStore* store = CBufStore::NewLC( KMDRichTextStoreGranularity ); |
|
312 |
|
313 TStreamId id = aBodyText->StoreL( *store ); |
|
314 iBodyText->RestoreL( *store, id ); |
|
315 |
|
316 CleanupStack::PopAndDestroy( store ); |
|
317 } |
|
318 } |
|
319 |
|
320 // ----------------------------------------------------------------------------- |
|
321 // CMessageDataImpl::BodyText |
|
322 // Returns message body text. |
|
323 // (other items were commented in a header). |
|
324 // ----------------------------------------------------------------------------- |
|
325 // |
|
326 const CRichText* CMessageDataImpl::BodyText() const |
|
327 { |
|
328 return iBodyText; |
|
329 } |
|
330 |
|
331 // ----------------------------------------------------------------------------- |
|
332 // CMessageDataImpl::AppendAttachmentHandleL |
|
333 // Appends attachment handle to the array of attachment handles. |
|
334 // (other items were commented in a header). |
|
335 // ----------------------------------------------------------------------------- |
|
336 // |
|
337 void CMessageDataImpl::AppendAttachmentHandleL( const RFile& aFileHandle ) |
|
338 { |
|
339 if ( !aFileHandle.SubSessionHandle() ) |
|
340 { |
|
341 User::Leave( KErrBadHandle ); |
|
342 } |
|
343 RFile tempHandle; |
|
344 tempHandle.Duplicate( aFileHandle ); |
|
345 CleanupClosePushL( tempHandle ); |
|
346 iAttachmentHandles.AppendL( tempHandle ); |
|
347 CleanupStack::Pop( ); |
|
348 } |
|
349 |
|
350 // ----------------------------------------------------------------------------- |
|
351 // CMessageDataImpl::AttachmentHandleArray |
|
352 // Returns array of attachment handles. |
|
353 // (other items were commented in a header). |
|
354 // ----------------------------------------------------------------------------- |
|
355 // |
|
356 const RArray<RFile>& CMessageDataImpl::AttachmentHandleArray() const |
|
357 { |
|
358 return iAttachmentHandles; |
|
359 } |
|
360 |
|
361 // ----------------------------------------------------------------------------- |
|
362 // CMessageDataImpl::DataType |
|
363 // Returns data type id. |
|
364 // (other items were commented in a header). |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 TUid CMessageDataImpl::DataType() const |
|
368 { |
|
369 return iDataType; |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // CMessageDataImpl::ClearAddresses |
|
374 // Clears all addressee arrays. |
|
375 // (other items were commented in a header). |
|
376 // ----------------------------------------------------------------------------- |
|
377 // |
|
378 void CMessageDataImpl::ClearAddresses() |
|
379 { |
|
380 iToAddresses->ResetAndDestroy(); |
|
381 iCcAddresses->ResetAndDestroy(); |
|
382 iBccAddresses->ResetAndDestroy(); |
|
383 } |
|
384 |
|
385 // --------------------------------------------------------- |
|
386 // CMessageDataImpl::ExternalizeL |
|
387 // |
|
388 // --------------------------------------------------------- |
|
389 // |
|
390 void CMessageDataImpl::ExternalizeL( RWriteStream& aStream ) const |
|
391 { |
|
392 aStream.WriteUint32L( iDataType.iUid ); |
|
393 |
|
394 TInt length(0); |
|
395 if ( iSubject ) |
|
396 { |
|
397 length = iSubject->Length(); |
|
398 } |
|
399 aStream.WriteUint32L( length); |
|
400 |
|
401 if ( length > 0) |
|
402 { |
|
403 aStream << iSubject->Des(); |
|
404 } |
|
405 |
|
406 // Store text to a file store |
|
407 |
|
408 length = 0; |
|
409 |
|
410 if ( iBodyText->DocumentLength() > 0 ) |
|
411 { |
|
412 TStreamId streamId(0); |
|
413 |
|
414 RFs& fs = CCoeEnv::Static()->FsSession(); |
|
415 CFileStore* theStore; |
|
416 TParse fileStoreName; |
|
417 |
|
418 HBufC* filenameBuf = HBufC::NewLC(KMaxFileName); |
|
419 TPtr fileName = filenameBuf->Des(); |
|
420 |
|
421 CreateTempPathL( fileName, fs ); |
|
422 |
|
423 length = fileName.Length(); |
|
424 aStream.WriteUint32L( length ); |
|
425 if (length) |
|
426 { |
|
427 aStream << fileName; // write temporary filename |
|
428 } |
|
429 |
|
430 theStore = CDirectFileStore::ReplaceLC |
|
431 ( fs, fileName, EFileRead|EFileWrite ); |
|
432 theStore->SetTypeL( KDirectFileStoreLayoutUid ); |
|
433 // externalize the rich text |
|
434 streamId = iBodyText->StoreL( *theStore ); // Store and get ID |
|
435 CleanupStack::PopAndDestroy( 2, filenameBuf ); // pop and destroy store, filenameBuf |
|
436 aStream << streamId; |
|
437 } |
|
438 else |
|
439 { |
|
440 aStream.WriteUint32L( 0 ); // no file storage |
|
441 } |
|
442 |
|
443 TUint32 count = iAttachments->Count(); |
|
444 aStream << count; // compressed value |
|
445 for ( TInt ii = 0; ii < count; ++ii ) |
|
446 { |
|
447 TPtrC16 text = iAttachments->MdcaPoint(ii); |
|
448 |
|
449 aStream.WriteUint32L( text.Length() ); |
|
450 aStream << text ; |
|
451 } |
|
452 |
|
453 ExternalizeArrayL( iToAddresses, aStream ); |
|
454 ExternalizeArrayL( iBccAddresses, aStream ); |
|
455 ExternalizeArrayL( iCcAddresses, aStream ); |
|
456 |
|
457 // Opaque data |
|
458 length = 0; |
|
459 if ( iOpaqueData ) |
|
460 { |
|
461 length = iOpaqueData->Length(); |
|
462 } |
|
463 aStream.WriteUint32L( length ); |
|
464 if ( length > 0 ) |
|
465 { |
|
466 aStream << iOpaqueData->Des(); |
|
467 } |
|
468 } |
|
469 |
|
470 // --------------------------------------------------------- |
|
471 // CMessageDataImpl::InternalizeL |
|
472 // |
|
473 // --------------------------------------------------------- |
|
474 // |
|
475 void CMessageDataImpl::InternalizeL( RReadStream& aStream ) |
|
476 { |
|
477 TUint32 tmpVal; |
|
478 tmpVal = aStream.ReadUint32L( ); |
|
479 iDataType = TUid::Uid( tmpVal ); |
|
480 |
|
481 tmpVal = aStream.ReadInt32L( ); |
|
482 if ( tmpVal ) |
|
483 { |
|
484 iSubject = HBufC::NewL( aStream, tmpVal ); |
|
485 } |
|
486 |
|
487 // something in filestorage |
|
488 tmpVal = aStream.ReadInt32L( ); |
|
489 if (tmpVal) |
|
490 { |
|
491 HBufC* fileName = HBufC::NewLC( aStream, tmpVal ); |
|
492 |
|
493 TStreamId streamId; |
|
494 aStream >> streamId; |
|
495 |
|
496 // Restore text from file store |
|
497 RFs& fs = CCoeEnv::Static()->FsSession(); |
|
498 CFileStore* theStore; |
|
499 |
|
500 theStore = CDirectFileStore::OpenLC( |
|
501 fs, |
|
502 fileName->Des(), |
|
503 EFileRead|EFileShareReadersOnly ); |
|
504 |
|
505 if (theStore->Type()[0]!= KDirectFileStoreLayoutUid ) |
|
506 { |
|
507 User::Leave( KErrUnknown ); |
|
508 } |
|
509 // internalize from the store |
|
510 iBodyText->RestoreL( *theStore, streamId ); |
|
511 CleanupStack::PopAndDestroy( theStore ); // store |
|
512 fs.Delete( *fileName ); |
|
513 CleanupStack::PopAndDestroy( fileName ); |
|
514 } |
|
515 |
|
516 |
|
517 // Filepath attachments |
|
518 TInt count = aStream.ReadUint32L( ); |
|
519 HBufC16* buf; |
|
520 for ( TInt ii = 0; ii < count; ++ii ) |
|
521 { |
|
522 tmpVal = aStream.ReadUint32L( ); // string length |
|
523 buf = HBufC16::NewLC( aStream, tmpVal ); |
|
524 iAttachments->AppendL( *buf ); |
|
525 CleanupStack::PopAndDestroy( buf ); |
|
526 } |
|
527 |
|
528 InternalizeArrayL( iToAddresses, aStream ); |
|
529 InternalizeArrayL( iBccAddresses, aStream ); |
|
530 InternalizeArrayL( iCcAddresses, aStream ); |
|
531 |
|
532 tmpVal = aStream.ReadInt32L( ); |
|
533 if ( tmpVal ) |
|
534 { |
|
535 iOpaqueData = HBufC8::NewL( aStream, tmpVal ); |
|
536 } |
|
537 } |
|
538 |
|
539 // --------------------------------------------------------- |
|
540 // CMessageDataImpl::ExternalizeArrayL |
|
541 // |
|
542 // --------------------------------------------------------- |
|
543 // |
|
544 void CMessageDataImpl::ExternalizeArrayL( |
|
545 CMessageAddressArray* anArray, |
|
546 RWriteStream& aStream ) const |
|
547 { |
|
548 |
|
549 TInt count = anArray->Count(); |
|
550 aStream.WriteUint32L( count ); // compressed value |
|
551 for ( TInt ii = 0; ii < count; ++ii ) |
|
552 { |
|
553 anArray->At(ii)->ExternalizeL( aStream ); |
|
554 } |
|
555 } |
|
556 |
|
557 // --------------------------------------------------------- |
|
558 // CMessageDataImpl::InternalizeArrayL |
|
559 // |
|
560 // --------------------------------------------------------- |
|
561 // |
|
562 void CMessageDataImpl::InternalizeArrayL( |
|
563 CMessageAddressArray* anArray, |
|
564 RReadStream& aStream ) |
|
565 { |
|
566 TInt count; |
|
567 count = aStream.ReadUint32L(); |
|
568 anArray->Reset(); |
|
569 for ( TInt ii = 0; ii < count; ++ii ) |
|
570 { |
|
571 CMessageAddress* messageAddress = CMessageAddress::NewLC(); |
|
572 messageAddress->InternalizeL( aStream ); |
|
573 anArray->AppendL( messageAddress ); |
|
574 CleanupStack::Pop( messageAddress ); |
|
575 } |
|
576 } |
|
577 |
|
578 // --------------------------------------------------------- |
|
579 // CMessageDataImpl::CreateTempPathL |
|
580 // |
|
581 // --------------------------------------------------------- |
|
582 // |
|
583 void CMessageDataImpl::CreateTempPathL( TDes16& aPath, RFs& aFs ) const |
|
584 { |
|
585 aPath.Zero(); |
|
586 |
|
587 TInt drive = EDriveD; |
|
588 #ifdef RD_MULTIPLE_DRIVE |
|
589 User::LeaveIfError( |
|
590 DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRam, drive ) ); |
|
591 #endif |
|
592 TChar driveChar; |
|
593 aFs.DriveToChar( drive, driveChar ); |
|
594 |
|
595 aPath.Append( driveChar ); |
|
596 aPath.Append( KSenduiTempFile ); |
|
597 |
|
598 TTime time; |
|
599 time.UniversalTime(); |
|
600 |
|
601 TFileName* tempDir = new (ELeave) TFileName(); |
|
602 tempDir->Format( |
|
603 aPath , |
|
604 I64HIGH( time.Int64() ), |
|
605 I64LOW( time.Int64() ) ); |
|
606 aPath = *tempDir; |
|
607 delete tempDir; |
|
608 |
|
609 TInt err = aFs.MkDirAll( aPath ); |
|
610 if ( err && err != KErrAlreadyExists ) |
|
611 { |
|
612 User::Leave( err ); |
|
613 } |
|
614 } |
|
615 |
|
616 // --------------------------------------------------------- |
|
617 // CMessageDataImpl::SetOpaqueDataL |
|
618 // |
|
619 // --------------------------------------------------------- |
|
620 // |
|
621 void CMessageDataImpl::SetOpaqueDataL( const TDesC8* aData ) |
|
622 { |
|
623 delete iOpaqueData; |
|
624 iOpaqueData = NULL; |
|
625 if ( aData ) |
|
626 { |
|
627 iOpaqueData = aData->AllocL(); |
|
628 } |
|
629 } |
|
630 |
|
631 // --------------------------------------------------------- |
|
632 // CMessageDataImpl::OpaqueData |
|
633 // |
|
634 // --------------------------------------------------------- |
|
635 // |
|
636 const TPtrC8 CMessageDataImpl::OpaqueData() const |
|
637 { |
|
638 return iOpaqueData ? TPtrC8( *iOpaqueData ) : TPtrC8(); |
|
639 } |
|
640 |
|
641 |
|
642 |
|
643 // End of File |
|