photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandleraddtocontainer.h
changeset 0 4e91876724a2
child 2 7d9067c6fcb1
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     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 	 */
       
    44     IMPORT_C static CGlxCommandHandlerAddToContainer* NewAddToAlbumCommandHandlerL(
       
    45         MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem);
       
    46 
       
    47      /** 
       
    48      * Create add (to) tags command handler 
       
    49      * @param aMediaListProvider object that provides the media list.
       
    50      */
       
    51     IMPORT_C static CGlxCommandHandlerAddToContainer* NewAddToTagCommandHandlerL(
       
    52         MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem);
       
    53 
       
    54     /** 
       
    55     * Create add (to) Favourites command handler 
       
    56     * @param aMediaListProvider object that provides the media list.
       
    57     */
       
    58    IMPORT_C static CGlxCommandHandlerAddToContainer* NewAddToFavCommandHandlerL(
       
    59        MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem);
       
    60 
       
    61    /** 
       
    62      * Two-phase constructor: 
       
    63      * Prefer NewAddToAlbumCommandHandlerL or NewAddToTagsCommandHandlerL
       
    64      * @param aMediaListProvider object that provides the media list.
       
    65      * @param aCommand The command to handle.
       
    66      */
       
    67 	IMPORT_C static CGlxCommandHandlerAddToContainer* NewL(MGlxMediaListProvider* aMediaListProvider,
       
    68 	                                                       TInt aCommandId, TBool aHasToolbarItem );
       
    69 	    
       
    70     /** Destructor */
       
    71 	IMPORT_C ~CGlxCommandHandlerAddToContainer();
       
    72 
       
    73 protected: // From CGlxMediaListCommandHandler
       
    74 
       
    75     /** See @ref CGlxMpxCommandCommandHandler::CreateCommandL */
       
    76 	virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aList,
       
    77 	    TBool& aConsume) const;    
       
    78 
       
    79     /** See @ref CGlxMpxCommandCommandHandler::CompletionTextL */
       
    80     virtual HBufC* CompletionTextL() const;
       
    81 
       
    82 	/** See @ref CGlxMpxCommandCommandHandler::DoHandleCommandCompleteL */
       
    83 	virtual void DoHandleCommandCompleteL(TAny* aSessionId,
       
    84 	        CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList);
       
    85 
       
    86     /** See @ref CGlxCommandHandler::DoActivateL */
       
    87     void DoActivateL(TInt aViewId);
       
    88 
       
    89     /** See @ref CGlxCommandHandler::PopulateToolbar*/
       
    90 	void PopulateToolbarL();   
       
    91 
       
    92 private:
       
    93 	/** 
       
    94 	 * Second phase constructor
       
    95 	 * @param aCommand The command to handle.
       
    96 	 */
       
    97 	void ConstructL(TInt aCommandId);
       
    98 
       
    99 	
       
   100     /** 
       
   101      * First phase constructor 
       
   102      * @aMediaListProvider object that provides the media list.
       
   103      */
       
   104 	CGlxCommandHandlerAddToContainer(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem );
       
   105 	
       
   106 private:
       
   107     // Resource offset
       
   108 	TInt iResourceOffset;
       
   109 	
       
   110 	// Container Command Id
       
   111 	TInt iCommandId;
       
   112 
       
   113 	// Target containers selection count
       
   114 	static TInt iSelectionCount;
       
   115 
       
   116 	// Popup Completion Status Flag
       
   117 	mutable TBool iIsProcessOngoing;
       
   118 	
       
   119 	};
       
   120 
       
   121 #endif // __C_GLXCOMMANDHANDLERADDTOCONTAINER_H__