photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp
branchRCL_3
changeset 56 b023a8d2866a
parent 47 f9e827349359
child 57 ea65f74e6de4
equal deleted inserted replaced
47:f9e827349359 56:b023a8d2866a
    84 const TInt KGlxMaxSmallImageZoomLevel =150;
    84 const TInt KGlxMaxSmallImageZoomLevel =150;
    85 const TInt KGlxMaxBigImageZoomLevel   =100;
    85 const TInt KGlxMaxBigImageZoomLevel   =100;
    86 const TInt KGlxMinSmallImageZoomLevel =100;
    86 const TInt KGlxMinSmallImageZoomLevel =100;
    87 const TInt KGlxNeutralPinchPosition   =100;
    87 const TInt KGlxNeutralPinchPosition   =100;
    88 const TInt KGlxSliderTickValue        =5;
    88 const TInt KGlxSliderTickValue        =5;
       
    89 const TInt KGlxRealTruncationPadding  =0.5;
    89 
    90 
    90 /**
    91 /**
    91  * Start Delay for the periodic timer, in microseconds
    92  * Start Delay for the periodic timer, in microseconds
    92  */
    93  */
    93 const TInt KPeriodicStartDelay = 250000; 
    94 const TInt KPeriodicStartDelay = 250000; 
   515     {
   516     {
   516     TRACER("CGlxFullScreenViewImp::ShowUiL");
   517     TRACER("CGlxFullScreenViewImp::ShowUiL");
   517 	if(CheckIfSliderToBeShownL())
   518 	if(CheckIfSliderToBeShownL())
   518         {
   519         {
   519         //To set the Slider values.
   520         //To set the Slider values.
   520         SetSliderLevel();
   521         SetSliderToMin();
   521         //show the slider
   522         //show the slider
   522         iSliderWidget->ShowWidget(ETrue);
   523         iSliderWidget->ShowWidget(ETrue);
   523         }
   524         }
   524     else
   525     else
   525         {
   526         {
   751                     autoZoomOut = EFalse; 
   752                     autoZoomOut = EFalse; 
   752                     }
   753                     }
   753                 
   754                 
   754                 iHdmiController->ActivateZoom(autoZoomOut);
   755                 iHdmiController->ActivateZoom(autoZoomOut);
   755                 }
   756                 }
       
   757             
       
   758             GLX_LOG_INFO1("ActivateZoomControlL: Slider MaxRange = %d   ", iSliderModel->MaxRange() );
       
   759             GLX_LOG_INFO1("ActivateZoomControlL: Slider MinRange = %d   ", iSliderModel->MinRange() );
       
   760             GLX_LOG_INFO1("ActivateZoomControlL: Slider PrimaryValue= %d", iSliderModel->PrimaryValue() );
       
   761             
   756             if (aStartMode == EZoomStartSlider) 
   762             if (aStartMode == EZoomStartSlider) 
   757                 {
   763                 {
   758                 iZoomControl->ActivateL(iSliderModel->PrimaryValue(),aStartMode, focus,
   764                 iZoomControl->ActivateL(iSliderModel->PrimaryValue(),aStartMode, focus,
   759                                         item, apZoomFocus,iImgViewerMode);
   765                                         item, apZoomFocus,iImgViewerMode);
   760                 }
   766                 }
   820             {
   826             {
   821             iUiUtility->GlxTextureManager().AnimateMediaItem(
   827             iUiUtility->GlxTextureManager().AnimateMediaItem(
   822                     item.Id(), ETrue);
   828                     item.Id(), ETrue);
   823             }
   829             }
   824         }
   830         }
       
   831     
       
   832     SetSliderToMin();
   825     //check if the slider is already visible in zoom view.
   833     //check if the slider is already visible in zoom view.
   826     //if yes then do not disable the slider.
   834     //if yes then do not disable the slider.
   827     TBool sliderInvisible = ETrue;
   835     TBool sliderInvisible = ETrue;
   828     if (EUiOn == iZoomControl->ZoomUiState())
   836     if (EUiOn == iZoomControl->ZoomUiState())
   829         {
   837         {
   865 			{
   873 			{
   866 			CEikButtonGroupContainer* cba = Cba();
   874 			CEikButtonGroupContainer* cba = Cba();
   867 			TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
   875 			TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
   868 			cba->DrawNow();
   876 			cba->DrawNow();
   869 			}
   877 			}
   870         
       
   871         }
   878         }
   872 	else
   879 	else
   873 		{
   880 		{
   874 		DeleteImageViewerInstance();
   881 		DeleteImageViewerInstance();
   875 		}
   882 		}
  1132                 TInt tlX = (rect.Width() - (size.iWidth*zoomLevel)/100)/2;
  1139                 TInt tlX = (rect.Width() - (size.iWidth*zoomLevel)/100)/2;
  1133                 TInt tlY = (rect.Height() - (size.iHeight*zoomLevel)/100)/2;
  1140                 TInt tlY = (rect.Height() - (size.iHeight*zoomLevel)/100)/2;
  1134                 TRect imageRect(TPoint(tlX, tlY), TSize((size.iWidth*zoomLevel)/100, (size.iHeight*zoomLevel)/100));
  1141                 TRect imageRect(TPoint(tlX, tlY), TSize((size.iWidth*zoomLevel)/100, (size.iHeight*zoomLevel)/100));
  1135                 if (imageRect.Contains(doubleTapPoint))
  1142                 if (imageRect.Contains(doubleTapPoint))
  1136                     {
  1143                     {
  1137                     SetSliderLevel();
  1144                     SetSliderToMin();
  1138                     TRAP_IGNORE( ActivateZoomControlL(EZoomStartDoubleTap, &doubleTapPoint)  );
  1145                     TRAP_IGNORE( ActivateZoomControlL(EZoomStartDoubleTap, &doubleTapPoint)  );
  1139                     }
  1146                     }
  1140                 return EEventConsumed;
  1147                 return EEventConsumed;
  1141                 }
  1148                 }
  1142             case ETypeItemRemoved:
  1149             case ETypeItemRemoved:
  1207             //Zoom Start via pinch
  1214             //Zoom Start via pinch
  1208             case ETypePinch:
  1215             case ETypePinch:
  1209                 // Handle only a pinch out. not a pinch in. 
  1216                 // Handle only a pinch out. not a pinch in. 
  1210                 if (KGlxNeutralPinchPosition < aEvent.CustomEventData())
  1217                 if (KGlxNeutralPinchPosition < aEvent.CustomEventData())
  1211                     {
  1218                     {
  1212                     SetSliderLevel();
  1219                     SetSliderToMin();
  1213                     TRAP_IGNORE( ActivateZoomControlL(EZoomStartPinch));
  1220                     TRAP_IGNORE( ActivateZoomControlL(EZoomStartPinch));
  1214                     }
  1221                     }
  1215                 return EEventConsumed; // will be consumed even if we are pinching IN (trying to zoom OUT). 
  1222                 return EEventConsumed; // will be consumed even if we are pinching IN (trying to zoom OUT). 
  1216                 //slider event handling   
  1223                 //slider event handling   
  1217             case ETypePrimaryValueChange:
  1224             case ETypePrimaryValueChange:
  1253 		    consumed = ETrue;
  1260 		    consumed = ETrue;
  1254 		    iIsDialogLaunched = EFalse;
  1261 		    iIsDialogLaunched = EFalse;
  1255 		    break;
  1262 		    break;
  1256 		    }
  1263 		    }
  1257 		case EGlxCmdFullScreenBack:
  1264 		case EGlxCmdFullScreenBack:
  1258 		    SetSliderLevel();
       
  1259 		    DeactivateZoomControlL();
  1265 		    DeactivateZoomControlL();
  1260 			//Show the screen furniture when we press back from zoom
  1266 			//Show the screen furniture when we press back from zoom
  1261 		    ShowUiL(ETrue);
  1267 		    ShowUiL(ETrue);
  1262 		    consumed = ETrue;
  1268 		    consumed = ETrue;
  1263 		    break;
  1269 		    break;
  1287     // and activates the fullscreenview
  1293     // and activates the fullscreenview
  1288     if (aControl == iZoomControl)
  1294     if (aControl == iZoomControl)
  1289         {
  1295         {
  1290         if (aCommandId == KGlxZoomOutCommand)
  1296         if (aCommandId == KGlxZoomOutCommand)
  1291             {
  1297             {
  1292             SetSliderLevel();
       
  1293             DeactivateZoomControlL();
  1298             DeactivateZoomControlL();
  1294             }
  1299             }
  1295         else if(aCommandId == KGlxZoomOrientationChange)
  1300         else if(aCommandId == KGlxZoomOrientationChange)
  1296             {
  1301             {
  1297             iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize()));
  1302             iViewWidget->setRect(TRect(TPoint(0,0),AlfUtil::ScreenSize()));
  1345         //Choose the Minimum Of the above.
  1350         //Choose the Minimum Of the above.
  1346         TReal32 imageWidthRatio  = ((TReal32) rect.Width() / size.iWidth )*100.0F;
  1351         TReal32 imageWidthRatio  = ((TReal32) rect.Width() / size.iWidth )*100.0F;
  1347         TReal32 imageHeightRatio = ((TReal32)rect.Height()/ size.iHeight )*100.0F;
  1352         TReal32 imageHeightRatio = ((TReal32)rect.Height()/ size.iHeight )*100.0F;
  1348         initialZoomLevel = Min(imageWidthRatio,imageHeightRatio);
  1353         initialZoomLevel = Min(imageWidthRatio,imageHeightRatio);
  1349         } 
  1354         } 
  1350     return initialZoomLevel;
  1355     
       
  1356     // A correction of 0.5 (KGlxRealTruncationPadding) is added to the resultant value. 
       
  1357     // This ensures that all return values greater than X.5 (e.g lets say 12.8) is pegged to X+1(13)
       
  1358     // instead of X(12) while calculating. 
       
  1359     // Changing the calculations to real might have been a better idea, 
       
  1360     // but that involves many changes in many places and was therefore avoided, 
       
  1361     // maybe a good idea to take up in PS2.
       
  1362     GLX_LOG_INFO1("CGlxFullScreenViewImp::GetInitialZoomLevel() = %d ", KGlxRealTruncationPadding + initialZoomLevel);
       
  1363     return KGlxRealTruncationPadding + initialZoomLevel ;
  1351     }
  1364     }
  1352 
  1365 
  1353 //----------------------------------------------------------------------------------
  1366 //----------------------------------------------------------------------------------
  1354 // SetSliderLevel() Set the Initial Zoom Level for the Image
  1367 // SetSliderLevel() Set the Initial Zoom Level for the Image
  1355 //----------------------------------------------------------------------------------
  1368 //----------------------------------------------------------------------------------
  1356 //
  1369 //
  1357 void CGlxFullScreenViewImp::SetSliderLevel()
  1370 void CGlxFullScreenViewImp::SetSliderToMin()
  1358     {
  1371     {
  1359     TRACER("CGlxFullScreenViewImp::SetSliderLevel");
  1372     TRACER("CGlxFullScreenViewImp::SetSliderLevel");
  1360 
  1373 
  1361     TInt value = GetInitialZoomLevel();
  1374     TInt value = GetInitialZoomLevel();
  1362     if(iSliderModel)
  1375     if(iSliderModel)
  1492             }
  1505             }
  1493         
  1506         
  1494         //check if any Error message is to be displayed
  1507         //check if any Error message is to be displayed
  1495         TMPXGeneralCategory cat = media.Category();
  1508         TMPXGeneralCategory cat = media.Category();
  1496         TBool checkViewRights = ETrue;
  1509         TBool checkViewRights = ETrue;
  1497         
  1510         if (media.IsDrmProtected())
  1498         if(iImgViewerMode && iImageViewerInstance->IsPrivate())
  1511             {
  1499             {
  1512             GLX_LOG_INFO("CGlxFullScreenViewImp::ShowDrmExpiryNoteL()"
  1500             checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
  1513                     "- ItemRightsValidityCheckL()");
  1501                     iImageViewerInstance->ImageFileHandle(),
  1514             if (iImgViewerMode && iImageViewerInstance->IsPrivate())
  1502                     (media.Category() == EMPXImage));
  1515                 {
  1503             }
  1516                 checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
  1504         else
  1517                         iImageViewerInstance->ImageFileHandle(),
  1505             {
  1518                         (media.Category() == EMPXImage));
  1506             //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
  1519                 }
  1507             checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
  1520             else
  1508                     media.Uri(), (media.Category() == EMPXImage));
  1521                 {
  1509             }
  1522                 //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
  1510         
  1523                 checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
       
  1524                         media.Uri(), (media.Category() == EMPXImage));
       
  1525                 }
       
  1526             }
  1511         if (checkViewRights && tnError != KErrNone)
  1527         if (checkViewRights && tnError != KErrNone)
  1512             {
  1528             {
  1513             if (iPeriodic->IsActive())
  1529             if (iPeriodic->IsActive())
  1514                 {
  1530                 {
  1515                 iPeriodic->Cancel();
  1531                 iPeriodic->Cancel();
  1690     iUiUtility->GlxTextureManager().RemoveTexture(item.Id(),EFalse);
  1706     iUiUtility->GlxTextureManager().RemoveTexture(item.Id(),EFalse);
  1691     }
  1707     }
  1692 
  1708 
  1693 // ---------------------------------------------------------------------------
  1709 // ---------------------------------------------------------------------------
  1694 // 
  1710 // 
  1695 // Set the image to external display - HDMI
  1711 // Set the focused item to external display - HDMI
  1696 // ---------------------------------------------------------------------------
  1712 // ---------------------------------------------------------------------------
  1697 //
  1713 //
  1698 void CGlxFullScreenViewImp::SetItemToHDMIL()
  1714 void CGlxFullScreenViewImp::SetItemToHDMIL()
  1699     {
  1715     {
  1700     TRACER("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi");
  1716     TRACER("CGlxFullScreenViewImp::SetItemToHDMIL()");
  1701 
  1717 
  1702     TInt focusIndex = iMediaList->FocusIndex();
  1718     TInt focusIndex = iMediaList->FocusIndex();
  1703     
  1719 
  1704     // If we dont know what item we are focussing on 
  1720     // If we dont know what item we are focussing on 
  1705     // or if out medialist is empty
  1721     // or if our medialist is empty
  1706     // or if HDMI is not connected 
       
  1707     // or if there is no HDMI Controller at all 
  1722     // or if there is no HDMI Controller at all 
  1708     // then dont SetImageToHDMI :)  
  1723     // then dont SetItemToHDMI :)  
  1709     if( ( KErrNotFound == focusIndex)
  1724     if ((KErrNotFound == focusIndex) || (0 == iMediaList->Count()) || (NULL
  1710             || (0 == iMediaList->Count())
  1725             == iHdmiController))
  1711             || (NULL == iHdmiController)) 
  1726         {
  1712         {
  1727         GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Cant Set Image To HDMI");
  1713         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi- Cant Set Image To HDMI");
       
  1714         return;
  1728         return;
  1715         }
  1729         }
  1716     
  1730     
  1717     TGlxMedia item = iMediaList->Item(focusIndex);
  1731     TGlxMedia item = iMediaList->Item(focusIndex);
  1718     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(),
  1732     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(),
  1719         KGlxMediaIdThumbnail);
  1733             KGlxMediaIdThumbnail);
  1720     GLX_LOG_INFO1("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - error=%d", error);
  1734     GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - error=%d", error);
       
  1735 
       
  1736     TBool canView = ETrue;
       
  1737     if (item.IsDrmProtected())
       
  1738         {
       
  1739         canView = iDrmUtility->ItemRightsValidityCheckL(item.Uri(),
       
  1740                 (item.Category() == EMPXImage));
       
  1741         }
       
  1742     GLX_LOG_INFO1("CGlxFullScreenViewImp::SetItemToHDMIL - canView=%d", canView);        
       
  1743     
  1721     // Item will be supported by HDMI ONLY if
  1744     // Item will be supported by HDMI ONLY if
  1722     // it is not a video
  1745     // it is not a video
  1723     // and it has valid DRM Viewing rights
  1746     // and it is DRM protected and has valid DRM Viewing rights
  1724     // and it has no attribute error 
  1747     // and it has no attribute error 
  1725     if ( (item.Category() != EMPXVideo) 
  1748     if ((item.Category() != EMPXVideo) && canView && (error == KErrNone))
  1726             && iDrmUtility->ItemRightsValidityCheckL(item.Uri(), ETrue) 
  1749         {
  1727             && (error == KErrNone) )
  1750         GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch FS thumbnail");
  1728         {
       
  1729         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Fetch FS thumbnail");
       
  1730         TMPXAttribute fsTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1751         TMPXAttribute fsTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1731                 GlxFullThumbnailAttributeId(ETrue, iScrnSize.iWidth,
  1752                 GlxFullThumbnailAttributeId(ETrue, iScrnSize.iWidth,
  1732                         iScrnSize.iHeight));
  1753                         iScrnSize.iHeight));
  1733         const CGlxThumbnailAttribute* fsValue = item.ThumbnailAttribute(
  1754         const CGlxThumbnailAttribute* fsValue = item.ThumbnailAttribute(
  1734                 fsTnAttrib);
  1755                 fsTnAttrib);
  1735         if (fsValue)
  1756         if (fsValue)
  1736             {
  1757             {
  1737             GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting FS Bitmap");
  1758             GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting FS Bitmap");
  1738             CFbsBitmap* fsBitmap = new (ELeave) CFbsBitmap;
  1759             CFbsBitmap* fsBitmap = new (ELeave) CFbsBitmap;
  1739             CleanupStack::PushL(fsBitmap);
  1760             CleanupStack::PushL(fsBitmap);
  1740             fsBitmap->Duplicate( fsValue->iBitmap->Handle());
  1761             fsBitmap->Duplicate( fsValue->iBitmap->Handle());
  1741             
  1762             
  1742             GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - FS Bitmap Size width=%d, height=%d", 
  1763             GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - FS Bitmap Size width=%d, height=%d", 
  1743                     fsBitmap->SizeInPixels().iWidth, fsBitmap->SizeInPixels().iHeight);
  1764                     fsBitmap->SizeInPixels().iWidth, fsBitmap->SizeInPixels().iHeight);
  1744             iHdmiController->SetImageL(item.Uri(), KNullDesC, fsBitmap);
  1765             iHdmiController->SetImageL(item.Uri(), KNullDesC, fsBitmap);
  1745             CleanupStack::PopAndDestroy(fsBitmap);
  1766             CleanupStack::PopAndDestroy(fsBitmap);
  1746             }
  1767             }
  1747         else
  1768         else
  1748             {
  1769             {
  1749             GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Fetch Grid thumbnail");
  1770             GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Fetch Grid thumbnail");
  1750             TMPXAttribute gridTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1771             TMPXAttribute gridTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1751                     GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth,
  1772                     GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth,
  1752                             iGridIconSize.iHeight));
  1773                             iGridIconSize.iHeight));
  1753             const CGlxThumbnailAttribute* gridvalue = item.ThumbnailAttribute(
  1774             const CGlxThumbnailAttribute* gridvalue = item.ThumbnailAttribute(
  1754                     gridTnAttrib);
  1775                     gridTnAttrib);
  1755 
  1776 
  1756             if (gridvalue)
  1777             if (gridvalue)
  1757                 {
  1778                 {
  1758                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting Grid Bitmap");
  1779                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Grid Bitmap");
  1759                 CFbsBitmap* gridBitmap = new (ELeave) CFbsBitmap;
  1780                 CFbsBitmap* gridBitmap = new (ELeave) CFbsBitmap;
  1760                 CleanupStack::PushL(gridBitmap);
  1781                 CleanupStack::PushL(gridBitmap);
  1761                 gridBitmap->Duplicate( gridvalue->iBitmap->Handle());
  1782                 gridBitmap->Duplicate( gridvalue->iBitmap->Handle());
  1762                 
  1783                 
  1763                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - gridBitmap Size width=%d, height=%d", 
  1784                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - gridBitmap Size width=%d, height=%d", 
  1764                         gridBitmap->SizeInPixels().iWidth, gridBitmap->SizeInPixels().iHeight);
  1785                         gridBitmap->SizeInPixels().iWidth, gridBitmap->SizeInPixels().iHeight);
  1765                 iHdmiController->SetImageL(item.Uri(), KNullDesC, gridBitmap);
  1786                 iHdmiController->SetImageL(item.Uri(), KNullDesC, gridBitmap);
  1766                 CleanupStack::PopAndDestroy(gridBitmap);
  1787                 CleanupStack::PopAndDestroy(gridBitmap);
  1767                 }
  1788                 }
  1768             else
  1789             else
  1769                 {
  1790                 {
  1770                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting Default Bitmap");
  1791                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Setting Default Bitmap");
  1771                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1792                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1772                 resFile.Append(KGlxIconsFilename);
  1793                 resFile.Append(KGlxIconsFilename);
  1773                 CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
  1794                 CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
  1774                         EMbmGlxiconsQgn_prop_image_notcreated);
  1795                         EMbmGlxiconsQgn_prop_image_notcreated);
  1775                 CleanupStack::PushL(defaultBitmap);
  1796                 CleanupStack::PushL(defaultBitmap);
  1776                 
  1797                 
  1777                 // always need to setsize on the raw bitmap for it to be visible
  1798                 // always need to setsize on the raw bitmap for it to be visible
  1778                 AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
  1799                 AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
  1779 
  1800 
  1780                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
  1801                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetItemToHDMIL - Default Size width=%d, height=%d", 
  1781                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1802                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1782                 iHdmiController->SetImageL(item.Uri(), KNullDesC, defaultBitmap);
  1803                 iHdmiController->SetImageL(item.Uri(), KNullDesC, defaultBitmap);
  1783                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1804                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1784                 }
  1805                 }
  1785             }
  1806             }
  1786         }
  1807         }
  1787     else
  1808     else
  1788         {
  1809         {
  1789         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Unsupported Item");
  1810         GLX_LOG_INFO("CGlxFullScreenViewImp::SetItemToHDMIL - Unsupported Item");
  1790         //Set the external display to cloning mode if
  1811         //Set the external display to cloning mode if
  1791         //the current item is something we dont support 
  1812         //the current item is something we dont support 
  1792         //(e.g. video, corrupted item, item with invalid DRM)
  1813         //(e.g. video, corrupted item, item with invalid DRM)
  1793         iHdmiController->ItemNotSupported();
  1814         iHdmiController->ItemNotSupported();
  1794         }
  1815         }
  1815     TRACER("CGlxFullScreenViewImp::NavigateToMainListL()");
  1836     TRACER("CGlxFullScreenViewImp::NavigateToMainListL()");
  1816     if (!iImgViewerMode)
  1837     if (!iImgViewerMode)
  1817         {
  1838         {
  1818         if (iZoomControl && iZoomControl->Activated())
  1839         if (iZoomControl && iZoomControl->Activated())
  1819             {
  1840             {
  1820             SetSliderLevel();
       
  1821             DeactivateZoomControlL();
  1841             DeactivateZoomControlL();
  1822             }
  1842             }
  1823         ProcessCommandL( EAknSoftkeyClose);
  1843         ProcessCommandL( EAknSoftkeyClose);
  1824         }
  1844         }
  1825     }
  1845     }
  1834     iIsMMCRemoved = ETrue;
  1854     iIsMMCRemoved = ETrue;
  1835     if(!iIsDialogLaunched)
  1855     if(!iIsDialogLaunched)
  1836         {
  1856         {
  1837         if(iZoomControl && iZoomControl->Activated())
  1857         if(iZoomControl && iZoomControl->Activated())
  1838             {
  1858             {
  1839             SetSliderLevel();
       
  1840             DeactivateZoomControlL();   
  1859             DeactivateZoomControlL();   
  1841             }
  1860             }
  1842         ProcessCommandL(EAknSoftkeyExit);
  1861         ProcessCommandL(EAknSoftkeyExit);
  1843         }
  1862         }
  1844     }
  1863     }
  1904 // HandleTvStatusChangedL 
  1923 // HandleTvStatusChangedL 
  1905 // -----------------------------------------------------------------------------
  1924 // -----------------------------------------------------------------------------
  1906 void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType )
  1925 void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType )
  1907     {
  1926     {
  1908     TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()");
  1927     TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()");
  1909     // Hide UI furnitures when HDMI cable is connected/Disconnected
  1928     GLX_LOG_INFO1("CGlxFullScreenViewImp::HandleTvStatusChangedL(%d)",
  1910     // irrespective of UI state on/off.
  1929             aChangeType);
       
  1930 
  1911     if (aChangeType == ETvConnectionChanged)
  1931     if (aChangeType == ETvConnectionChanged)
  1912         {
  1932         {
       
  1933         // Hide UI furnitures when HDMI cable is connected/Disconnected
       
  1934         // irrespective of UI state on/off.
  1913         HideUi(ETrue);
  1935         HideUi(ETrue);
  1914         }
  1936         }
  1915     }
  1937     }
  1916 
  1938 
  1917 // ---------------------------------------------------------------------------
  1939 // ---------------------------------------------------------------------------
  1921     {
  1943     {
  1922     TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()");
  1944     TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()");
  1923 
  1945 
  1924     TInt index = iMediaList->FocusIndex();
  1946     TInt index = iMediaList->FocusIndex();
  1925     const TGlxMedia& item = iMediaList->Item(index);
  1947     const TGlxMedia& item = iMediaList->Item(index);
  1926     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail);
  1948     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(),
       
  1949             KGlxMediaIdThumbnail);
  1927        
  1950        
  1928     TBool isDrmRightsValid = ETrue;
  1951     TBool isDrmRightsValid = ETrue;
  1929 	if(item.IsDrmProtected())
  1952 	if(item.IsDrmProtected())
  1930 		{
  1953 		{
  1931         if (iImgViewerMode && iImageViewerInstance->IsPrivate())
  1954         if (iImgViewerMode && iImageViewerInstance->IsPrivate())
  1941                     item.Uri(), (item.Category() == EMPXImage));
  1964                     item.Uri(), (item.Category() == EMPXImage));
  1942             }
  1965             }
  1943         }
  1966         }
  1944 	
  1967 	
  1945     // Display slider only for non corrupted images and items with valid DRM license
  1968     // Display slider only for non corrupted images and items with valid DRM license
  1946 	if (iHdmiController
  1969 	if (iHdmiController && iHdmiController->IsHDMIConnected())
  1947                 && iHdmiController->IsHDMIConnected())
       
  1948         {
  1970         {
  1949         //hide slider if UI is needed to be on and HDMI is Connected
  1971         //hide slider if UI is needed to be on and HDMI is Connected
  1950 		return EFalse;
  1972 		return EFalse;
  1951         }
  1973         }
  1952     else if(error == KErrNone && item.Category() == EMPXImage
  1974     else if(error == KErrNone && item.Category() == EMPXImage