photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerupload.h
changeset 0 4e91876724a2
child 18 bcb43dc84c44
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:    Upload commmand handler
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __GLXCOMMANDHANDLERUPLOAD_H__
       
    19 #define __GLXCOMMANDHANDLERUPLOAD_H__
       
    20 
       
    21 
       
    22 //  EXTERNAL INCLUDES
       
    23 #include "AiwServiceHandler.h"                  // AIW service handler
       
    24 
       
    25 //  INTERNAL INCLUDES
       
    26 #include "glxmedialistcommandhandler.h"         // for MediaListCommandHandler
       
    27 #include <glxuiutility.h>                       // for UiUtility
       
    28 
       
    29 //  FORWARD DECLARATIONS
       
    30 class MGlxMediaListProvider;
       
    31 class CGlxDefaultAttributeContext;
       
    32 
       
    33 /**
       
    34  * Command handler that launches Upload AIW ShareOnline
       
    35  * @class CGlxCommandHandlerUpload
       
    36  * @author Abhijit S 
       
    37  */
       
    38  
       
    39 // CLASS DECLARATION
       
    40 
       
    41 NONSHARABLE_CLASS (CGlxCommandHandlerUpload) : public CGlxMediaListCommandHandler
       
    42 	{
       
    43 public:  // Constructors and destructor
       
    44 	/**
       
    45 	* Two-phased constructor.
       
    46     * @param aMediaListProvider pointer to media list owner
       
    47     * @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item)
       
    48     * @return pointer to CGlxCommandHandlerUpload object
       
    49     */
       
    50 	IMPORT_C static CGlxCommandHandlerUpload* NewL(MGlxMediaListProvider* 
       
    51 	                                                    aMediaListProvider, TBool aHasToolbarItem);
       
    52     
       
    53     /**
       
    54     * Destructor.
       
    55     */
       
    56     IMPORT_C ~CGlxCommandHandlerUpload();
       
    57     
       
    58     /**
       
    59      * To set the Help Text for Upload button on toolbar
       
    60      */
       
    61     void SetToolTipL();
       
    62     
       
    63 protected:
       
    64 	//@ref From CGlxCommandHandler
       
    65 	void PopulateToolbarL();
       
    66 
       
    67 private:
       
    68 	/**
       
    69     * Symbian 2nd phase constructor
       
    70 	*/
       
    71     void ConstructL();
       
    72 
       
    73     /**
       
    74     * C++ default constructor.
       
    75     * @param aMediaListProvider pointer to media list owner
       
    76     * @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item)
       
    77     * @ref CGlxMediaListCommandHandler
       
    78     */
       
    79     CGlxCommandHandlerUpload(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem);
       
    80 
       
    81     /**
       
    82      * Gets the tooltip text or the Help Text from AIWServiceHandler
       
    83      */
       
    84     void GetToolTipL(HBufC*& aToolTipText);
       
    85 
       
    86 private: // From CGlxMediaListCommandHandler
       
    87 	/**
       
    88     * Execute the command, if applicable. 
       
    89 	* @param aCommand The command to handle
       
    90 	* @param aList List of media items
       
    91     * @return ETrue if command was handled, EFalse otherwise
       
    92     * @ref CGlxMediaListCommandHandler	
       
    93 	*/
       
    94 	TBool DoExecuteL (TInt aCommandId, MGlxMediaList& aList);	
       
    95 	
       
    96 	/**
       
    97 	* Called when the owning view is activated
       
    98 	* @param aViewId The ID of the view
       
    99     * @ref CGlxMediaListCommandHandler	
       
   100 	*/
       
   101 	void DoActivateL (TInt aViewId);
       
   102 	
       
   103 	/**
       
   104 	* Called when the owning view is deactivated
       
   105 	*/
       
   106 	void Deactivate();	
       
   107 
       
   108 private:
       
   109 	/**
       
   110 	* Retrieve the currently selected items file name and path
       
   111 	* @return The currently selected items filename and path
       
   112 	*/	
       
   113 	
       
   114 	void AppendSelectedFilesL(CAiwGenericParamList& aInputParams);
       
   115 	
       
   116 	/**
       
   117 	 * To check whether OneClickUpload is supported by the Shareonline 
       
   118 	 * application. 
       
   119 	 * NOTE: OneClickUpload is a feature of ShareOnline 4.3 and above. Hence this function
       
   120 	 * ensures that the upload command works only if this version of ShareOnline is 
       
   121 	 * available in the build. Else, Upload will not work! 
       
   122 	 */
       
   123 	void CheckVersionL();
       
   124 	
       
   125 	/**
       
   126 	 * To attach the aiw share interest resource to the servicehandler
       
   127 	 */
       
   128 	void InitializeOneClickUploadL();
       
   129 	
       
   130 private: // data
       
   131 
       
   132     // ID of owning view 
       
   133     TInt iViewId;
       
   134     
       
   135     // True if ShareOnline versioned 4.3 and above is present in the build
       
   136     TBool iUploadSupported;
       
   137     
       
   138     // Not owned - Provider of media list
       
   139     MGlxMediaListProvider* iMediaListProvider;
       
   140     
       
   141     // Not owned - UI utility 
       
   142     CGlxUiUtility* iUiUtility;
       
   143 
       
   144     // Owned - AIW Service Handler
       
   145     CAiwServiceHandler* iServiceHandler;	
       
   146 	};
       
   147 
       
   148 #endif //__GLXCOMMANDHANDLERUPLOAD_H__