photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp
branchRCL_3
changeset 15 191387a8b767
parent 3 9a9c174934f5
child 19 420f6808bf21
equal deleted inserted replaced
14:2dac0fdba72b 15:191387a8b767
    43 // ---------------------------------------------------------------------------
    43 // ---------------------------------------------------------------------------
    44 // Two-phased constructor.
    44 // Two-phased constructor.
    45 // ---------------------------------------------------------------------------
    45 // ---------------------------------------------------------------------------
    46 //
    46 //
    47 EXPORT_C CGlxCommandHandlerDelete* CGlxCommandHandlerDelete::NewL(
    47 EXPORT_C CGlxCommandHandlerDelete* CGlxCommandHandlerDelete::NewL(
    48         MGlxMediaListProvider* aMediaListProvider, TBool aContainerList, TBool aHasToolbarItem)
    48 		MGlxMediaListProvider* aMediaListProvider, TBool aContainerList,
    49     {
    49 		TBool aHasToolbarItem, const TDesC& aFileName)
    50     /// @todo Minor: Rowland Cook 06/06/07 no use of glx logging
    50 	{
    51     CGlxCommandHandlerDelete* self = new (ELeave) CGlxCommandHandlerDelete(aMediaListProvider, aHasToolbarItem);
    51 	/// @todo Minor: Rowland Cook 06/06/07 no use of glx logging
    52     CleanupStack::PushL( self );
    52 	CGlxCommandHandlerDelete* self = new (ELeave) CGlxCommandHandlerDelete(
    53     self->ConstructL(aContainerList);
    53 			aMediaListProvider, aHasToolbarItem);
    54     CleanupStack::Pop( self );
    54 	CleanupStack::PushL(self);
    55     return self;
    55 	self->ConstructL(aContainerList, aFileName);
    56     }
    56 	CleanupStack::Pop(self);
       
    57 	return self;
       
    58 	}
    57 
    59 
    58 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    59 // C++ default constructor can NOT contain any code, that
    61 // C++ default constructor can NOT contain any code, that
    60 // might leave.
    62 // might leave.
    61 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    64         : CGlxMpxCommandCommandHandler( aMediaListProvider, aHasToolbarItem )
    66         : CGlxMpxCommandCommandHandler( aMediaListProvider, aHasToolbarItem )
    65     {
    67     {
    66     // Don't do anything.
    68     // Don't do anything.
    67     }
    69     }
    68  
    70  
       
    71 
       
    72 
    69 // ---------------------------------------------------------------------------
    73 // ---------------------------------------------------------------------------
    70 // Symbian 2nd phase constructor can leave.
    74 // Symbian 2nd phase constructor can leave.
    71 // ---------------------------------------------------------------------------
    75 // ---------------------------------------------------------------------------
    72 //
    76 //
    73 void CGlxCommandHandlerDelete::ConstructL(TBool aIsContainerList)
    77 void CGlxCommandHandlerDelete::ConstructL(TBool aIsContainerList,
    74     {
    78 		const TDesC& aFileName)
    75     iIsContainerList = aIsContainerList;
    79 	{
    76     iUiUtility = CGlxUiUtility::UtilityL();
    80 	iIsContainerList = aIsContainerList;
    77     
    81 	iUiUtility = CGlxUiUtility::UtilityL();
    78     // Load resource file
    82 
    79 	TParse parse;
    83 	// Load resource file
    80     parse.Set(KGlxUiUtilitiesResource, &KDC_APP_RESOURCE_DIR, NULL);
    84 	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(aFileName);
    81     TFileName resourceFile;
    85 
    82     resourceFile.Append(parse.FullName());
    86 	// Add supported command
    83     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
    87 	TCommandInfo info(EGlxCmdDelete);
    84    	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
    88 	// Filter out static items
    85 
    89 	info.iMinSelectionLength = 1;
    86    	// Add supported command
    90 	info.iDisallowSystemItems = aIsContainerList;
    87    	TCommandInfo info( EGlxCmdDelete );
    91 	AddCommandL(info);
    88    	// Filter out static items
    92 
    89     info.iMinSelectionLength = 1;
    93 	TCommandInfo singleclkinfo(EGlxCmdSingleClickDelete);
    90     info.iDisallowSystemItems = aIsContainerList;
    94 	singleclkinfo.iMinSelectionLength = 1;
    91    	AddCommandL(info);
    95 	singleclkinfo.iDisallowSystemItems = aIsContainerList;
    92    	
    96 	AddCommandL(singleclkinfo);
    93    	TCommandInfo singleclkinfo( EGlxCmdSingleClickDelete );
       
    94     singleclkinfo.iMinSelectionLength = 1;
       
    95     singleclkinfo.iDisallowSystemItems = aIsContainerList;
       
    96     AddCommandL(singleclkinfo);
       
    97 	}
    97 	}
    98 
    98 
    99 // ---------------------------------------------------------------------------
    99 // ---------------------------------------------------------------------------
   100 // Destructor
   100 // Destructor
   101 // ---------------------------------------------------------------------------
   101 // ---------------------------------------------------------------------------