photosgallery/gallery/src/glxappui.cpp
branchRCL_3
changeset 13 bcb43dc84c44
parent 11 71da52165949
child 14 2dac0fdba72b
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
    78 #endif
    78 #endif
    79 const TInt KGlxMaxMemoryToDecodeCapturedPicture = 2 * KGlxMaxMegaPixelsSupportedByCamera ;
    79 const TInt KGlxMaxMemoryToDecodeCapturedPicture = 2 * KGlxMaxMegaPixelsSupportedByCamera ;
    80 const TInt KGlxMemoryForOOMFwk          = 1048576 ; // 1 MB
    80 const TInt KGlxMemoryForOOMFwk          = 1048576 ; // 1 MB
    81 const TInt KGlxThumbNailRepresentation    = 2;         // Thumbnail Representation; Could be 3 also 
    81 const TInt KGlxThumbNailRepresentation    = 2;         // Thumbnail Representation; Could be 3 also 
    82 
    82 
    83 _LIT8( KPhotosCaptured, "Captured" );
       
    84 _LIT8( KPhotosMonths, "Months" );
       
    85 _LIT8( KPhotosTags, "Tags" );
       
    86 _LIT8( KPhotosAlbums, "Albums" );
       
    87 _LIT8( KPhotosAllValue,"Allcs");
       
    88 
       
    89 const TInt KCapturedAlbumId = 2 ;
       
    90         
       
    91 /**
    83 /**
    92  * Start Delay for the periodic timer, in microseconds
    84  * Start Delay for the periodic timer, in microseconds
    93  */
    85  */
    94 const TInt KPeriodicStartDelay = 60000000; // 60 secs
    86 const TInt KPeriodicStartDelay = 60000000; // 60 secs
    95 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
   219 
   211 
   220     switch ( aMessageUid.iUid )
   212     switch ( aMessageUid.iUid )
   221 		{
   213 		{
   222         case KGlxActivationCmdShowLastModified:
   214         case KGlxActivationCmdShowLastModified:
   223         case KGlxActivationCameraAlbum:
   215         case KGlxActivationCameraAlbum:
       
   216         case KGlxActivationCmdShowAll:
   224             HandleActivationMessageL(aMessageParameters);
   217             HandleActivationMessageL(aMessageParameters);
   225             break;
   218             break;
   226          
   219          
   227         case KGlxActivationPhotosMenu:
       
   228         case KGlxActivationCameraView:
       
   229         case KGlxActivationMonthsView:
       
   230         case KGlxActivationAlbumsView:
       
   231         case KGlxActivationTagsView:
       
   232         case KGlxActivationAllView:
       
   233         	{
       
   234             TApaTaskList taskList( iCoeEnv->WsSession() );
       
   235         	TApaTask task = taskList.FindApp( TUid::Uid( KGlxGalleryApplicationUid ) );
       
   236         	TApaTask taskForeGround = taskList.FindByPos(0); // get fopreground app
       
   237 	        if ( task.Exists() && task.ThreadId() != taskForeGround.ThreadId() )
       
   238 		        {
       
   239                 // No matter which collection is selected,
       
   240                 // Photos is running in background, bring to foreground
       
   241                 iEikonEnv->RootWin().SetOrdinalPosition(0);
       
   242 		        }
       
   243         	}
       
   244             break;
       
   245         default:
   220         default:
   246             //To prevent Continues Activation of the Same View; Same is Triggered in ProcessCommandParametersL
   221             //To prevent Continues Activation of the Same View; Same is Triggered in ProcessCommandParametersL
   247             HandleActivationMessageL(aMessageParameters);           
   222             HandleActivationMessageL(aMessageParameters);           
   248             break;
   223             break;
   249         }
   224         }
   478         {
   453         {
   479         GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL(aData)");        
   454         GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL(aData)");        
   480         HandleActivationMessageL( aData );
   455         HandleActivationMessageL( aData );
   481         }
   456         }
   482 
   457 
   483     // Introduced to fix bug EMJN-78GH6N. Rowland Cook 10/12/2007
   458     // Introduced to fix bug EMJN-78GH6N. 
   484     if (0 != iEikonEnv->RootWin().OrdinalPosition())
   459     if (0 != iEikonEnv->RootWin().OrdinalPosition())
   485         {
   460         {
   486         iEikonEnv->RootWin().SetOrdinalPosition(0);
   461         iEikonEnv->RootWin().SetOrdinalPosition(0);
   487         }
   462         }
   488     }
   463     }
   518         }
   493         }
   519     
   494     
   520     switch ( msgUid.iUid )
   495     switch ( msgUid.iUid )
   521         {
   496         {
   522         case KGlxActivationCmdShowLastModified:
   497         case KGlxActivationCmdShowLastModified:
   523             // Go to camera album full screen view
   498         case KGlxActivationCameraAlbum:
   524             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: show last modified");
   499         case KGlxActivationCmdShowAll:
       
   500             {
       
   501             // Go to All grid view
       
   502             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: All Grid View");
   525             // Send the command to reset the view
   503             // Send the command to reset the view
   526             ProcessCommandL(EGlxCmdResetView);
   504             ProcessCommandL(EGlxCmdResetView);
   527             // Not using KGlxCollectionPluginCameraImplementationUid
       
   528             iNavigationalState->SetBackExitStatus(ETrue);
   505             iNavigationalState->SetBackExitStatus(ETrue);
   529             path->AppendL(KGlxCollectionPluginAlbumsImplementationUid);            
   506             path->AppendL(KGlxCollectionPluginAllImplementationUid);
   530             path->AppendL(KCapturedAlbumId);
   507             }
   531             SetActivationParamL(KGlxActivationFullScreen);
       
   532             break;
   508             break;
   533 
       
   534         case KGlxActivationCameraAlbum:
       
   535             // Go to camera album tile view
       
   536             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: camera album");
       
   537             iNavigationalState->SetBackExitStatus(ETrue);
       
   538             path->AppendL(KGlxCollectionPluginAlbumsImplementationUid);
       
   539             path->AppendL(KCapturedAlbumId);
       
   540             break;
       
   541 
       
   542         case KGlxActivationPhotosMenu:
       
   543             // Open the main view
       
   544             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: photos menu");
       
   545             break;
       
   546             
       
   547         case KGlxActivationAllView:
       
   548             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: Show all photos");
       
   549             // Send the command to reset the view
       
   550             ProcessCommandL(EGlxCmdResetView);
       
   551             path->AppendL(KGlxCollectionPluginAllImplementationUid);            
       
   552         	break;            
       
   553 
   509 
   554         default:
   510         default:
   555             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: unknown command");
   511             GLX_LOG_INFO("CGlxAppUi::HandleActivationMessageL: unknown command");
   556 
   512             User::Leave(KErrNotSupported);
   557 
       
   558             if(0 == aData.CompareC(KPhotosCaptured))
       
   559                 {
       
   560                 path->AppendL(KGlxCollectionPluginAlbumsImplementationUid);
       
   561 				path->AppendL(KCapturedAlbumId);
       
   562                 }
       
   563             else if(0 == aData.CompareC(KPhotosAllValue))
       
   564                 {
       
   565                 path->AppendL(KGlxCollectionPluginAllImplementationUid);
       
   566                 }
       
   567             else if(0 == aData.CompareC(KPhotosMonths))
       
   568                 {
       
   569                 path->AppendL(KGlxCollectionPluginMonthsImplementationUid);
       
   570                 }
       
   571             else if(0 == aData.CompareC(KPhotosAlbums))
       
   572                 {
       
   573                 path->AppendL(KGlxCollectionPluginAlbumsImplementationUid);
       
   574                 }
       
   575             else if(0 == aData.CompareC(KPhotosTags))
       
   576                 {
       
   577                 path->AppendL(KGlxTagCollectionPluginImplementationUid);
       
   578                 }
       
   579             else
       
   580                 {
       
   581                 User::Leave(KErrNotSupported);
       
   582                 }
       
   583             iNavigationalState->SetBackExitStatus(ETrue);
       
   584             break;
       
   585         }
   513         }
   586     CleanupStack::PopAndDestroy(&stream);
   514     CleanupStack::PopAndDestroy(&stream);
   587     iNavigationalState->SetStartingLevel(path->Levels());
   515     iNavigationalState->SetStartingLevel(path->Levels());
   588     iNavigationalState->NavigateToL( *path );
   516     iNavigationalState->NavigateToL( *path );
   589     CleanupStack::PopAndDestroy(path);
   517     CleanupStack::PopAndDestroy(path);
   590     
   518     
   591     // Introduced to fix bug EMJN-78GH6N. Rowland Cook 10/12/2007
   519     // Introduced to fix bug EMJN-78GH6N. 
   592     if (0 != iEikonEnv->RootWin().OrdinalPosition())
   520     if (0 != iEikonEnv->RootWin().OrdinalPosition())
   593         {
   521         {
   594         iEikonEnv->RootWin().SetOrdinalPosition(0);
   522         iEikonEnv->RootWin().SetOrdinalPosition(0);
   595         }
   523         }
   596     }
   524     }