photosgallery/slideshow/view/src/shwslideshowview.cpp
branchRCL_3
changeset 32 78ad99c24f08
parent 30 a60acebbbd9d
child 35 420f6808bf21
equal deleted inserted replaced
30:a60acebbbd9d 32:78ad99c24f08
   248 	        {
   248 	        {
   249 	        // The list should now be populated, so set the focus
   249 	        // The list should now be populated, so set the focus
   250 	       	SetListFocusL();
   250 	       	SetListFocusL();
   251 	       	// Need to take latest screen size as layout has changed
   251 	       	// Need to take latest screen size as layout has changed
   252 	       	TRect currentScreen;
   252 	       	TRect currentScreen;
   253 	       	TSize screenSize;
       
   254 	       	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen,currentScreen);
   253 	       	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen,currentScreen);
   255 	       	screenSize = currentScreen.Size();
   254 	       	iScrnSize = currentScreen.Size();
       
   255 
       
   256 	       	iHdmiWidth = (iScrnSize.iWidth > iScrnSize.iHeight ?
       
   257                                 iScrnSize.iWidth :iScrnSize.iHeight);
       
   258 	        iHdmiHeight = (iScrnSize.iWidth < iScrnSize.iHeight ?
       
   259                                 iScrnSize.iWidth :iScrnSize.iHeight);
       
   260 
   256 	    	iEngine->StartL( 
   261 	    	iEngine->StartL( 
   257 	    	    *iEnv, *iDisplay, *iFilteredList, *this, screenSize );
   262 	    	    *iEnv, *iDisplay, *iFilteredList, *this, iScrnSize );
   258 	        }
   263 	        }
   259         }  
   264         }  
   260     // return value needed as this is a TCallBack
   265     // return value needed as this is a TCallBack
   261     return KErrNone;
   266     return KErrNone;
   262     }
   267     }
   327     // Create the back light timer
   332     // Create the back light timer
   328     iBackLightTimer = CShwSlideshowBackLightTimer::NewL();
   333     iBackLightTimer = CShwSlideshowBackLightTimer::NewL();
   329     
   334     
   330 	iEnv = iUiUtility->Env();
   335 	iEnv = iUiUtility->Env();
   331    	iDisplay = iUiUtility->Display();
   336    	iDisplay = iUiUtility->Display();
   332    	iScrnSize = iUiUtility->DisplaySize();
       
   333    	iGridIconSize = iUiUtility->GetGridIconSize();
   337    	iGridIconSize = iUiUtility->GetGridIconSize();
   334    	
   338    	
   335     // Construct the volume control
   339     // Construct the volume control
   336     iVolumeControl = CShwSlideshowVolumeControl::
   340     iVolumeControl = CShwSlideshowVolumeControl::
   337         NewL( *iEnv,
   341         NewL( *iEnv,
   493     
   497     
   494     InitializeShwFurnitureL();
   498     InitializeShwFurnitureL();
   495     iUiUtility->Display()->SetVisibleArea(TRect(TPoint(0,0),AlfUtil::ScreenSize()));
   499     iUiUtility->Display()->SetVisibleArea(TRect(TPoint(0,0),AlfUtil::ScreenSize()));
   496 	// We will require to act on events ONLY when the view is active.
   500 	// We will require to act on events ONLY when the view is active.
   497 	// So listen to them only when the view is active.
   501 	// So listen to them only when the view is active.
   498     iShwGestureControl->AddObserver(this);
   502     iShwGestureControl->AddObserver(this);    
   499 
       
   500     }
   503     }
   501 
   504 
   502 // -----------------------------------------------------------------------------
   505 // -----------------------------------------------------------------------------
   503 // From CGlxViewBase
   506 // From CGlxViewBase
   504 // DoViewDeactivate.
   507 // DoViewDeactivate.
  1242 // ProcessCommandL.
  1245 // ProcessCommandL.
  1243 // handle softkey events
  1246 // handle softkey events
  1244 // -----------------------------------------------------------------------------
  1247 // -----------------------------------------------------------------------------
  1245 //
  1248 //
  1246 void CShwSlideshowView::ProcessCommandL(TInt aCommandId)
  1249 void CShwSlideshowView::ProcessCommandL(TInt aCommandId)
  1247 	{
  1250     {
  1248 	TRACER("CShwSlideshowView::ProcessCommandL");
  1251     TRACER("CShwSlideshowView::ProcessCommandL");
  1249 	GLX_LOG_INFO( "CShwSlideshowView::ProcessCommandL" );
  1252     GLX_LOG_INFO( "CShwSlideshowView::ProcessCommandL" );
  1250 	switch(aCommandId)
  1253     switch(aCommandId)
  1251 		{
  1254         {
  1252         case EShwSlideshowCmdEnd:
  1255         case EShwSlideshowCmdEnd:
  1253         	{
  1256             {
  1254         	iShwState = EShwExiting;
  1257             iShwState = EShwExiting;
  1255         	aCommandId = EAknSoftkeyBack;
  1258             aCommandId = EAknSoftkeyBack;
  1256         	iDisplay->Roster().Hide( *iGestureControlGroup );        
  1259             iDisplay->Roster().Hide( *iGestureControlGroup );        
  1257         	break;
  1260             break;
  1258         	}
  1261             }
  1259         //When user presses MSK or LSK this cmd will Generated
  1262             //When user presses MSK or LSK this cmd will Generated
  1260         case EShwSlideshowCmdPause:
  1263         case EShwSlideshowCmdPause:
  1261 		case EShwSlideshowCmdContinue:
  1264         case EShwSlideshowCmdContinue:
  1262 			{
  1265             {
  1263 					// If MSK preesed to toggle visibility of softekey
  1266             // If MSK preesed to toggle visibility of softekey
  1264 					if(iMSKPressed)
  1267             if(iMSKPressed)
  1265 		                {
  1268                 {
  1266 		                iMSKPressed = EFalse;
  1269                 iMSKPressed = EFalse;
  1267 		                }            
  1270                 }            
  1268 		            else if(iLSKPressed)
  1271             else if(iLSKPressed)
  1269 		                {
  1272                 {
  1270 		                iLSKPressed = EFalse;// Already Handlled
  1273                 iLSKPressed = EFalse;// Already Handlled
  1271 		                }
  1274                 }
  1272 		            else
  1275             else
  1273 		                {
  1276                 {
  1274 		                iPauseHandler->UserToggledPauseL();
  1277                 iPauseHandler->UserToggledPauseL();
  1275 		                }
  1278                 }
  1276 		            break;  
  1279             break;  
  1277 					}
  1280             }
  1278 
  1281 
  1279         default:
  1282         default:
  1280         	{
  1283             {
  1281         	break;
  1284             break;
  1282         	}
  1285             }
  1283 		}
  1286         }
  1284 	CGlxViewBase::ProcessCommandL(aCommandId);
  1287     CGlxViewBase::ProcessCommandL(aCommandId);
  1285 	}
  1288     }
  1286 // ----------------------------------------------------------------------------- 
  1289 // ----------------------------------------------------------------------------- 
  1287 // Set the image to external display - HDMI
  1290 // Set the image to external display - HDMI
  1288 // -----------------------------------------------------------------------------
  1291 // -----------------------------------------------------------------------------
  1289 //
  1292 //
  1290 void CShwSlideshowView::SetItemToHDMIL()
  1293 void CShwSlideshowView::SetItemToHDMIL()
  1358             else
  1361             else
  1359                 {
  1362                 {
  1360                 GLX_LOG_INFO("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Setting Null Bitmap");
  1363                 GLX_LOG_INFO("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Setting Null Bitmap");
  1361                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1364                 TFileName resFile(KDC_APP_BITMAP_DIR);
  1362                 resFile.Append(KGlxIconsFilename);
  1365                 resFile.Append(KGlxIconsFilename);
  1363                 CFbsBitmap* defaultBitmap = new (ELeave) CFbsBitmap;
  1366                 CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
       
  1367                         EMbmGlxiconsQgn_prop_image_notcreated);
  1364                 CleanupStack::PushL(defaultBitmap);
  1368                 CleanupStack::PushL(defaultBitmap);
  1365                 defaultBitmap = AknIconUtils::CreateIconL(resFile,
  1369                 
  1366                         EMbmGlxiconsQgn_prop_image_notcreated);
  1370                 // always need to setsize on the raw bitmap for it to be visible
       
  1371                 AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
       
  1372                 
  1367                 GLX_LOG_INFO2("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
  1373                 GLX_LOG_INFO2("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
  1368                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1374                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
  1369                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
  1375                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
  1370                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1376                 CleanupStack::PopAndDestroy(defaultBitmap); 
  1371                 }
  1377                 }
  1453 // HandleTvStatusChangedL
  1459 // HandleTvStatusChangedL
  1454 // ---------------------------------------------------------------------------
  1460 // ---------------------------------------------------------------------------
  1455 //
  1461 //
  1456 void CShwSlideshowView::HandleTvStatusChangedL(TTvChangeType aChangeType )
  1462 void CShwSlideshowView::HandleTvStatusChangedL(TTvChangeType aChangeType )
  1457 	{
  1463 	{
  1458 	TRACER("CShwSlideshowView::HandleTvConnectionStatusChangedL");
  1464 	TRACER("CShwSlideshowView::HandleTvStatusChangedL");
  1459     // This is a common function for both HDMI and TV-out status changes 
  1465 	// This is a common function for both HDMI ,TV-out and Headset disconnected.  
  1460     // (see CGlxTv::HandleTvConnectionStatusChangedL)
  1466 	// (see CGlxTv::HandleTvConnectionStatusChangedL)
  1461     if ((aChangeType == ETvConnectionChanged)
  1467 	if (aChangeType == EDisconnected)
  1462             && (!iTvConnection->IsHDMIConnected()
  1468 		{
  1463                    	&& !iTvConnection->IsConnected()))
  1469 		GLX_LOG_INFO("CShwSlideshowView::HandleTvStatusChangedL- Acessory Not Connected");
  1464 	         {
  1470 		//Issue pause command if not already paused
  1465                  GLX_LOG_INFO("CShwSlideshowView::HandleTvConnectionStatusChangedL- Acessory Not Connected");
  1471 		if (!iPauseHandler->IsSlideShowEngineStatePaused())
  1466 	         //Issue pause command if not already paused
  1472 			{
  1467                  if (!iPauseHandler->IsSlideShowEngineStatePaused())
  1473 			ProcessCommandL(EShwSlideshowCmdPause);
  1468                     {
  1474 			}
  1469 	              ProcessCommandL(EShwSlideshowCmdPause);
       
  1470 	            }
       
  1471 		}
  1475 		}
       
  1476 
  1472 	}
  1477 	}
  1473