photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp
branchRCL_3
changeset 22 2dac0fdba72b
parent 18 bcb43dc84c44
child 25 191387a8b767
equal deleted inserted replaced
18:bcb43dc84c44 22:2dac0fdba72b
   162 	
   162 	
   163 	iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   163 	iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   164 	//Register the view to recieve toolbar events. ViewBase handles the events
   164 	//Register the view to recieve toolbar events. ViewBase handles the events
   165 	SetToolbarObserver(this);
   165 	SetToolbarObserver(this);
   166 	iImgViewerMode = EFalse;
   166 	iImgViewerMode = EFalse;
   167 	// Presently image viewer dont have toolbar
   167     //Disable the toolbar always while entering fullscreen
   168 	// So need to remove if image viewer using full screen
   168 	EnableFSToolbarL(EFalse);
   169 	CGlxNavigationalState* navigationalState =  CGlxNavigationalState::InstanceL();
   169     ShowToolbarOnViewActivation(EFalse);
   170 	CleanupClosePushL( *navigationalState );
       
   171 	CMPXCollectionPath* naviState = navigationalState->StateLC();
       
   172 	if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
       
   173 	    {
       
   174 	    CAknToolbar* toolbar = Toolbar();
       
   175 	    if(toolbar)
       
   176 	        {
       
   177 	        toolbar->DisableToolbarL(ETrue);
       
   178 	        }
       
   179 	    ShowToolbarOnViewActivation(EFalse);
       
   180 	    }
       
   181 	else
       
   182 	    {
       
   183 	    ShowToolbarOnViewActivation(ETrue);
       
   184 	    }
       
   185 	CleanupStack::PopAndDestroy(naviState);
       
   186 	CleanupStack::PopAndDestroy(navigationalState);
       
   187 	
       
   188 	
   170 	
   189 	//Get the ScreenFurniture instance
   171 	//Get the ScreenFurniture instance
   190 	iScreenFurniture = iUiUtility->ScreenFurniture();
   172 	iScreenFurniture = iUiUtility->ScreenFurniture();
   191 	
   173 	
   192     //Get the env from the uiutilities
   174     //Get the env from the uiutilities
   304 void CGlxFullScreenViewImp::DoMLViewActivateL(
   286 void CGlxFullScreenViewImp::DoMLViewActivateL(
   305 		const TVwsViewId & /* aPrevViewId */, TUid /* aCustomMessageId */,
   287 		const TVwsViewId & /* aPrevViewId */, TUid /* aCustomMessageId */,
   306 		const TDesC8 & /* aCustomMessage */)
   288 		const TDesC8 & /* aCustomMessage */)
   307 	{
   289 	{
   308     TRACER("CGlxFullScreenViewImp::DoMLViewActivateL");
   290     TRACER("CGlxFullScreenViewImp::DoMLViewActivateL");
       
   291 	//Disable the softkeys
       
   292     Cba()->MakeVisible( EFalse );
       
   293     Cba()->DrawNow();
       
   294     
   309     // hide the toolbar
   295     // hide the toolbar
   310     CAknToolbar* toolbar = Toolbar();
   296     EnableFSToolbarL(EFalse);
   311     if(toolbar)
   297     
   312         {
       
   313         toolbar->SetToolbarVisibility(EFalse); 
       
   314         }
       
   315 
   298 
   316     CGlxNavigationalState* navigationalState =  CGlxNavigationalState::InstanceL();
   299     CGlxNavigationalState* navigationalState =  CGlxNavigationalState::InstanceL();
   317     CleanupClosePushL( *navigationalState );
   300     CleanupClosePushL( *navigationalState );
   318     CMPXCollectionPath* naviState = navigationalState->StateLC();
   301     CMPXCollectionPath* naviState = navigationalState->StateLC();
   319     
   302     
   355    	GlxSetAppState::SetState(EGlxInFullScreenView);
   338    	GlxSetAppState::SetState(EGlxInFullScreenView);
   356    	 
   339    	 
   357     // create the coverflow
   340     // create the coverflow
   358     CreateCoverflowWidgetL();
   341     CreateCoverflowWidgetL();
   359     
   342     
   360     // create the screen furniture for touch devices
       
   361     CreateScreenFurnitureL();
       
   362     
       
   363     CreateSliderWidgetL();
   343     CreateSliderWidgetL();
   364     
   344     
   365     iBusyIcon = CGlxFullScreenBusyIcon::NewL(*iMediaList,*iUiUtility);
   345     iBusyIcon = CGlxFullScreenBusyIcon::NewL(*iMediaList,*iUiUtility);
   366     // create a zoom control
   346     // create a zoom control
   367     iZoomControl = CGlxZoomControl::NewL(*this, *iMediaList,
   347     iZoomControl = CGlxZoomControl::NewL(*this, *iMediaList,
   517         {
   497         {
   518 		// This is done to set the item counter
   498 		// This is done to set the item counter
   519         iCoverFlowWidget->SetUIMode(ETrue);
   499         iCoverFlowWidget->SetUIMode(ETrue);
   520         }
   500         }
   521 
   501 
   522     //show the toolbar
   502     //Since the toolbar should not be present for ImageViewer.
   523     CAknToolbar* toolbar = Toolbar();
   503     if(!iImgViewerMode)
   524     if(toolbar)
   504         {
   525         {
   505         //show the toolbar
   526         toolbar->SetToolbarVisibility(ETrue);    
   506         EnableFSToolbarL(ETrue);
   527         }
   507         }
   528      
   508      
   529     // For floating toolbar in non-touch devices
   509     // For floating toolbar in non-touch devices
   530     iScreenFurniture->SetToolbarVisibility(ETrue);
   510     iScreenFurniture->SetToolbarVisibility(ETrue);
   531     //show the softkeys
   511     //show the softkeys
   563 
   543 
   564     if (iCoverFlowWidget)
   544     if (iCoverFlowWidget)
   565         {
   545         {
   566         iCoverFlowWidget->SetUIMode(EFalse);
   546         iCoverFlowWidget->SetUIMode(EFalse);
   567         }
   547         }
   568     // hide the toolbar
   548     
   569     CAknToolbar* toolbar = Toolbar();
   549     //Since the toolbar should not be present for ImageViewer.
   570     if(toolbar)
   550     if(!iImgViewerMode)
   571         {
   551         {
   572         toolbar->SetToolbarVisibility(EFalse); 
   552         // hide the toolbar
   573         }    
   553         CAknToolbar* toolbar = Toolbar();
       
   554         if(toolbar)
       
   555             {
       
   556             toolbar->SetToolbarVisibility(EFalse); 
       
   557             }
       
   558         }
   574     
   559     
   575     // hide the softkeys
   560     // hide the softkeys
   576     Cba()->MakeVisible( EFalse );
   561     Cba()->MakeVisible( EFalse );
   577     Cba()->DrawNow();
   562     Cba()->DrawNow();
   578  
   563  
   579     // set the ui state to On
   564     // set the ui state to On
   580     SetUiSate(NGlxNFullScreenUIState::EUiOff);
   565     SetUiSate(NGlxNFullScreenUIState::EUiOff);
   581     }
       
   582 
       
   583 // ---------------------------------------------------------------------------
       
   584 // CreateScreenFurnitureL
       
   585 // ---------------------------------------------------------------------------
       
   586 //	
       
   587 void  CGlxFullScreenViewImp::CreateScreenFurnitureL() 
       
   588     {
       
   589     TRACER("CGlxFullScreenViewImp::CreateScreenFurnitureL");
       
   590     // create the softkeys
       
   591     CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
       
   592     CleanupStack::PushL( cba );
       
   593     cba->SetCommandSetL(R_GLX_FULLSCREEN_SOFTKEYS);
       
   594     CleanupStack::Pop(cba);
       
   595     }
   566     }
   596 
   567 
   597 // ---------------------------------------------------------------------------
   568 // ---------------------------------------------------------------------------
   598 // SetUiSate
   569 // SetUiSate
   599 // ---------------------------------------------------------------------------
   570 // ---------------------------------------------------------------------------
   769 // ---------------------------------------------------------------------------
   740 // ---------------------------------------------------------------------------
   770 //
   741 //
   771 void CGlxFullScreenViewImp::DoMLViewDeactivate()
   742 void CGlxFullScreenViewImp::DoMLViewDeactivate()
   772     {
   743     {
   773     TRACER("CGlxFullScreenViewImp::DoMLViewDeactivate");
   744     TRACER("CGlxFullScreenViewImp::DoMLViewDeactivate");
       
   745 	//Disabling the toolbar here since it would give a crash when
       
   746 	//we try to enable the toolbar in activate without exiting photos.
       
   747     if(!iImgViewerMode)
       
   748         {    
       
   749         // hide the toolbar
       
   750         TRAP_IGNORE(EnableFSToolbarL(EFalse));
       
   751         }
       
   752     
       
   753     HideUi(ETrue); 
       
   754 	// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. 
       
   755 	// So we do the below trick. The SK overlap is still there but much much less noticable. 
       
   756     CCoeEnv::Static()->WsSession().Flush(); 
       
   757 
   774     //Clear the last uri for which DRM Rights were consumed before going back to grid view
   758     //Clear the last uri for which DRM Rights were consumed before going back to grid view
   775     //since the GridView::Activate() and FullScreen::DeActivate() can be called in any order,
   759     //since the GridView::Activate() and FullScreen::DeActivate() can be called in any order,
   776     //this call is being made to be on safer side
   760     //this call is being made to be on safer side
   777     iDrmUtility->ClearLastConsumedItemUriL();
   761     iDrmUtility->ClearLastConsumedItemUriL();
   778     iScreenFurniture->ViewDeactivated(iViewUid);
   762     iScreenFurniture->ViewDeactivated(iViewUid);
   826         iZoomControl->HandleZoomForegroundEvent(aForeground);
   810         iZoomControl->HandleZoomForegroundEvent(aForeground);
   827         }
   811         }
   828 
   812 
   829     if (!aForeground)
   813     if (!aForeground)
   830         {
   814         {
   831         
       
   832         if(iHdmiController)
   815         if(iHdmiController)
   833 			{   
   816 			{   
   834             iHdmiController->ShiftToCloningMode();
   817             iHdmiController->ShiftToCloningMode();
   835 			}
   818 			}
   836         
       
   837         iUiUtility->GlxTextureManager().FlushTextures();
   819         iUiUtility->GlxTextureManager().FlushTextures();
   838         }
   820         }
   839     else
   821     else
   840         {
   822         {
   841         if (iMediaList && iMediaList->Count() && iMediaListMulModelProvider)
   823         if (iMediaList && iMediaList->Count() && iMediaListMulModelProvider)
   916             case EStdKeyApplicationD: 
   898             case EStdKeyApplicationD: 
   917                 {
   899                 {
   918                 if ( NGlxNFullScreenUIState::EUiOff == GetUiSate()&& (
   900                 if ( NGlxNFullScreenUIState::EUiOff == GetUiSate()&& (
   919                         aEvent.Code() == EEventKey ) )
   901                         aEvent.Code() == EEventKey ) )
   920                     {
   902                     {
   921                     //the Ui timer sjould be started once the UI screen furniture is shown
   903                     //the Ui timer should be started once the UI screen furniture is shown
   922                     ShowUiL(ETrue);
   904                     ShowUiL(ETrue);
   923                     } 
   905                     } 
   924                 return EEventHandled;              
   906                 return EEventHandled;              
   925                 }
   907                 }
   926             case EStdKeyLeftArrow:
   908             case EStdKeyLeftArrow:
   947             default:
   929             default:
   948                 return EEventNotHandled;
   930                 return EEventNotHandled;
   949             }
   931             }
   950         }
   932         }
   951     if(!aEvent.IsCustomEvent())
   933     if(!aEvent.IsCustomEvent())
   952             {   
   934         {   
   953             GLX_LOG_INFO("Event Not Handled");          
   935         GLX_LOG_INFO("Event Not Handled");          
   954             return EEventNotHandled;
   936         return EEventNotHandled;
   955             }
   937         }
   956 
   938 
   957     if(aEvent.IsCustomEvent())
   939     if(aEvent.IsCustomEvent())
   958         {
   940         {
   959         TInt eventId = aEvent.CustomParameter();
   941         TInt eventId = aEvent.CustomParameter();
   960         
   942         
  1563         SetSliderLevel();
  1545         SetSliderLevel();
  1564         DeactivateZoomControlL();   
  1546         DeactivateZoomControlL();   
  1565         }
  1547         }
  1566     ProcessCommandL(EAknSoftkeyExit);
  1548     ProcessCommandL(EAknSoftkeyExit);
  1567     }
  1549     }
       
  1550 	
       
  1551 // ---------------------------------------------------------------------------
       
  1552 // EnableFSToolbarL
       
  1553 // 
       
  1554 // ---------------------------------------------------------------------------
       
  1555 //
       
  1556 void CGlxFullScreenViewImp::EnableFSToolbarL(TBool aEnable)
       
  1557     {
       
  1558 	TRACER("CGlxFullScreenViewImp::EnableFSToolbarL()");
       
  1559     CAknToolbar* toolbar = Toolbar();
       
  1560     if(toolbar)
       
  1561         {
       
  1562         toolbar->DisableToolbarL(!aEnable);
       
  1563         toolbar->SetToolbarVisibility(aEnable); 
       
  1564         }
       
  1565     }
       
  1566