photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraddtocontainer.h
branchRCL_3
changeset 60 5b3385a43d68
equal deleted inserted replaced
59:8e5f6eea9c9f 60:5b3385a43d68
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Add to container commmand handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __C_GLXCOMMANDHANDLERADDTOCONTAINER_H__
       
    22 #define __C_GLXCOMMANDHANDLERADDTOCONTAINER_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <glxmpxcommandcommandhandler.h>
       
    26 
       
    27 class MGlxMediaListProvider;
       
    28 
       
    29 class CEikAppUi;
       
    30 
       
    31 /**
       
    32  * Command handler for adding to a container.
       
    33  * @author Alex Birkett, Aki Vanhatalo 
       
    34  * @internal reviewed 05/06/2007 by Dave Schofield
       
    35  */
       
    36 NONSHARABLE_CLASS( CGlxCommandHandlerAddToContainer )
       
    37     : public CGlxMpxCommandCommandHandler
       
    38 	{
       
    39 public:
       
    40 	/** 
       
    41 	 * Create add to album command handler 
       
    42 	 * @param aMediaListProvider object that provides the media list.
       
    43      * @param aFileName resource file
       
    44 	 */
       
    45     IMPORT_C static CGlxCommandHandlerAddToContainer
       
    46 			* NewAddToAlbumCommandHandlerL(
       
    47 					MGlxMediaListProvider* aMediaListProvider,
       
    48 					TBool aHasToolbarItem, const TDesC& aFileName);
       
    49 
       
    50      /** 
       
    51 	 * Create add (to) tags command handler 
       
    52 	 * @param aMediaListProvider object that provides the media list.
       
    53      * @param aFileName resource file
       
    54 	 */
       
    55 	IMPORT_C static CGlxCommandHandlerAddToContainer
       
    56 			* NewAddToTagCommandHandlerL(
       
    57 					MGlxMediaListProvider* aMediaListProvider,
       
    58 					TBool aHasToolbarItem, const TDesC& aFileName);
       
    59 
       
    60     /** 
       
    61 	 * Create add (to) Favourites command handler 
       
    62 	 * @param aMediaListProvider object that provides the media list.
       
    63     * @param aFileName resource file
       
    64 	 */
       
    65 	IMPORT_C static CGlxCommandHandlerAddToContainer
       
    66 			* NewAddToFavCommandHandlerL(
       
    67 					MGlxMediaListProvider* aMediaListProvider,
       
    68 					TBool aHasToolbarItem, const TDesC& aFileName);
       
    69 
       
    70    /** 
       
    71 	 * Two-phase constructor: 
       
    72 	 * Prefer NewAddToAlbumCommandHandlerL or NewAddToTagsCommandHandlerL
       
    73 	 * @param aMediaListProvider object that provides the media list.
       
    74 	 * @param aCommand The command to handle.
       
    75      * @param aFileName resource file
       
    76 	 */
       
    77 	IMPORT_C static CGlxCommandHandlerAddToContainer* NewL(
       
    78 			MGlxMediaListProvider* aMediaListProvider, TInt aCommandId,
       
    79 			TBool aHasToolbarItem, const TDesC& aFileName);
       
    80 	    
       
    81     /** Destructor */
       
    82 	IMPORT_C ~CGlxCommandHandlerAddToContainer();
       
    83 	
       
    84 	// from MProgressDialogCallback
       
    85 	void DialogDismissedL(TInt aButtonId);
       
    86 
       
    87 protected: // From CGlxMediaListCommandHandler
       
    88 
       
    89     /** See @ref CGlxMpxCommandCommandHandler::CreateCommandL */
       
    90 	virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aList,
       
    91 	    TBool& aConsume) const;    
       
    92 
       
    93     /** See @ref CGlxMpxCommandCommandHandler::CompletionTextL */
       
    94     virtual HBufC* CompletionTextL() const;
       
    95 
       
    96 	/** See @ref CGlxMpxCommandCommandHandler::DoHandleCommandCompleteL */
       
    97 	virtual void DoHandleCommandCompleteL(TAny* aSessionId,
       
    98 	        CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList);
       
    99 	
       
   100 	virtual TBool OkToExit() const;
       
   101 
       
   102     /** See @ref CGlxCommandHandler::DoActivateL */
       
   103     void DoActivateL(TInt aViewId);
       
   104 
       
   105     /** See @ref CGlxCommandHandler::PopulateToolbar*/
       
   106 	void PopulateToolbarL();  
       
   107 	
       
   108 	/** See @ref CGlxCommandHandler::DoIsDisabled*/ 
       
   109 	TBool DoIsDisabled(TInt aCommandId, MGlxMediaList& aList) const;
       
   110 private:
       
   111 	/** 
       
   112 	 * Second phase constructor
       
   113 	 * @param aCommand The command to handle.
       
   114      * @param aFileName resource file
       
   115 	 */
       
   116 	void ConstructL(TInt aCommandId, const TDesC& aFileName);
       
   117 	
       
   118     /** 
       
   119      * First phase constructor 
       
   120      * @aMediaListProvider object that provides the media list.
       
   121      */
       
   122 	CGlxCommandHandlerAddToContainer(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem );
       
   123 	
       
   124 private:
       
   125     // Resource offset
       
   126 	TInt iResourceOffset;
       
   127 	
       
   128 	// Container Command Id
       
   129 	TInt iCommandId;
       
   130 
       
   131 	// Target containers selection count
       
   132 	static TInt iSelectionCount;
       
   133 	
       
   134 	// Media items selection count
       
   135 	mutable TInt iItemsSelectionCount;
       
   136 
       
   137 	// Popup Completion Status Flag
       
   138 	mutable TBool iIsProcessOngoing;
       
   139 	
       
   140 	};
       
   141 
       
   142 #endif // __C_GLXCOMMANDHANDLERADDTOCONTAINER_H__