photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp
branchRCL_3
changeset 32 78ad99c24f08
parent 30 a60acebbbd9d
child 35 420f6808bf21
equal deleted inserted replaced
30:a60acebbbd9d 32:78ad99c24f08
    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 
    89 /**
    90 /**
    90  * Start Delay for the periodic timer, in microseconds
    91  * Start Delay for the periodic timer, in microseconds
    91  */
    92  */
    92 const TInt KPeriodicStartDelay = 250000; 
    93 const TInt KPeriodicStartDelay = 250000; 
    93 /**
    94 /**
   197 	iMMCNotifier = CGlxMMCNotifier::NewL(*this);
   198 	iMMCNotifier = CGlxMMCNotifier::NewL(*this);
   198 	if(!iPeriodic)
   199 	if(!iPeriodic)
   199 		{
   200 		{
   200 		iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard);
   201 		iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard);
   201 		}
   202 		}
       
   203 	iGlxTvOut = CGlxTv::NewL(*this);
   202     }
   204     }
   203 
   205 
   204 // ---------------------------------------------------------------------------
   206 // ---------------------------------------------------------------------------
   205 // ~CGlxFullScreenViewImp()
   207 // ~CGlxFullScreenViewImp()
   206 // ---------------------------------------------------------------------------
   208 // ---------------------------------------------------------------------------
   210     TRACER("CGlxFullScreenViewImp::~CGlxFullScreenViewImp");
   212     TRACER("CGlxFullScreenViewImp::~CGlxFullScreenViewImp");
   211     if(iAlfEffectObs)
   213     if(iAlfEffectObs)
   212         {
   214         {
   213         delete iAlfEffectObs;
   215         delete iAlfEffectObs;
   214         }
   216         }
   215     delete iMMCNotifier;
   217     if(iMMCNotifier)
   216     iMMCNotifier = NULL;
   218         {
   217     
   219         delete iMMCNotifier;
   218 	delete iMediaListMulModelProvider;   
   220         iMMCNotifier = NULL;
   219     if(iTimer->IsActive())
   221         }
   220 	    {
   222     if(iMediaListMulModelProvider)
   221 	    iTimer->Cancel();
   223         {
   222 	    }
   224         delete iMediaListMulModelProvider;
   223 	delete iTimer;   
   225         }
       
   226     if(iTimer)
       
   227         {
       
   228         if(iTimer->IsActive())
       
   229             {
       
   230             iTimer->Cancel();
       
   231             }
       
   232         delete iTimer;
       
   233         }
   224 	if(iZoomButtonGroup)
   234 	if(iZoomButtonGroup)
   225         {
   235         {
   226         AppUi()->RemoveFromStack( iZoomButtonGroup );
   236         AppUi()->RemoveFromStack( iZoomButtonGroup );
   227         delete iZoomButtonGroup;
   237         delete iZoomButtonGroup;
       
   238         }
       
   239 	if(iGlxTvOut)
       
   240         {
       
   241         delete iGlxTvOut;
   228         }
   242         }
   229     if(iActiveMediaListRegistry)
   243     if(iActiveMediaListRegistry)
   230         {
   244         {
   231         iActiveMediaListRegistry->Close();
   245         iActiveMediaListRegistry->Close();
   232 	    }
   246 	    }
   324 		}
   338 		}
   325 		
   339 		
   326     if(naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
   340     if(naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
   327         {
   341         {
   328         iImgViewerMode = ETrue;
   342         iImgViewerMode = ETrue;
       
   343         CreateImageViewerInstanceL();
   329         }
   344         }
   330     //destroy and close navistate and navipath
   345     //destroy and close navistate and navipath
   331     CleanupStack::PopAndDestroy( naviState );
   346     CleanupStack::PopAndDestroy( naviState );
   332     CleanupStack::PopAndDestroy( navigationalState );
   347     CleanupStack::PopAndDestroy( navigationalState );
   333 
   348 
   334     iScrnSize = iUiUtility->DisplaySize();
   349     iScrnSize = iUiUtility->DisplaySize();
   335     iGridIconSize = iUiUtility->GetGridIconSize();
   350     iGridIconSize = iUiUtility->GetGridIconSize();
       
   351 
       
   352     iHdmiWidth = (iScrnSize.iWidth > iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight);
       
   353     iHdmiHeight = (iScrnSize.iWidth < iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight);
   336 
   354 
   337     //Create hdmicontroller when it is only launched from fullscreen.  
   355     //Create hdmicontroller when it is only launched from fullscreen.  
   338     //From filemanager show only clone mode.
   356     //From filemanager show only clone mode.
   339     if( !iImgViewerMode )    
   357     if( !iImgViewerMode )    
   340         {
   358         {
   486 // ---------------------------------------------------------------------------
   504 // ---------------------------------------------------------------------------
   487 //	
   505 //	
   488 void  CGlxFullScreenViewImp::ShowUiL(TBool aStartTimer)
   506 void  CGlxFullScreenViewImp::ShowUiL(TBool aStartTimer)
   489     {
   507     {
   490     TRACER("CGlxFullScreenViewImp::ShowUiL");
   508     TRACER("CGlxFullScreenViewImp::ShowUiL");
   491 
   509 	if(CheckIfSliderToBeShownL())
   492     TInt index = iMediaList->FocusIndex();
       
   493     const TGlxMedia& item = iMediaList->Item(index);
       
   494     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail);
       
   495        
       
   496     TBool isDrmRightsValid = ETrue;
       
   497 	if(item.IsDrmProtected())
       
   498 		{
       
   499 		//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
       
   500 		isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(item.Uri(),
       
   501 				(item.Category() == EMPXImage));
       
   502 		}
       
   503 	
       
   504     // Display slider only for non corrupted images and items with valid DRM license
       
   505     if (error == KErrNone && item.Category() == EMPXImage && isDrmRightsValid)
       
   506         {
   510         {
   507         //To set the Slider values.
   511         //To set the Slider values.
   508         SetSliderLevel();
   512         SetSliderLevel();
   509         //show the slider
   513         //show the slider
   510         iSliderWidget->ShowWidget(ETrue);
   514         iSliderWidget->ShowWidget(ETrue);
       
   515         }
       
   516     else
       
   517         {
       
   518         //hide slider if UI is needed to be on and HDMI is Connected
       
   519         iSliderWidget->ShowWidget(EFalse);
   511         }
   520         }
   512     
   521     
   513     if (iCoverFlowWidget)
   522     if (iCoverFlowWidget)
   514         {
   523         {
   515 		// This is done to set the item counter
   524 		// This is done to set the item counter
   684 // ---------------------------------------------------------------------------
   693 // ---------------------------------------------------------------------------
   685 //
   694 //
   686 void CGlxFullScreenViewImp::ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* apZoomFocus)
   695 void CGlxFullScreenViewImp::ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* apZoomFocus)
   687     {
   696     {
   688     TRACER("CGlxFullScreenViewImp::ActivateZoomControlL");
   697     TRACER("CGlxFullScreenViewImp::ActivateZoomControlL");
       
   698     /*
       
   699      * We will not do any zoom while HDMI is connected.
       
   700      * This is as part of HDMI improvements.
       
   701      */
       
   702     if (!iImgViewerMode && iHdmiController 
       
   703 				&& iHdmiController->IsHDMIConnected())
       
   704         {
       
   705         // Hide zoom slider in HDMI mode as Zoom is disable.
       
   706         // Let the other screen furnitures intact.
       
   707         iSliderWidget->ShowWidget( EFalse);
       
   708         return;
       
   709         }
   689     TInt focus = iMediaList->FocusIndex();
   710     TInt focus = iMediaList->FocusIndex();
   690     TGlxMedia item = iMediaList->Item( focus );
   711     TGlxMedia item = iMediaList->Item( focus );
   691     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail);
   712     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail);
   692    
   713    
   693     // Check if DRM rights expired for a specific media item 
   714     // Check if DRM rights expired for a specific media item 
   694     TBool isDrmRightsValid = ETrue;
   715     TBool isDrmRightsValid = ETrue;
   695     if(item.IsDrmProtected())
   716     if(item.IsDrmProtected())
   696     	{
   717     	{
   697     	 //DRM Rights validity check for displayed item
   718         if (iImgViewerMode && iImageViewerInstance->IsPrivate())
   698     	isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(item.Uri(),
   719             {
   699 				(item.Category() == EMPXImage));
   720             isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
   700     	}
   721                     iImageViewerInstance->ImageFileHandle(), (item.Category()
       
   722                             == EMPXImage));
       
   723             }
       
   724         else
       
   725             {
       
   726             //Since it is always for the focused item - use DisplayItemRightsCheckL 
       
   727             //instead of ItemRightsValidityCheckL
       
   728             isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
       
   729                     item.Uri(), (item.Category() == EMPXImage));
       
   730             }
       
   731         }
   701     // Activate Zoom if the item is an image and its DRM rights is not expired
   732     // Activate Zoom if the item is an image and its DRM rights is not expired
   702     if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid)
   733     if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid)
   703         {
   734         {
   704         if(iZoomControl && !iZoomControl->Activated())
   735         if(iZoomControl && !iZoomControl->Activated())
   705             {
   736             {
   797         {    
   828         {    
   798         // hide the toolbar
   829         // hide the toolbar
   799         EnableFSToolbar(EFalse);
   830         EnableFSToolbar(EFalse);
   800         
   831         
   801         //Setting Soft key to EmptySoftKeys would cause crash
   832         //Setting Soft key to EmptySoftKeys would cause crash
   802 		//When Fullscreen is opened from ImageViewer. 
   833 		//When Fullscreen is opened from ImageViewer.
   803         //So Set Soft Keys to empty only when not in Image Viewer mode.
   834         //And also, when Photos exits from FullScreen View.
   804 		CEikButtonGroupContainer* cba = Cba();
   835         //So Set Soft Keys to empty only when not in Image Viewer mode 
   805 		TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
   836         //& Photos is not exiting.
   806 		cba->DrawNow();
   837 		if( !iUiUtility->IsExitingState() )
   807         }
   838 			{
       
   839 			CEikButtonGroupContainer* cba = Cba();
       
   840 			TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
       
   841 			cba->DrawNow();
       
   842 			}
       
   843         
       
   844         }
       
   845 	else
       
   846 		{
       
   847 		DeleteImageViewerInstance();
       
   848 		}
   808     
   849     
   809     HideUi(ETrue); 
   850     HideUi(ETrue); 
   810 	// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. 
   851 	// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. 
   811 	// So we do the below trick. The SK overlap is still there but much much less noticable. 
   852 	// So we do the below trick. The SK overlap is still there but much much less noticable. 
   812     CCoeEnv::Static()->WsSession().Flush(); 
   853     CCoeEnv::Static()->WsSession().Flush(); 
  1061                 }
  1102                 }
  1062             case ETypeItemRemoved:
  1103             case ETypeItemRemoved:
  1063                 {
  1104                 {
  1064                 SetItemToHDMIL();
  1105                 SetItemToHDMIL();
  1065                 TInt focusIndex = iMediaList->FocusIndex();
  1106                 TInt focusIndex = iMediaList->FocusIndex();
  1066                 if (focusIndex != KErrNotFound
  1107                 if (focusIndex != KErrNotFound && EUiOn == GetUiState())
  1067                         && EUiOn == GetUiState()
       
  1068                         && iMediaList->Item(focusIndex).Category()
       
  1069                                 == EMPXVideo)
       
  1070                     {
  1108                     {
  1071                     // hide the slider
  1109                     // show/hide the slider
  1072                     if (iSliderWidget)
  1110                     if (iSliderWidget)
  1073                         {
  1111                         {
  1074                         iSliderWidget->ShowWidget(EFalse);
  1112                         iSliderWidget->ShowWidget(CheckIfSliderToBeShownL());
  1075                         }
  1113                         }
  1076                     }
  1114                     }
  1077                 return EEventConsumed;
  1115                 return EEventConsumed;
  1078                 }
  1116                 }
  1079             case ETypeHighlight:
  1117             case ETypeHighlight:
  1167 		    break;
  1205 		    break;
  1168 		    }
  1206 		    }
  1169 		case EGlxCmdFullScreenBack:
  1207 		case EGlxCmdFullScreenBack:
  1170 		    SetSliderLevel();
  1208 		    SetSliderLevel();
  1171 		    DeactivateZoomControlL();
  1209 		    DeactivateZoomControlL();
       
  1210 			//Show the screen furniture when we press back from zoom
       
  1211 		    ShowUiL(ETrue);
  1172 		    consumed = ETrue;
  1212 		    consumed = ETrue;
  1173 		    break;
  1213 		    break;
  1174 		case EGlxCmdRenameCompleted:
  1214 		case EGlxCmdRenameCompleted:
  1175 		    {
  1215 		    {
  1176             SetItemToHDMIL();
  1216             SetItemToHDMIL();
  1394                 }
  1434                 }
  1395             }
  1435             }
  1396         
  1436         
  1397         //check if any Error message is to be displayed
  1437         //check if any Error message is to be displayed
  1398         TMPXGeneralCategory cat = media.Category();
  1438         TMPXGeneralCategory cat = media.Category();
  1399         TBool checkViewRights = (cat == EMPXImage);
  1439         TBool checkViewRights = ETrue;
  1400         if (iDrmUtility->ItemRightsValidityCheckL(media.Uri(),
  1440         
  1401                 checkViewRights) && tnError != KErrNone)
  1441         if(iImgViewerMode && iImageViewerInstance->IsPrivate())
       
  1442             {
       
  1443             checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
       
  1444                     iImageViewerInstance->ImageFileHandle(),
       
  1445                     (media.Category() == EMPXImage));
       
  1446             }
       
  1447         else
       
  1448             {
       
  1449             //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
       
  1450             checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
       
  1451                     media.Uri(), (media.Category() == EMPXImage));
       
  1452             }
       
  1453         
       
  1454         if (checkViewRights && tnError != KErrNone)
  1402             {
  1455             {
  1403             if (iPeriodic->IsActive())
  1456             if (iPeriodic->IsActive())
  1404                 {
  1457                 {
  1405                 iPeriodic->Cancel();
  1458                 iPeriodic->Cancel();
  1406                 }
  1459                 }
  1432     TRACER("CGlxFullScreenViewImp::ConsumeDRMRightsL");
  1485     TRACER("CGlxFullScreenViewImp::ConsumeDRMRightsL");
  1433     const TDesC& uri = aMedia.Uri();
  1486     const TDesC& uri = aMedia.Uri();
  1434     if (uri.Length() > 0)
  1487     if (uri.Length() > 0)
  1435         {
  1488         {
  1436         // check if rights have expired
  1489         // check if rights have expired
  1437         TBool expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue);
  1490         TBool expired = EFalse;
       
  1491         if (iImgViewerMode && iImageViewerInstance->IsPrivate())
       
  1492             {
       
  1493             expired = !iDrmUtility->ItemRightsValidityCheckL(
       
  1494                     iImageViewerInstance->ImageFileHandle(),
       
  1495                     ETrue);
       
  1496             }
       
  1497         else
       
  1498             {
       
  1499             expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue);
       
  1500             }
       
  1501 
  1438         if (expired)
  1502         if (expired)
  1439             {
  1503             {
  1440             if (iPeriodic->IsActive())
  1504             if (iPeriodic->IsActive())
  1441                 {
  1505                 {
  1442                 iPeriodic->Cancel();
  1506                 iPeriodic->Cancel();
  1443                 }
  1507                 }
  1444             iBusyIcon->ShowBusyIconL(EFalse);
  1508             iBusyIcon->ShowBusyIconL(EFalse);
  1445             iDrmUtility->ShowRightsInfoL(uri);
  1509             if(iImgViewerMode && iImageViewerInstance->IsPrivate())
       
  1510                 {
       
  1511                 iDrmUtility->ShowRightsInfoL(iImageViewerInstance->ImageFileHandle());
       
  1512                 }
       
  1513             else
       
  1514                 {
       
  1515                 iDrmUtility->ShowRightsInfoL(uri);
       
  1516                 }
  1446             return;
  1517             return;
  1447             }
  1518             }
  1448 
  1519 
  1449         TSize tnSize = iUiUtility->DisplaySize();
  1520         TSize tnSize = iUiUtility->DisplaySize();
  1450         TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1521         TMPXAttribute qtyTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail,
  1463                 {
  1534                 {
  1464                 iPeriodic->Cancel();
  1535                 iPeriodic->Cancel();
  1465                 }
  1536                 }
  1466             GLX_LOG_INFO("CGlxFullScreenViewImp::ConsumeDRMRightsL()"
  1537             GLX_LOG_INFO("CGlxFullScreenViewImp::ConsumeDRMRightsL()"
  1467                     "- ConsumeRights");
  1538                     "- ConsumeRights");
  1468             iDrmUtility->ConsumeRightsL(uri);
  1539             if(iImgViewerMode && iImageViewerInstance->IsPrivate())
       
  1540                 {
       
  1541                 iDrmUtility->ConsumeRightsL(iImageViewerInstance->ImageFileHandle());
       
  1542                 }
       
  1543             else
       
  1544                 {
       
  1545                 iDrmUtility->ConsumeRightsL(uri);
       
  1546                 }
  1469             }
  1547             }
  1470         }
  1548         }
  1471     }
  1549     }
  1472 
  1550 
  1473 // ---------------------------------------------------------------------------
  1551 // ---------------------------------------------------------------------------
  1555 void CGlxFullScreenViewImp::SetItemToHDMIL()
  1633 void CGlxFullScreenViewImp::SetItemToHDMIL()
  1556     {
  1634     {
  1557     TRACER("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi");
  1635     TRACER("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi");
  1558 
  1636 
  1559     TInt focusIndex = iMediaList->FocusIndex();
  1637     TInt focusIndex = iMediaList->FocusIndex();
  1560 
  1638     
  1561     // If we dont know what item we are focussing on 
  1639     // If we dont know what item we are focussing on 
  1562     // or if out medialist is empty
  1640     // or if out medialist is empty
  1563     // or if HDMI is not connected 
  1641     // or if HDMI is not connected 
  1564     // or if there is no HDMI Controller at all 
  1642     // or if there is no HDMI Controller at all 
  1565     // then dont SetImageToHDMI :)  
  1643     // then dont SetImageToHDMI :)  
  1566     if( ( KErrNotFound == focusIndex)
  1644     if( ( KErrNotFound == focusIndex)
  1567             || (0 == iMediaList->Count())
  1645             || (0 == iMediaList->Count())
  1568             || (NULL == iHdmiController)) 
  1646             || (NULL == iHdmiController)) 
  1569         {
  1647         {
  1570         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - Cant Set Image To HDMI");
  1648         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi- Cant Set Image To HDMI");
  1571         return;
  1649         return;
  1572         }
  1650         }
  1573     
  1651     
  1574     TGlxMedia item = iMediaList->Item(focusIndex);
  1652     TGlxMedia item = iMediaList->Item(focusIndex);
  1575     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(),
  1653     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(),
  1625             else
  1703             else
  1626                 {
  1704                 {
  1627                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting Default Bitmap");
  1705                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting Default Bitmap");
  1628                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1706                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1629                 resFile.Append(KGlxIconsFilename);
  1707                 resFile.Append(KGlxIconsFilename);
  1630                 CFbsBitmap* defaultBitmap = new (ELeave) CFbsBitmap;
  1708                 CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
       
  1709                         EMbmGlxiconsQgn_prop_image_notcreated);
  1631                 CleanupStack::PushL(defaultBitmap);
  1710                 CleanupStack::PushL(defaultBitmap);
  1632                 defaultBitmap = AknIconUtils::CreateIconL(resFile,
  1711                 
  1633                         EMbmGlxiconsQgn_prop_image_notcreated);
  1712                 // always need to setsize on the raw bitmap for it to be visible
       
  1713                 AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
       
  1714 
  1634                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
  1715                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
  1635                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1716                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1636                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
  1717                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
  1637                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1718                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1638                 }
  1719                 }
  1639             }
  1720             }
  1640         }
  1721         }
  1641     else
  1722     else
  1642         {
  1723         {
  1643         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - Unsupported Item");
  1724         GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Unsupported Item");
  1644         //Set the external display to cloning mode if
  1725         //Set the external display to cloning mode if
  1645         //the current item is something we dont support 
  1726         //the current item is something we dont support 
  1646         //(e.g. video, corrupted item, item with invalid DRM)
  1727         //(e.g. video, corrupted item, item with invalid DRM)
  1647         iHdmiController->ItemNotSupported();
  1728         iHdmiController->ItemNotSupported();
  1648         }
  1729         }
  1731         TRAP_IGNORE(const_cast<CAlfLayout&>
  1812         TRAP_IGNORE(const_cast<CAlfLayout&>
  1732                 (iCoverFlowWidget->ContainerLayout()).SetEffectL(
  1813                 (iCoverFlowWidget->ContainerLayout()).SetEffectL(
  1733                                                      KTfxResourceNoEffect));
  1814                                                      KTfxResourceNoEffect));
  1734         }
  1815         }
  1735     }
  1816     }
       
  1817 
       
  1818 // -----------------------------------------------------------------------------
       
  1819 // CreateImageViewerInstanceL
       
  1820 // -----------------------------------------------------------------------------
       
  1821 //
       
  1822 void CGlxFullScreenViewImp::CreateImageViewerInstanceL()
       
  1823     {
       
  1824     TRACER("CGlxFullScreenViewImp::CreateImageViewerInstanceL");
       
  1825     iImageViewerInstance = CGlxImageViewerManager::InstanceL();    
       
  1826     __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer));
       
  1827     }
       
  1828 
       
  1829 // -----------------------------------------------------------------------------
       
  1830 // DeleteImageViewerInstance
       
  1831 // -----------------------------------------------------------------------------
       
  1832 //
       
  1833 void CGlxFullScreenViewImp::DeleteImageViewerInstance()
       
  1834     {
       
  1835     TRACER("CGlxFullScreenViewImp::DeleteImageViewerInstance");
       
  1836     if ( iImageViewerInstance )
       
  1837         {
       
  1838         iImageViewerInstance->DeleteInstance();
       
  1839         }
       
  1840     }
       
  1841 	
       
  1842 // -----------------------------------------------------------------------------
       
  1843 // HandleTvStatusChangedL 
       
  1844 // -----------------------------------------------------------------------------
       
  1845 void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType )
       
  1846     {
       
  1847     TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()");
       
  1848     // Hide UI furnitures when HDMI cable is connected/Disconnected
       
  1849     // irrespective of UI state on/off.
       
  1850     if (aChangeType == ETvConnectionChanged)
       
  1851         {
       
  1852         HideUi(ETrue);
       
  1853         }
       
  1854     }
       
  1855 
       
  1856 // ---------------------------------------------------------------------------
       
  1857 // CheckIfSliderToBeShownL
       
  1858 // ---------------------------------------------------------------------------
       
  1859 TBool CGlxFullScreenViewImp::CheckIfSliderToBeShownL()
       
  1860     {
       
  1861     TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()");
       
  1862 
       
  1863     TInt index = iMediaList->FocusIndex();
       
  1864     const TGlxMedia& item = iMediaList->Item(index);
       
  1865     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail);
       
  1866        
       
  1867     TBool isDrmRightsValid = ETrue;
       
  1868 	if(item.IsDrmProtected())
       
  1869 		{
       
  1870         if (iImgViewerMode && iImageViewerInstance->IsPrivate())
       
  1871             {
       
  1872             isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
       
  1873                     iImageViewerInstance->ImageFileHandle(), (item.Category()
       
  1874                             == EMPXImage));
       
  1875             }
       
  1876         else
       
  1877             {
       
  1878             //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
       
  1879             isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
       
  1880                     item.Uri(), (item.Category() == EMPXImage));
       
  1881             }
       
  1882         }
       
  1883 	
       
  1884     // Display slider only for non corrupted images and items with valid DRM license
       
  1885 	if (iHdmiController
       
  1886                 && iHdmiController->IsHDMIConnected())
       
  1887         {
       
  1888         //hide slider if UI is needed to be on and HDMI is Connected
       
  1889 		return EFalse;
       
  1890         }
       
  1891     else if(error == KErrNone && item.Category() == EMPXImage
       
  1892             && isDrmRightsValid )
       
  1893         {
       
  1894         return ETrue;
       
  1895         }
       
  1896     return EFalse;
       
  1897     }