photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp
branchRCL_3
changeset 9 6b87b143d312
parent 4 57d388cc48c1
child 13 71da52165949
equal deleted inserted replaced
5:f7f0874bfe7d 9:6b87b143d312
   112     iDisplay->Roster().ShowL( *iControlGroup);
   112     iDisplay->Roster().ShowL( *iControlGroup);
   113 
   113 
   114     // Hide the Zoom at the construction
   114     // Hide the Zoom at the construction
   115     ShowZoom(EFalse);
   115     ShowZoom(EFalse);
   116     iZoomActive = EFalse;
   116     iZoomActive = EFalse;
   117 	iIsHDMIconnected = EFalse;
       
   118 	
   117 	
   119     //To know if HDMi cable is connected.
   118     //To know if HDMi cable is connected.
   120     iGlxTvOut = CGlxTv::NewL(*this);
   119     iGlxTvOut = CGlxTv::NewL(*this);
   121     iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   120     iTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   122     }
   121     }
   272 // -----------------------------------------------------------------------------
   271 // -----------------------------------------------------------------------------
   273 // ActivateL:Activates the Zoom Control,set the image visual ,do the initial setup
   272 // ActivateL:Activates the Zoom Control,set the image visual ,do the initial setup
   274 // -----------------------------------------------------------------------------
   273 // -----------------------------------------------------------------------------
   275 //
   274 //
   276 EXPORT_C void CGlxZoomControl::ActivateL(TInt aInitialZoomRatio, TZoomStartMode aStartMode, 
   275 EXPORT_C void CGlxZoomControl::ActivateL(TInt aInitialZoomRatio, TZoomStartMode aStartMode, 
   277         TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus)
   276         TInt aFocusIndex, TGlxMedia& aItem, TPoint* aZoomFocus,TBool aViewingMode)
   278     {
   277     {
   279     TRACER("CGlxZoomControl::ActivateL()");
   278     TRACER("CGlxZoomControl::ActivateL()");
   280 
   279 
   281     //To know if HDMi cable is connected.
   280     //To know if HDMi cable is connected.
   282     if ( !iZoomActive )
   281     if ( !iZoomActive )
   291         iImageTexture = &(iTextureMgr->CreateNewTextureForMediaL(
   290         iImageTexture = &(iTextureMgr->CreateNewTextureForMediaL(
   292                 ScreenSize(),aItem, idspace, this ));
   291                 ScreenSize(),aItem, idspace, this ));
   293         iImageVisual->SetImage(*iImageTexture);
   292         iImageVisual->SetImage(*iImageTexture);
   294         
   293         
   295         
   294         
   296         if(iGlxTvOut->IsHDMIConnected())
   295         if(iGlxTvOut->IsHDMIConnected()&& !aViewingMode )
   297             {
   296             {
   298             iIsHDMIconnected = ETrue;
       
   299             StartZoomAnimation();
   297             StartZoomAnimation();
   300             }
   298             }
   301         else
   299         else
   302             {
   300             {
   303             ShowZoom(ETrue);
   301             ShowZoom(ETrue);
   414 // ----------------------------------------------------------------------------------
   412 // ----------------------------------------------------------------------------------
   415 //
   413 //
   416 EXPORT_C void CGlxZoomControl::Deactivate()
   414 EXPORT_C void CGlxZoomControl::Deactivate()
   417     {
   415     {
   418     TRACER("CGlxZoomControl::Deactivate()");
   416     TRACER("CGlxZoomControl::Deactivate()");
   419     iIsHDMIconnected = EFalse;
   417     
   420 
       
   421     if ( iZoomActive )
   418     if ( iZoomActive )
   422         {
   419         {
   423          if(iTimer->IsActive())
   420          if(iTimer->IsActive())
   424            {
   421            {
   425            iTimer->Cancel();           
   422            iTimer->Cancel();           
   889 // HandleTvStatusChangedL 
   886 // HandleTvStatusChangedL 
   890 // -----------------------------------------------------------------------------
   887 // -----------------------------------------------------------------------------
   891 void CGlxZoomControl::HandleTvStatusChangedL( TTvChangeType aChangeType )
   888 void CGlxZoomControl::HandleTvStatusChangedL( TTvChangeType aChangeType )
   892     {
   889     {
   893     TRACER("CGlxZoomControl::HandleTvStatusChangedL()");
   890     TRACER("CGlxZoomControl::HandleTvStatusChangedL()");
   894     if ( aChangeType == ETvConnectionChanged && !iIsHDMIconnected && iZoomActive)          
   891     if ( aChangeType == ETvConnectionChanged )          
   895         {
   892         {
   896         if ( iGlxTvOut->IsHDMIConnected() )
   893         if ( iGlxTvOut->IsHDMIConnected() && iZoomActive)
   897             {
   894             {
   898             //go to fullscreen.
   895             //initialise all the zoom values to full-screen when hdmi is connected.
   899             HandleZoomOutL(KGlxZoomOutCommand);
   896             if(iEventHandler)
       
   897                 {
       
   898                 iEventHandler->ZoomToMinimumL();
       
   899                 }
   900             }
   900             }
   901         }
   901         }
   902     }
   902     }
   903 
   903 
   904 
   904