messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp
changeset 43 35b64624a9e7
parent 34 84197e66a4bd
child 47 5b14749788d7
child 52 12db4185673b
--- a/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp	Fri Jun 11 13:35:48 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp	Wed Jun 23 18:09:17 2010 +0300
@@ -56,7 +56,7 @@
 //UniViewerBodyWidget::setImage
 // @see header file
 //---------------------------------------------------------------
-void UniViewerBodyWidget::setPixmap(const QString &mimeType, const QString &pixmapFile)
+void UniViewerBodyWidget::setPixmap(UniMessageInfo *info)
 {
     setHasPixmap(true);
     //create image item instance
@@ -65,7 +65,7 @@
         HbStyle::setItemName(mPixmapItem, "pixmap");
     }
     mPixmapItem->hide();
-    mPixmapItem->populate(mimeType, pixmapFile);
+    mPixmapItem->populate(info);
 
     this->repolish();
 }
@@ -74,14 +74,14 @@
 //UniViewerBodyWidget::setAudio
 // @see header file
 //---------------------------------------------------------------
-void UniViewerBodyWidget::setAudio(const QString &mimeType, const QString &audiofile)
+void UniViewerBodyWidget::setAudio(UniMessageInfo *info)
 {
     if (!mAudioItem) {
         mAudioItem = new UniViewerAudioWidget(this);
         HbStyle::setItemName(mAudioItem, "audioItem");
     }
     mAudioItem->hide();
-    mAudioItem->populate(mimeType, audiofile);
+    mAudioItem->populate(info);
 
     this->repolish();
 }
@@ -90,10 +90,18 @@
 //UniViewerBodyWidget::setVideo
 // @see header file
 //---------------------------------------------------------------
-void UniViewerBodyWidget::setVideo(const QString &mimeType, const QString &videofile)
+void UniViewerBodyWidget::setVideo(UniMessageInfo *info)
 {
-    Q_UNUSED(mimeType)
-    Q_UNUSED(videofile)
+    setHasPixmap(true);
+    //create image item instance
+    if (!mPixmapItem) {
+       mPixmapItem = new UniViewerPixmapWidget(this);
+       HbStyle::setItemName(mPixmapItem, "pixmap");
+    }
+    mPixmapItem->hide();
+    mPixmapItem->populate(info);
+    
+    this->repolish();
 }
 
 //---------------------------------------------------------------
@@ -191,14 +199,14 @@
                 setText(textContent);
             }
         }
-        else if (mimeType.contains(VIDEO_MIMETYPE)) {
-            setVideo(mimeType, info->path());
+        else if (mimeType.contains(AUDIO_MIMETYPE)) {
+            setAudio(info);
         }
-        else if (mimeType.contains(AUDIO_MIMETYPE)) {
-            setAudio(mimeType, info->path());
+        else if (mimeType.contains(VIDEO_MIMETYPE)) {
+            setVideo(info);
         }
         else if (mimeType.contains(IMAGE_MIMETYPE)) {
-            setPixmap(mimeType, info->path());
+            setPixmap(info);
         }
 
         delete info;