messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp
changeset 44 36f374c67aa8
parent 43 35b64624a9e7
child 52 12db4185673b
equal deleted inserted replaced
43:35b64624a9e7 44:36f374c67aa8
    53 _LIT(KSelectProcessingStateStmt, " SELECT message_id, msg_processingstate FROM conversation_messages WHERE message_id=:message_id ");
    53 _LIT(KSelectProcessingStateStmt, " SELECT message_id, msg_processingstate FROM conversation_messages WHERE message_id=:message_id ");
    54 // Remove record from conversation_messages table.
    54 // Remove record from conversation_messages table.
    55 _LIT(KRemoveMsgStmnt,"DELETE FROM conversation_messages WHERE message_id=:message_id");
    55 _LIT(KRemoveMsgStmnt,"DELETE FROM conversation_messages WHERE message_id=:message_id");
    56 
    56 
    57 const TInt KDefaultMaxSize = 300 * 1024;
    57 const TInt KDefaultMaxSize = 300 * 1024;
       
    58 //Preview thumbnail size
       
    59 const TInt KWidth = 9.5 * 6.7;
       
    60 const TInt KHeight = 9.5 * 6.7;
    58 
    61 
    59 // NOTE:- DRAFTS ENTRIES ARE NOT HANDLED IN THE PLUGIN
    62 // NOTE:- DRAFTS ENTRIES ARE NOT HANDLED IN THE PLUGIN
    60 
    63 
    61 // ============================== MEMBER FUNCTIONS ============================
    64 // ============================== MEMBER FUNCTIONS ============================
    62 // ----------------------------------------------------------------------------
    65 // ----------------------------------------------------------------------------
   360                         BindBodyText(sqlInsertStmt, attachId);
   363                         BindBodyText(sqlInsertStmt, attachId);
   361                         isBodyTextSet = ETrue;
   364                         isBodyTextSet = ETrue;
   362                     }
   365                     }
   363 
   366 
   364                     //image parsing
   367                     //image parsing
   365                     if (!isImageSet && (mimetype.Find(_L8("image"))
   368                     if (!isVideoSet && !isImageSet && (mimetype.Find(_L8("image"))
   366                             != KErrNotFound))
   369                             != KErrNotFound))
   367                     {
   370                     {
   368                         //get thumbnail for this image
   371                         //get thumbnail for this image
   369                         isImageSet = ETrue;
   372                         isImageSet = ETrue;
   370                         imagePath.Set(mediaInfo->FullFilePath());
   373                         imagePath.Set(mediaInfo->FullFilePath());
   387                             GetThumbNailL(attachId, mimetype, msgId);
   390                             GetThumbNailL(attachId, mimetype, msgId);
   388                         }
   391                         }
   389                     }
   392                     }
   390 
   393 
   391                     //audio content
   394                     //audio content
   392                     if (!isAudioSet && (mimetype.Find(_L8("audio"))
   395                     if (!isVideoSet && !isAudioSet && (mimetype.Find(_L8("audio"))
   393                             != KErrNotFound))
   396                             != KErrNotFound))
   394                     {
   397                     {
   395                         isAudioSet = ETrue;
   398                         isAudioSet = ETrue;
   396                         msgProperty |= EPreviewAudio;
   399                         msgProperty |= EPreviewAudio;
   397                         if (EFileProtNoProtection != mediaInfo->Protection())
   400                         if (EFileProtNoProtection != mediaInfo->Protection())
   403                             msgProperty |= EPreviewCorruptedAudio;
   406                             msgProperty |= EPreviewCorruptedAudio;
   404                         }
   407                         }
   405                     }
   408                     }
   406 
   409 
   407                     //video content
   410                     //video content
   408                     if (!isVideoSet && (mimetype.Find(_L8("video"))
   411                     if (!( isImageSet || isAudioSet) && !isVideoSet && (mimetype.Find(_L8("video"))
   409                             != KErrNotFound))
   412                             != KErrNotFound))
   410                     {
   413                     {
   411                         videoPath.Set(mediaInfo->FullFilePath());
   414                         videoPath.Set(mediaInfo->FullFilePath());
   412                         isVideoSet = ETrue;
   415                         isVideoSet = ETrue;
   413                         msgProperty |= EPreviewVideo;
   416                         msgProperty |= EPreviewVideo;
   794 {
   797 {
   795     //Scale the image
   798     //Scale the image
   796     iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
   799     iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
   797 
   800 
   798     //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels
   801     //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels
   799     iThumbnailManager->SetThumbnailSizeL(TSize(63.65, 63.65)); 
   802     iThumbnailManager->SetThumbnailSizeL(TSize(KWidth, KHeight)); 
   800     
   803     
   801     //optimize for performace
   804     //optimize for performace
   802     iThumbnailManager->SetQualityPreferenceL(
   805     iThumbnailManager->SetQualityPreferenceL(
   803         CThumbnailManager::EOptimizeForPerformance);
   806         CThumbnailManager::EOptimizeForPerformance);
   804 
   807