46 CPluginData& aPluginData, |
46 CPluginData& aPluginData, |
47 const TMessageContentId& aMsgContentId, |
47 const TMessageContentId& aMsgContentId, |
48 CFSMailMessagePart* aPart ) |
48 CFSMailMessagePart* aPart ) |
49 { |
49 { |
50 iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart ); |
50 iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart ); |
51 if (!aPart->GetContentType().Compare(KFSMailContentTypeTextHtml)) |
51 |
|
52 if (!CheckParameterFormatL( aPart->GetContentType() ).Compare(KFSMailContentTypeTextHtml)) |
52 { |
53 { |
53 iTextType = EHtmlText; |
54 iTextType = EHtmlText; |
54 } |
55 } |
55 } |
56 } |
|
57 |
56 |
58 |
57 // ----------------------------------------------------------------------------- |
59 // ----------------------------------------------------------------------------- |
58 // |
60 // |
59 // ----------------------------------------------------------------------------- |
61 // ----------------------------------------------------------------------------- |
60 // |
62 // |
314 |
316 |
315 // ----------------------------------------------------------------------------- |
317 // ----------------------------------------------------------------------------- |
316 // |
318 // |
317 // ----------------------------------------------------------------------------- |
319 // ----------------------------------------------------------------------------- |
318 // |
320 // |
|
321 const TDesC& CEmailTextContent::CheckParameterFormatL( const TDesC& aParam ) |
|
322 { |
|
323 _LIT( KSeparator, ";" ); |
|
324 _LIT( KSlash, "/" ); |
|
325 // Check for a type separator in the string |
|
326 TInt endPos = aParam.Find( KSeparator ); |
|
327 // Construct the compare string |
|
328 TPtrC extractString( aParam.Left( endPos ) ); |
|
329 HBufC* compareBuf = extractString.AllocLC(); |
|
330 TPtr compareString = compareBuf->Des(); |
|
331 TInt slashPos = aParam.Find( KSlash ); |
|
332 TInt stringLen = compareString.Length(); |
|
333 |
|
334 const TDesC& leftPart = extractString.Left( slashPos ); |
|
335 HBufC* leftPartBuf = leftPart.AllocLC(); |
|
336 TPtr leftPartString = leftPartBuf->Des(); |
|
337 leftPartString.Trim(); |
|
338 |
|
339 const TDesC& rightPart = extractString.Right( stringLen - ( slashPos + 1 ) ); |
|
340 HBufC* rightPartBuf = rightPart.AllocLC(); |
|
341 TPtr rightPartString = rightPartBuf->Des(); |
|
342 rightPartString.Trim(); |
|
343 |
|
344 compareString.Delete( 0, endPos ); |
|
345 compareString.Append( leftPartString ); |
|
346 compareString.Append( KSlash ); |
|
347 compareString.Append( rightPartString ); |
|
348 compareString.LowerCase(); |
|
349 CleanupStack::PopAndDestroy( rightPartBuf ); |
|
350 CleanupStack::PopAndDestroy( leftPartBuf ); |
|
351 |
|
352 const TDesC& retParam = compareString; |
|
353 CleanupStack::PopAndDestroy( compareBuf ); |
|
354 |
|
355 return retParam; |
|
356 } |
|
357 |
|
358 // ----------------------------------------------------------------------------- |
|
359 // |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
319 void CEmailTextContent::SetOwner( const TDataOwner aOwner ) |
362 void CEmailTextContent::SetOwner( const TDataOwner aOwner ) |
320 { |
363 { |
321 iOwner = aOwner; |
364 iOwner = aOwner; |
322 } |
365 } |