photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdetails.cpp
branchRCL_3
changeset 15 191387a8b767
parent 13 bcb43dc84c44
child 18 78ad99c24f08
equal deleted inserted replaced
14:2dac0fdba72b 15:191387a8b767
    56 #include <mpxcollectionpath.h>
    56 #include <mpxcollectionpath.h>
    57 // ---------------------------------------------------------------------------
    57 // ---------------------------------------------------------------------------
    58 // Two-phased constructor.
    58 // Two-phased constructor.
    59 // ---------------------------------------------------------------------------
    59 // ---------------------------------------------------------------------------
    60 //
    60 //
    61 EXPORT_C CGlxCommandHandlerDetails* 
    61 EXPORT_C CGlxCommandHandlerDetails*
    62 			CGlxCommandHandlerDetails::NewL( 
    62 CGlxCommandHandlerDetails::NewL(MGlxMediaListProvider* aMediaListProvider,
    63 			MGlxMediaListProvider* aMediaListProvider )
    63 		const TDesC& aFileName)
    64 	{
    64 	{
    65 	CGlxCommandHandlerDetails* self = new (ELeave) CGlxCommandHandlerDetails(aMediaListProvider);
    65 	CGlxCommandHandlerDetails* self = new (ELeave) CGlxCommandHandlerDetails(
       
    66 			aMediaListProvider);
    66 	CleanupStack::PushL(self);
    67 	CleanupStack::PushL(self);
    67 	self->ConstructL();
    68 	self->ConstructL(aFileName);
    68 	CleanupStack::Pop(self);
    69 	CleanupStack::Pop(self);
    69 	return self;
    70 	return self;
    70 	}
    71 	}
    71 
    72 
    72 // ---------------------------------------------------------------------------
    73 // ---------------------------------------------------------------------------
    78 														:CGlxMediaListCommandHandler(aMediaListProvider)
    79 														:CGlxMediaListCommandHandler(aMediaListProvider)
    79 	{
    80 	{
    80 	//Do nothing
    81 	//Do nothing
    81 	}			
    82 	}			
    82 
    83 
       
    84 
       
    85 
    83 // ---------------------------------------------------------------------------
    86 // ---------------------------------------------------------------------------
    84 // Symbian 2nd phase constructor can leave.
    87 // Symbian 2nd phase constructor can leave.
    85 // ---------------------------------------------------------------------------
    88 // ---------------------------------------------------------------------------
    86 //	
    89 //	
    87 void CGlxCommandHandlerDetails::ConstructL()
    90 void CGlxCommandHandlerDetails::ConstructL(const TDesC& aFileName)
    88 	{
    91 	{
    89     // Load resource file
    92 	// Load resource file
    90     GLX_FUNC("GLX_Property::ConstructL");
    93 	GLX_FUNC("GLX_Property::ConstructL");
    91 	
    94 
       
    95 	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(aFileName);
       
    96 
    92 	// register property command in command handler
    97 	// register property command in command handler
    93 	TParse parse;
    98 	TCommandInfo infoProp(EGlxCmdDetails);
    94     parse.Set(KGlxUiUtilitiesResource, &KDC_APP_RESOURCE_DIR, NULL);
    99 	// Filter out static items and only allows one item to select
    95     TFileName resourceFile;
   100 	infoProp.iMinSelectionLength = 1;
    96     resourceFile.Append(parse.FullName());
   101 	infoProp.iMaxSelectionLength = 1;
    97 
   102 	//Allow DRM
    98     CGlxResourceUtilities::GetResourceFilenameL(resourceFile); 
   103 	infoProp.iDisallowDRM = EFalse;
    99    	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   104 	//Allow system items
   100 				
   105 	infoProp.iDisallowSystemItems = EFalse;
   101 	// register property command in command handler
   106 	//Allow animation
   102    	TCommandInfo infoProp(EGlxCmdDetails);
   107 	infoProp.iStopAnimationForExecution = EFalse;
   103    	// Filter out static items and only allows one item to select
   108 	//no category filter
   104     infoProp.iMinSelectionLength = 1;
   109 	infoProp.iCategoryFilter = EMPXNoCategory;
   105     infoProp.iMaxSelectionLength = 1;
   110 	AddCommandL(infoProp);
   106     //Allow DRM
   111 
   107     infoProp.iDisallowDRM = EFalse;
   112 	TCommandInfo infoSubMenu(EGlxCmdDetailsOption);
   108     //Allow system items
   113 	infoSubMenu.iViewingState = TCommandInfo::EViewingStateBrowse;
   109     infoProp.iDisallowSystemItems= EFalse;
   114 
   110     //Allow animation
   115 	// register for the reset view command so that we can 
   111     infoProp.iStopAnimationForExecution = EFalse;  
   116 	// dismiss the dialog if it is being shown when we are activated
   112     //no category filter
   117 	// from SpaceUI 
   113     infoProp.iCategoryFilter = EMPXNoCategory;
   118 	TCommandInfo resetViewCmd(EGlxCmdResetView);
   114    	AddCommandL(infoProp);
   119 	AddCommandL(resetViewCmd);
   115 		   			   	
   120 
   116    	TCommandInfo infoSubMenu(EGlxCmdDetailsOption);
   121 	// get pointer to HUI utility
   117     infoSubMenu.iViewingState = TCommandInfo::EViewingStateBrowse;
   122 	iUiUtility = CGlxUiUtility::UtilityL();
   118    	
       
   119    	// register for the reset view command so that we can 
       
   120    	// dismiss the dialog if it is being shown when we are activated
       
   121    	// from SpaceUI 
       
   122     TCommandInfo resetViewCmd( EGlxCmdResetView );
       
   123     AddCommandL( resetViewCmd );
       
   124     
       
   125    	// get pointer to HUI utility
       
   126     iUiUtility = CGlxUiUtility::UtilityL();
       
   127 	}	
   123 	}	
   128 	
   124 	
   129 // ---------------------------------------------------------------------------
   125 // ---------------------------------------------------------------------------
   130 // Destructor
   126 // Destructor
   131 // ---------------------------------------------------------------------------
   127 // ---------------------------------------------------------------------------
   174 
   170 
   175 			TInt err = GlxAttributeRetriever::RetrieveL(*attrContext,aList,ETrue);
   171 			TInt err = GlxAttributeRetriever::RetrieveL(*attrContext,aList,ETrue);
   176 
   172 
   177 			// context off the list
   173 			// context off the list
   178 			CleanupStack::PopAndDestroy( &contextRemover );
   174 			CleanupStack::PopAndDestroy( &contextRemover );
       
   175 
       
   176 			iAvkonAppUi->ProcessCommandL(EGlxCmdDialogLaunched);
   179 
   177 
   180 			if ( err == KErrNone )
   178 			if ( err == KErrNone )
   181 				{
   179 				{
   182 				TInt focusIndex = aList.FocusIndex();
   180 				TInt focusIndex = aList.FocusIndex();
   183 				TGlxMedia item = aList.Item(focusIndex);
   181 				TGlxMedia item = aList.Item(focusIndex);
   223                     
   221                     
   224                     CleanupStack::PopAndDestroy(uriBuf);
   222                     CleanupStack::PopAndDestroy(uriBuf);
   225                     }
   223                     }
   226                 }
   224                 }
   227             CleanupStack::PopAndDestroy( attrContext );
   225             CleanupStack::PopAndDestroy( attrContext );
       
   226 
       
   227             iAvkonAppUi->ProcessCommandL(EGlxCmdResetView);
       
   228 
   228             consume = ETrue;
   229             consume = ETrue;
   229             break;
   230             break;
   230             }// contextRemover goes out of scope and removes the context from media list
   231             }// contextRemover goes out of scope and removes the context from media list
   231         default:
   232         default:
   232             {
   233             {