uiservicetab/vimpstutils/inc/cvimpstengineimagehandler.h
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2008 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: Image handler for VImpstengine handler
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CVIMPSTENGINEIMAGEHANDLER_H
       
    19 #define __CVIMPSTENGINEIMAGEHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "mvimpstimageprocessobserver.h"
       
    25 #include <mdaimageconverter.h>
       
    26 // FORWARD DECLARATIONS           
       
    27 class CVimpstImageProcessor;
       
    28 class CFbsBitmap;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32  * This Class is wrapper over the CVimpstImageProcessor implements the processing of image
       
    33  * @lib vimpstengine.lib
       
    34  * @since S60 5.0 
       
    35  */
       
    36 NONSHARABLE_CLASS( CVIMPSTEngineImageHandler ) : public CBase,							   
       
    37                                                  public MCAImageProcessObserver,
       
    38                                                  public MMdaImageUtilObserver
       
    39 
       
    40     {
       
    41 
       
    42 
       
    43     public:  // Two-phased constructors and destructor
       
    44 
       
    45         /**
       
    46          * Two-phased constructor.
       
    47          */
       
    48 
       
    49         IMPORT_C static CVIMPSTEngineImageHandler* NewL();
       
    50         /**
       
    51          * Two-phased constructor.
       
    52          */										
       
    53         IMPORT_C static CVIMPSTEngineImageHandler* NewLC();
       
    54         /**
       
    55          * By default Symbian 2nd phase constructor is private.
       
    56          */
       
    57         void ConstructL();
       
    58         /**
       
    59          * C++ Destructor.
       
    60          */
       
    61         virtual ~CVIMPSTEngineImageHandler();
       
    62 
       
    63 
       
    64     private:
       
    65 
       
    66         /**
       
    67          * default constructor
       
    68          */
       
    69         CVIMPSTEngineImageHandler();
       
    70 
       
    71 
       
    72 public: //from MMdaImageUtilObserver
       
    73     /**
       
    74      * Defines required client behaviour when a create operation has completed.
       
    75      *
       
    76      * @param aError:A value identifying the status of the create operation. KErrNone or one of the system wide error codes.
       
    77      * 
       
    78      */
       
    79     void MiuoCreateComplete(TInt aError);
       
    80     /**
       
    81      * Defines required client behaviour when an open operation has completed.
       
    82      *
       
    83      * @param aError: A value identifying the status of the open operation. KErrNone or one of the system wide error codes
       
    84      */
       
    85     void MiuoOpenComplete(TInt aError);
       
    86     /**
       
    87      * Defines required client behaviour when a conversion, image rotation or image re-scaling operation has completed.
       
    88      *
       
    89      * @param aError: A value identifying the status of the operation. KErrNone or one of the system wide error codes.
       
    90      */
       
    91     void MiuoConvertComplete(TInt aError);
       
    92 
       
    93     public: 
       
    94         /**
       
    95          * process the image from file name
       
    96          * @return processed image content	     
       
    97          */
       
    98         IMPORT_C HBufC8* ProcessImageFromFileL(const TDesC& aFilename ,
       
    99                 const  TDesC8& aMimetype);
       
   100         /**
       
   101          * process the image from image data
       
   102          * @return processed image content      
       
   103          */
       
   104         IMPORT_C HBufC8* ProcessImageFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType);
       
   105         /**
       
   106          * process the image from image bitmap
       
   107          * @return processed image content      
       
   108          */
       
   109         IMPORT_C HBufC8* ProcessFromBitmapL( CFbsBitmap& aBitMap );
       
   110 			 /**
       
   111         * Get Bitmap
       
   112         * @return bitmap
       
   113         */   
       
   114         IMPORT_C CFbsBitmap& Bitmap();
       
   115     public:  // from MCAImageProcessObserver
       
   116 
       
   117         /**
       
   118          * See MCAImageProcessObserver	     
       
   119          */
       
   120         void HandleProcessingCompleteL( TInt aStatus );	
       
   121 
       
   122 
       
   123     private:   	
       
   124 
       
   125 
       
   126         //Result code from waited request
       
   127         TInt    iReqResult;
       
   128 
       
   129         // Owns content
       
   130         HBufC8* iContent;
       
   131 
       
   132         // Owns imageporcessor
       
   133         CVimpstImageProcessor* iProcessor;
       
   134         
       
   135         // own active sheduler 
       
   136         CActiveSchedulerWait    iWait;
       
   137         /*
       
   138          * bitmap to descriptor pointer
       
   139          * Owns
       
   140          */
       
   141         CMdaImageBitmapToDescUtility* iToDesc;
       
   142         /*
       
   143          * image format
       
   144          */
       
   145         TMdaJfifClipFormat iFormat;
       
   146         /*
       
   147          * stores converted descriptor from bitmap
       
   148          * Doesn't Own: ownership is transferred to caller
       
   149          */
       
   150         HBufC8* iBuf;
       
   151         /*
       
   152          * stores error code
       
   153          */
       
   154         TInt iError;
       
   155 
       
   156     };
       
   157 
       
   158 #endif      //__CVIMPSTENGINEIMAGEHANDLER_H
       
   159 
       
   160 // End of File