photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 19 420f6808bf21
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    37 #include <glxtracer.h>
    37 #include <glxtracer.h>
    38 #include <glxnavigationalstate.h>
    38 #include <glxnavigationalstate.h>
    39 #include <mpxcollectionpath.h>
    39 #include <mpxcollectionpath.h>
    40 #include <glxcollectionpluginimageviewer.hrh>
    40 #include <glxcollectionpluginimageviewer.hrh>
    41 #include "glxcommandfactory.h"
    41 #include "glxcommandfactory.h"
       
    42 #include <glximageviewermanager.h>
       
    43 
    42 
    44 
    43 // ---------------------------------------------------------------------------
    45 // ---------------------------------------------------------------------------
    44 // Two-phased constructor.
    46 // Two-phased constructor.
    45 // ---------------------------------------------------------------------------
    47 // ---------------------------------------------------------------------------
    46 //
    48 //
   212 //
   214 //
   213 TBool CGlxCommandHandlerDelete::DoIsDisabled(TInt aCommandId, 
   215 TBool CGlxCommandHandlerDelete::DoIsDisabled(TInt aCommandId, 
   214         MGlxMediaList& aList) const 
   216         MGlxMediaList& aList) const 
   215         {
   217         {
   216         TRACER( "CGlxCommandHandlerDelete::DoIsDisabled" );
   218         TRACER( "CGlxCommandHandlerDelete::DoIsDisabled" );
   217         TBool fullscreenViewingMode = EFalse;
   219         TBool disable = EFalse;
   218         CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL();
   220 
   219         CMPXCollectionPath* naviState = aNavigationalState->StateLC();
   221         CGlxNavigationalState* navState = CGlxNavigationalState::InstanceL();
       
   222 		CleanupClosePushL(*navState);
       
   223         CMPXCollectionPath* path = navState->StateLC();
   220         
   224         
   221         if ( naviState->Levels() >= 1)
   225         if ( path->Levels() >= 1)
   222             {
   226             {
   223             if (aNavigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) 
   227 			CGlxImageViewerManager* viewerInstance = CGlxImageViewerManager::InstanceL();
       
   228             if (path->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)
       
   229                         && viewerInstance->IsPrivate())
   224                 {
   230                 {
   225                 // For image viewer collection, goto view mode
   231                 //it means we are in image viewer private path.
   226                 if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
   232                 disable = ETrue;
   227                     {
   233                 }
   228                     //it means we are in img viewer.
   234 			viewerInstance->DeleteInstance();
   229                     fullscreenViewingMode = ETrue;
       
   230                     }
       
   231                 } 
       
   232             else 
       
   233                 {
       
   234                 //it means we are in Fullscreen.
       
   235                 fullscreenViewingMode = ETrue;
       
   236                 }                
       
   237             }
   235             }
   238         CleanupStack::PopAndDestroy( naviState );
   236         CleanupStack::PopAndDestroy(path);
   239         aNavigationalState->Close();
   237         CleanupStack::PopAndDestroy(navState);
   240         if (EGlxCmdDelete==aCommandId && 0 == aList.Count() &&
   238 
   241 		                                 !fullscreenViewingMode)
   239         if (EGlxCmdDelete==aCommandId && 0 == aList.Count())
   242             {   
   240             {   
   243             return ETrue;
   241             disable = ETrue;
   244             }     
   242             }     
   245         return EFalse;
   243         return disable;
   246         }
   244         }
   247 //end of file
   245 //end of file
   248 		
   246