photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp
branchRCL_3
changeset 75 01504893d9cb
parent 60 5b3385a43d68
equal deleted inserted replaced
68:5b238bc8ffb6 75:01504893d9cb
    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 
       
    44 
    42 
    45 // ---------------------------------------------------------------------------
    43 // ---------------------------------------------------------------------------
    46 // Two-phased constructor.
    44 // Two-phased constructor.
    47 // ---------------------------------------------------------------------------
    45 // ---------------------------------------------------------------------------
    48 //
    46 //
   214 //
   212 //
   215 TBool CGlxCommandHandlerDelete::DoIsDisabled(TInt aCommandId, 
   213 TBool CGlxCommandHandlerDelete::DoIsDisabled(TInt aCommandId, 
   216         MGlxMediaList& aList) const 
   214         MGlxMediaList& aList) const 
   217         {
   215         {
   218         TRACER( "CGlxCommandHandlerDelete::DoIsDisabled" );
   216         TRACER( "CGlxCommandHandlerDelete::DoIsDisabled" );
   219         TBool disable = EFalse;
   217         TBool fullscreenViewingMode = EFalse;
   220 
   218         CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL();
   221         CGlxNavigationalState* navState = CGlxNavigationalState::InstanceL();
   219         CMPXCollectionPath* naviState = aNavigationalState->StateLC();
   222 		CleanupClosePushL(*navState);
       
   223         CMPXCollectionPath* path = navState->StateLC();
       
   224         
   220         
   225         if ( path->Levels() >= 1)
   221         if ( naviState->Levels() >= 1)
   226             {
   222             {
   227 			CGlxImageViewerManager* viewerInstance = CGlxImageViewerManager::InstanceL();
   223             if (aNavigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) 
   228             if (path->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid)
       
   229                         && viewerInstance->IsPrivate())
       
   230                 {
   224                 {
   231                 //it means we are in image viewer private path.
   225                 // For image viewer collection, goto view mode
   232                 disable = ETrue;
   226                 if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
   233                 }
   227                     {
   234 			viewerInstance->DeleteInstance();
   228                     //it means we are in img viewer.
       
   229                     fullscreenViewingMode = ETrue;
       
   230                     }
       
   231                 } 
       
   232             else 
       
   233                 {
       
   234                 //it means we are in Fullscreen.
       
   235                 fullscreenViewingMode = ETrue;
       
   236                 }                
   235             }
   237             }
   236         CleanupStack::PopAndDestroy(path);
   238         CleanupStack::PopAndDestroy( naviState );
   237         CleanupStack::PopAndDestroy(navState);
   239         aNavigationalState->Close();
   238 
   240         if (EGlxCmdDelete==aCommandId && 0 == aList.Count() &&
   239         if (EGlxCmdDelete==aCommandId && 0 == aList.Count())
   241 		                                 !fullscreenViewingMode)
   240             {   
   242             {   
   241             disable = ETrue;
   243             return ETrue;
   242             }     
   244             }     
   243         return disable;
   245         return EFalse;
   244         }
   246         }
   245 //end of file
   247 //end of file
   246 		
   248