photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwassign.cpp
branchRCL_3
changeset 15 191387a8b767
parent 12 ce1c7ad1f18b
equal deleted inserted replaced
14:2dac0fdba72b 15:191387a8b767
    31 #include <glxnavigationalstate.h>
    31 #include <glxnavigationalstate.h>
    32 #include <mpxcollectionpath.h>
    32 #include <mpxcollectionpath.h>
    33 #include <glxcollectionpluginimageviewer.hrh>
    33 #include <glxcollectionpluginimageviewer.hrh>
    34 #include "glxaiwservicehandler.h"
    34 #include "glxaiwservicehandler.h"
    35 #include <featdiscovery.h>
    35 #include <featdiscovery.h>
       
    36 #include <glximageviewermanager.h>          // for CGlxImageViewerManager
    36 
    37 
    37 const TInt KGlxAiwAssignCommandSpace = 0x00000100;
    38 const TInt KGlxAiwAssignCommandSpace = 0x00000100;
    38 
    39 
    39 // -----------------------------------------------------------------------------
    40 // -----------------------------------------------------------------------------
    40 // NewL
    41 // NewL
    41 // -----------------------------------------------------------------------------
    42 // -----------------------------------------------------------------------------
    42 //	
    43 //	
    43 EXPORT_C CGlxCommandHandlerAiwAssign* CGlxCommandHandlerAiwAssign::NewL(
    44 EXPORT_C CGlxCommandHandlerAiwAssign* CGlxCommandHandlerAiwAssign::NewL(
    44         MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource)
    45 		MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource,
    45     {
    46 		const TDesC& aFileName)
    46     TRACER("CGlxCommandHandlerAiwAssign* CGlxCommandHandlerAiwAssign::NewL");
    47 	{
    47     CGlxCommandHandlerAiwAssign* self = new ( ELeave ) 
    48 	TRACER("CGlxCommandHandlerAiwAssign* CGlxCommandHandlerAiwAssign::NewL");
    48         CGlxCommandHandlerAiwAssign(aMediaListProvider, aMenuResource);
    49 	CGlxCommandHandlerAiwAssign* self =
    49     CleanupStack::PushL( self );
    50 			new (ELeave) CGlxCommandHandlerAiwAssign(aMediaListProvider,
    50     self->ConstructL();
    51 					aMenuResource);
    51     CleanupStack::Pop( self );
    52 	CleanupStack::PushL(self);
    52     return self;
    53 	self->ConstructL(aFileName);
    53     }
    54 	CleanupStack::Pop(self);
       
    55 	return self;
       
    56 	}
    54     
    57     
    55 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
    56 // Constructor
    59 // Constructor
    57 // -----------------------------------------------------------------------------
    60 // -----------------------------------------------------------------------------
    58 //	
    61 //	
    66 CGlxCommandHandlerAiwAssign::~CGlxCommandHandlerAiwAssign()
    69 CGlxCommandHandlerAiwAssign::~CGlxCommandHandlerAiwAssign()
    67     {
    70     {
    68     delete iFeatManager;
    71     delete iFeatManager;
    69     }
    72     }
    70 
    73 
    71 void CGlxCommandHandlerAiwAssign::ConstructL()
    74 void CGlxCommandHandlerAiwAssign::ConstructL(const TDesC& aFileName)
    72     {
    75 	{
    73     //Calling base class implementation
    76 	//Calling base class implementation
    74     CGlxCommandHandlerAiwBase::ConstructL();
    77 	CGlxCommandHandlerAiwBase::ConstructL(aFileName);
    75     
    78 
    76     iFeatManager = CFeatureDiscovery::NewL();
    79 	iFeatManager = CFeatureDiscovery::NewL();
    77     }
    80 	}
    78 
    81 
    79 // -----------------------------------------------------------------------------
    82 // -----------------------------------------------------------------------------
    80 // CGlxCommandHandlerAiwAssign::DoGetRequiredAttributesL
    83 // CGlxCommandHandlerAiwAssign::DoGetRequiredAttributesL
    81 // -----------------------------------------------------------------------------
    84 // -----------------------------------------------------------------------------
    82 //	
    85 //	
   148 void CGlxCommandHandlerAiwAssign::AiwDoDynInitMenuPaneL(TInt /*aResourceId*/, 
   151 void CGlxCommandHandlerAiwAssign::AiwDoDynInitMenuPaneL(TInt /*aResourceId*/, 
   149         CEikMenuPane* aMenuPane)
   152         CEikMenuPane* aMenuPane)
   150     {
   153     {
   151     TRACER("void CGlxCommandHandlerAiwAssign::AiwDoDynInitMenuPaneL");
   154     TRACER("void CGlxCommandHandlerAiwAssign::AiwDoDynInitMenuPaneL");
   152     TBool fullscreenViewingMode = EFalse;
   155     TBool fullscreenViewingMode = EFalse;
       
   156     TBool privateFile = EFalse;
   153     CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL();
   157     CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL();
   154     CMPXCollectionPath* naviState = aNavigationalState->StateLC();
   158     CMPXCollectionPath* naviState = aNavigationalState->StateLC();
   155     
   159     
   156     if ( naviState->Levels() >= 1)
   160     if ( naviState->Levels() >= 1)
   157         {
   161         {
   176             }                
   180             }                
   177         }
   181         }
   178     CleanupStack::PopAndDestroy( naviState );
   182     CleanupStack::PopAndDestroy( naviState );
   179     aNavigationalState->Close();
   183     aNavigationalState->Close();
   180     
   184     
       
   185     if (fullscreenViewingMode)
       
   186         {
       
   187         CGlxImageViewerManager* viewerInst =
       
   188                 CGlxImageViewerManager::InstanceL();
       
   189         if (viewerInst && viewerInst->IsPrivate())
       
   190             {
       
   191             privateFile = ETrue;
       
   192             }
       
   193         viewerInst->DeleteInstance();
       
   194         }
       
   195 
   181     HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_USE_ITEMS );
   196     HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_USE_ITEMS );
   182     // get commandId for the current menupane item title
   197     // get commandId for the current menupane item title
   183     TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ;
   198     TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ;
   184 
   199 
   185     CleanupStack::PopAndDestroy(currentTitle);
   200     CleanupStack::PopAndDestroy(currentTitle);
   186     
   201     
   187     if( KErrNotFound != cmdId )
   202     if( KErrNotFound != cmdId )
   188         {
   203         {
   189         MGlxMediaList& mediaList = MediaList();
   204         MGlxMediaList& mediaList = MediaList();
   190 
   205 
   191         if (mediaList.SelectionCount() == 1 || fullscreenViewingMode )
   206         if (mediaList.SelectionCount() == 1 || (fullscreenViewingMode
       
   207                 && !privateFile))
   192             {
   208             {
   193     		TGlxSelectionIterator iterator;
   209     		TGlxSelectionIterator iterator;
   194             
   210             
   195             iterator.SetToFirst(&mediaList);
   211             iterator.SetToFirst(&mediaList);
   196 
   212