photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerremovefrom.cpp
branchRCL_3
changeset 25 191387a8b767
parent 3 9a9c174934f5
child 35 420f6808bf21
equal deleted inserted replaced
22:2dac0fdba72b 25:191387a8b767
    39 // ---------------------------------------------------------------------------
    39 // ---------------------------------------------------------------------------
    40 // Two-phased constructor.
    40 // Two-phased constructor.
    41 // ---------------------------------------------------------------------------
    41 // ---------------------------------------------------------------------------
    42 //
    42 //
    43 EXPORT_C CGlxCommandHandlerRemoveFrom* CGlxCommandHandlerRemoveFrom::NewL(
    43 EXPORT_C CGlxCommandHandlerRemoveFrom* CGlxCommandHandlerRemoveFrom::NewL(
    44         MGlxMediaListProvider* aMediaListProvider, TMPXGeneralCategory aContainerType)
    44 		MGlxMediaListProvider* aMediaListProvider,
    45     {
    45 		TMPXGeneralCategory aContainerType, const TDesC& aFileName)
    46     CGlxCommandHandlerRemoveFrom* self = new (ELeave) CGlxCommandHandlerRemoveFrom(aMediaListProvider, aContainerType);
    46 	{
    47     CleanupStack::PushL(self);
    47 	CGlxCommandHandlerRemoveFrom* self =
    48     self->ConstructL();
    48 			new (ELeave) CGlxCommandHandlerRemoveFrom(aMediaListProvider,
    49     CleanupStack::Pop(self);
    49 					aContainerType);
    50     return self;
    50 	CleanupStack::PushL(self);
    51     }
    51 	self->ConstructL(aFileName);
       
    52 	CleanupStack::Pop(self);
       
    53 	return self;
       
    54 	}
    52 
    55 
    53 // ---------------------------------------------------------------------------
    56 // ---------------------------------------------------------------------------
    54 // C++ default constructor can NOT contain any code, that
    57 // C++ default constructor can NOT contain any code, that
    55 // might leave.
    58 // might leave.
    56 // ---------------------------------------------------------------------------
    59 // ---------------------------------------------------------------------------
    63 
    66 
    64 // ---------------------------------------------------------------------------
    67 // ---------------------------------------------------------------------------
    65 // Symbian 2nd phase constructor can leave.
    68 // Symbian 2nd phase constructor can leave.
    66 // ---------------------------------------------------------------------------
    69 // ---------------------------------------------------------------------------
    67 //
    70 //
    68 void CGlxCommandHandlerRemoveFrom::ConstructL()
    71 void CGlxCommandHandlerRemoveFrom::ConstructL(const TDesC& aFileName)
    69     {
    72 	{
    70     // Load resource file
    73 	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(aFileName);
    71 	TParse parse;
       
    72     parse.Set(KGlxUiUtilitiesResource, &KDC_APP_RESOURCE_DIR, NULL);
       
    73     TFileName resourceFile;
       
    74     resourceFile.Append(parse.FullName());
       
    75     CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
       
    76    	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
       
    77 
    74 
    78    	// Add supported command
    75 	// Add supported command
    79    	TCommandInfo info(EGlxCmdRemoveFrom);
    76 	TCommandInfo info(EGlxCmdRemoveFrom);
    80    	// Filter out static items
    77 	// Filter out static items
    81     info.iMinSelectionLength = 1;
    78 	info.iMinSelectionLength = 1;
    82     info.iMaxSelectionLength = KMaxTInt;
    79 	info.iMaxSelectionLength = KMaxTInt;
    83    	AddCommandL(info);
    80 	AddCommandL(info);
    84    	
    81 
    85    	TCommandInfo singleclickinfo(EGlxCmdSingleClickRemoveFrom);
    82 	TCommandInfo singleclickinfo(EGlxCmdSingleClickRemoveFrom);
    86    	singleclickinfo.iMinSelectionLength = 1;
    83 	singleclickinfo.iMinSelectionLength = 1;
    87    	singleclickinfo.iMaxSelectionLength = KMaxTInt;
    84 	singleclickinfo.iMaxSelectionLength = KMaxTInt;
    88     AddCommandL(singleclickinfo);
    85 	AddCommandL(singleclickinfo);
    89 	}
    86 	}
    90 
    87 
    91 // ---------------------------------------------------------------------------
    88 // ---------------------------------------------------------------------------
    92 // Destructor
    89 // Destructor
    93 // ---------------------------------------------------------------------------
    90 // ---------------------------------------------------------------------------