imageeditor/EditorProvider/inc/ImageEditorProvider.h
changeset 1 edfc90759b9f
equal deleted inserted replaced
0:57d4cdd99204 1:edfc90759b9f
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef IMEGEEDITORPROVIDER_H
       
    21 #define IMEGEEDITORPROVIDER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <AiwServiceIfMenu.h>
       
    25 #include <apparc.h>
       
    26 #include <ConeResLoader.h> 
       
    27 #include <AknServerApp.h> 
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 
       
    32 class MAiwNotifyCallback;
       
    33 class CAknOpenFileService;
       
    34 class TDataType;
       
    35 
       
    36 /** CEditorProvider
       
    37 *
       
    38 *   CEditorProvider acts as a service provider of Image Editor in
       
    39 *   Series 60 2.8 platform. It implements the base and menu service classes
       
    40 *   as an ECom component.
       
    41 *
       
    42 */ 
       
    43 class CEditorProvider : public CAiwServiceIfMenu, public MAknServerAppExitObserver
       
    44 {	
       
    45 
       
    46 public:
       
    47 
       
    48     /** New factory method
       
    49 	*
       
    50 	*	
       
    51     *	@param -
       
    52 	*	@return - pointer to a new instance of CEditorProvider
       
    53     */ 
       
    54 	static CEditorProvider * NewL();
       
    55 
       
    56     /** Destructor
       
    57 	*	
       
    58     *	@param -
       
    59 	*	@return - 
       
    60     */ 
       
    61 	virtual ~CEditorProvider();
       
    62 
       
    63     /** InitialiseL
       
    64     *
       
    65     *   @see CAiwServiceIfBase
       
    66     */ 
       
    67     virtual void InitialiseL (
       
    68 		MAiwNotifyCallback &			aFrameworkCallback,
       
    69 		const RCriteriaArray &			aInterest
       
    70 		);
       
    71 
       
    72     /** HandleServiceCmdL
       
    73     *
       
    74     *   @see CAiwServiceIfBase
       
    75     */ 
       
    76     virtual void HandleServiceCmdL (
       
    77         const TInt &                    aCmdId,
       
    78         const CAiwGenericParamList &    aInParamList,
       
    79         CAiwGenericParamList &          aOutParamList,
       
    80         TUint                           aCmdOptions,
       
    81         const MAiwNotifyCallback *      aCallback
       
    82         );
       
    83 
       
    84     /** InitializeMenuPaneL
       
    85     *
       
    86     *   @see CAiwServiceIfMenu
       
    87     */ 
       
    88     virtual void InitializeMenuPaneL (
       
    89         CAiwMenuPane &                  aMenuPane,
       
    90         TInt                            aIndex,
       
    91         TInt                            aCascadeId,
       
    92         const CAiwGenericParamList &    aInParamList
       
    93         );
       
    94 
       
    95     /** HandleMenuCmdL
       
    96     *
       
    97     *   @see CAiwServiceIfMenu
       
    98     */ 
       
    99     virtual void HandleMenuCmdL (
       
   100         TInt                            aMenuCmdId,
       
   101         const CAiwGenericParamList &	aInParamList,
       
   102         CAiwGenericParamList &          aOutParamList,
       
   103         TUint                           aCmdOptions,
       
   104         const MAiwNotifyCallback *      aCallback
       
   105         );
       
   106 
       
   107     /** HandleServerAppExit
       
   108     *
       
   109     *   @see MAknServerAppExitObserver
       
   110     */ 
       
   111     virtual void HandleServerAppExit (TInt aReason);
       
   112 
       
   113 protected:
       
   114 
       
   115     /** Default constructor
       
   116 	*	
       
   117     *	@param -
       
   118 	*	@return - 
       
   119     */ 
       
   120 	CEditorProvider();
       
   121 
       
   122     /** 
       
   123     *   @param aInParamList
       
   124     *   @return CDesCArray*
       
   125     */
       
   126 	CDesCArray* CheckInputFilesLC ( 
       
   127 	    const CAiwGenericParamList &    aInParamList
       
   128 		);
       
   129 
       
   130     /** 
       
   131     *   @param aOutParamList
       
   132     *   @param aCallback
       
   133     *   @return -
       
   134     */
       
   135 	void CheckAiwCallBackL ( 
       
   136 	    CAiwGenericParamList &          aOutParamList,
       
   137 	    const MAiwNotifyCallback *      aCallback
       
   138 		);
       
   139 
       
   140     /** 
       
   141     *   @param aFileName
       
   142     *   @param aFsSession
       
   143     *   @return -
       
   144     */
       
   145     void LaunchImageEditorL( 
       
   146 		const TDesC & 				 aFileName,
       
   147 	    const CAiwGenericParamList & aInParamList
       
   148 	    );
       
   149 
       
   150     
       
   151     /** CheckDRMProtectionL 
       
   152 	*
       
   153 	*	Checks if file is DRM protected.
       
   154 	*
       
   155 	*	@param aFileName - file name
       
   156 	*	@return - ETrue if protected, otherwise EFalse, 
       
   157 	*/
       
   158     TBool CheckDRMProtectionL(const TDesC& aFileName) const;
       
   159 
       
   160     /** IsSupportedImageFile
       
   161     *
       
   162     *   @param aDataType
       
   163     *   @return  TBool
       
   164     */
       
   165     TBool IsSupportedImageFile (const TDataType& aDataType) const;
       
   166 
       
   167     /** IsJpeg
       
   168     *
       
   169     *   @param aDataType
       
   170     *   @return  TBool
       
   171     */
       
   172     TBool IsJpeg (const TDataType& aDataType) const;
       
   173 
       
   174     /** CheckDiskSpaceL 
       
   175 	*
       
   176 	*	Checks if there is enough space in the disk (MMC/PhoneMemory).
       
   177 	*
       
   178     *   @param aFsSession - file server session
       
   179 	*	@param aFileName - file name
       
   180 	*	@return - ETrue if enough free memory, otherwise EFalse 
       
   181 	*/
       
   182     TBool CheckDiskSpaceL(RFs& aFsSession, const TDesC& aFileName) const;
       
   183 
       
   184     /** CheckDiskSpaceL 
       
   185 	*
       
   186 	*	Checks if there is enough space in the disk (MMC/PhoneMemory).
       
   187 	*
       
   188     *   @param aFsSession - file server session
       
   189 	*	@param aFileList - list of file names
       
   190 	*	@return - ETrue if enough free memory, otherwise EFalse 
       
   191 	*/
       
   192     TBool CheckDiskSpaceL(RFs& aFsSession, const CDesCArray* aFileList) const;
       
   193   
       
   194     /** HandleCmdsL
       
   195     *
       
   196     *   Handle menu and service commands
       
   197     *
       
   198     *   @see HandleMenuCmdL
       
   199     *   @see HandleServiceCmdL
       
   200     */ 
       
   201     void HandleCmdsL (
       
   202         TInt                            aMenuCmdId,
       
   203         const CAiwGenericParamList &	aInParamList,
       
   204         CAiwGenericParamList &          aOutParamList,
       
   205         TUint                           aCmdOptions,
       
   206         const MAiwNotifyCallback *      aCallback
       
   207         );
       
   208 
       
   209 private:
       
   210 
       
   211     TFileName					iResourceFile;
       
   212     RConeResourceLoader			iResLoader;
       
   213    	TBool						iResLoaderOpen;
       
   214    	TBool						iFileServerConnected;
       
   215    	TBool						iUseCallBack;
       
   216    	CAknOpenFileService *		iOpenFileService;
       
   217    	RFs 						iSharableFS;
       
   218     
       
   219     const MAiwNotifyCallback*	iCallback;
       
   220     CAiwGenericParamList*		iInParamList;
       
   221     CAiwGenericParamList*		iOutParamList;
       
   222 
       
   223     CDesCArray*					iInputFileList;
       
   224     CDesCArray*					iTargetFileList;
       
   225 
       
   226 };
       
   227 
       
   228 
       
   229 #endif // EOF EditorServiceProvider.h