gsprofilesrv_plat/settings_backgroundimage_api/inc/GsAsyncImageHandling.h
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2005 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GS_ASYNC_IMAGE_HANDLE_H
       
    22 #define GS_ASYNC_IMAGE_HANDLE_H
       
    23 
       
    24 #include    <e32base.h>
       
    25 #include    <imageconversion.h>
       
    26 #include    <bitmaptransforms.h>
       
    27 #include    <RPhCltServer.h>
       
    28 #include    <centralrepository.h>
       
    29 #include    "mgsasyncimagehandlingobserver.h"
       
    30 
       
    31 // CONSTANTS
       
    32 const TInt KGSMimeStringLength = 50;
       
    33 
       
    34 // DATA TYPES
       
    35 enum TGSBgImageType
       
    36     {
       
    37     EGSWelcomeNoteImage,
       
    38     EGSVtStillImage
       
    39     };
       
    40 
       
    41 enum TGSImgState
       
    42     {
       
    43     EGSWelcomeConversion,
       
    44     EGSWelcomeScaling,
       
    45     EGSVTConversion,
       
    46     EGSVTScaling
       
    47     };
       
    48     
       
    49 // FORWARD DECLARTION
       
    50 class CImageDecoder;
       
    51 class MGSAsyncImageHandlingObserver;
       
    52 
       
    53 
       
    54 // CLASS DECLARTION
       
    55 class CGSAsyncImageHandling : public CActive
       
    56   {
       
    57   public:
       
    58         // Static constructor
       
    59         IMPORT_C static CGSAsyncImageHandling* NewL(
       
    60                                 RFs& aFs,
       
    61                                 MGSAsyncImageHandlingObserver* aObserver,
       
    62                                 const TDesC& aDestinationPath );
       
    63         
       
    64         // Destructor
       
    65         ~CGSAsyncImageHandling();
       
    66   
       
    67         /*
       
    68          * Asynchronous loading/scaling/dithering of an image. 
       
    69          * The image is converted to a bitmap.
       
    70          */
       
    71         void ProcessImageL( const TDesC& aFilename, 
       
    72                                TInt aScreenWidth,
       
    73                                TInt aScreenHeight,
       
    74                                TGSBgImageType aBgImageType );
       
    75                                
       
    76         TDisplayMode GetDisplayMode( const TFrameInfo& aFrameInfo );
       
    77         
       
    78   private:
       
    79         // C++ constructor
       
    80         CGSAsyncImageHandling( RFs& aFs,
       
    81                                MGSAsyncImageHandlingObserver* aObserver,
       
    82                                const TDesC& aDestinationPath );
       
    83         
       
    84         /**
       
    85         * By default Symbian 2nd phase constructor is private.
       
    86         */
       
    87         void ConstructL();
       
    88         
       
    89         TSize CalculateLoadSize(TFrameInfo& aFrameInfo,
       
    90                                     const TSize aScreenSize );
       
    91                                     
       
    92         void SaveVTStillImageL();
       
    93   
       
    94   private:
       
    95         // From CActive
       
    96         void RunL();
       
    97         TInt RunError( TInt aError );
       
    98         void DoCancel();
       
    99         void Release();
       
   100         
       
   101   private:
       
   102         MGSAsyncImageHandlingObserver* iObserver;
       
   103         
       
   104         // File session
       
   105         RFs& iFs;
       
   106         
       
   107         // Image decoder
       
   108         CImageDecoder* iDecoder;
       
   109         
       
   110         // Currently open file Mime-string
       
   111         TBuf8<KGSMimeStringLength> iMimeString;
       
   112         
       
   113         CFbsBitmap* iBitmap;
       
   114         
       
   115         const TDesC& iDestinationPath;
       
   116         TInt iBgImageType;
       
   117         
       
   118         RPhCltServer iPhoneClient;
       
   119         RLibrary iLibrary;
       
   120         CRepository* iStartupRepository;
       
   121         CBitmapScaler* iBitmapScaler;
       
   122         TSize iScaleSize;
       
   123         TInt iState;
       
   124         
       
   125   };
       
   126   
       
   127 #endif // GS_ASYNC_IMAGE_HANDLE_H
       
   128 
       
   129 // End of File