photosgallery/viewframework/dataprovider/inc/glxdrmgiftexturecreator.h
branchRCL_3
changeset 60 5b3385a43d68
child 64 34937ec34dac
equal deleted inserted replaced
59:8e5f6eea9c9f 60:5b3385a43d68
       
     1 /* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     2 * All rights reserved.
       
     3 * This component and the accompanying materials are made available
       
     4 * under the terms of "Eclipse Public License v1.0"
       
     5 * which accompanies this distribution, and is available
       
     6 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 *
       
     8 * Initial Contributors:
       
     9 * Nokia Corporation - initial contribution.
       
    10 *
       
    11 * Contributors:
       
    12 *
       
    13 * Description:    Gif Texture creator implementation
       
    14 *
       
    15 */
       
    16 
       
    17 #ifndef GLXDRMGIFTEXTURECREATOR_H_
       
    18 #define GLXDRMGIFTEXTURECREATOR_H_
       
    19 
       
    20 #include <w32std.h>
       
    21 #include <fbs.h>
       
    22 #include <icl\imagedata.h>
       
    23 
       
    24 class CGlxDRMgifDecoderAO;
       
    25 class CImageDecoder;
       
    26 class CGlxUiUtility;
       
    27 class CGlxBinding;
       
    28 class TGlxMedia;                            // Reference to a media item in the item pool
       
    29 class CAlfEnv;
       
    30 
       
    31 namespace Alf
       
    32     {
       
    33     class IMulModel;                        // An interface for the data model
       
    34     class IMulWidget;                       // An interface for all Multimedia widgets
       
    35     class MulVisualItem;                    // Client need to use this class to add data in data model
       
    36     }
       
    37 
       
    38 const TInt KGlxMaxFrameCount = 25;
       
    39 
       
    40 class CGlxDrmGifTextureCreator: public CBase
       
    41     {
       
    42 public:
       
    43     /*
       
    44      * 
       
    45      */
       
    46     static CGlxDrmGifTextureCreator* NewL(const CGlxBinding& aBinding,
       
    47             const TGlxMedia& aMedia, TInt aItemIndex,  Alf::IMulModel* aModel);
       
    48     
       
    49     /*
       
    50      * destructor
       
    51      */
       
    52     ~CGlxDrmGifTextureCreator();
       
    53 public:
       
    54     /*
       
    55      * This is to cancel the active object from decoding 
       
    56      */
       
    57     void HandleRunL(TRequestStatus& aStatus);
       
    58 
       
    59     /*
       
    60      * This updates the new image.
       
    61      */
       
    62     void UpdateNewImageL(const TGlxMedia& aMedia, TInt aItemIndex);
       
    63     
       
    64     /*
       
    65      * Enable/Disable the animation
       
    66      */
       
    67     void AnimateDRMGifItem(TBool aAnimate);
       
    68 
       
    69 private:
       
    70     /*
       
    71      * Ctor 
       
    72      */
       
    73     CGlxDrmGifTextureCreator(const CGlxBinding& aBinding,
       
    74             const TGlxMedia& aMedia, TInt aItemIndex,  Alf::IMulModel* aModel);
       
    75     
       
    76     /*
       
    77      * ConstructL()
       
    78      */
       
    79     void ConstructL();   
       
    80     
       
    81     /*
       
    82      * Call a refresh on the screen  
       
    83      */
       
    84     void RefreshL();
       
    85     
       
    86     /*
       
    87      * Release contents 
       
    88      */
       
    89     void ReleaseContent();
       
    90     
       
    91     /*
       
    92      * Create bitmap  
       
    93      */
       
    94     void CreateBitmapAndStartDecodingL();
       
    95     
       
    96     /*
       
    97      * Create an image decoder with given file
       
    98      * @param - Image file 
       
    99      */
       
   100     void CreateImageDecoderL(const TDesC& aImageFile);
       
   101 
       
   102 	static TInt TimerCallbackL(TAny* aThis);
       
   103     
       
   104     /*
       
   105      * ProcessTimerEventL
       
   106      */
       
   107     void ProcessTimerEventL();
       
   108 
       
   109     /*
       
   110 	 * ProcessImageL
       
   111 	 */
       
   112 	void ProcessImageL();
       
   113 	
       
   114 	void SetTexture(TInt aTextureId=KErrNotFound);
       
   115 
       
   116 private:
       
   117 
       
   118     TSize iOrigImageDimensions;
       
   119     TInt iFrameCount;
       
   120 
       
   121     CFbsBitmap*         iDecodedBitmap[KGlxMaxFrameCount];             //Decoded bitmap of the focussed image
       
   122     CFbsBitmap*         iDecodedMask[KGlxMaxFrameCount];
       
   123     
       
   124     //ICL
       
   125     CGlxDRMgifDecoderAO*  iGlxDecoderAO;            // Internal Image decoder AO              
       
   126     CImageDecoder*      iImageDecoder;              // Image Decoder
       
   127     TInt                iAnimCount;                 // animation count
       
   128     RFs                 iFsSession;                 // RFs
       
   129     
       
   130     CPeriodic* iTimer;
       
   131     CPeriodic* iAnimationTimer;
       
   132 	TBool iBitmapReady;
       
   133 #ifdef _DEBUG
       
   134     TTime iStartTime;
       
   135     TTime iStopTime;
       
   136 #endif   
       
   137     
       
   138     const CGlxBinding* iBinding;
       
   139     const TGlxMedia* iMedia;
       
   140     Alf::IMulModel* iModel;
       
   141     TInt iItemIndex;
       
   142     CGlxUiUtility* iUiUtility ;
       
   143     TBool iAnimateFlag;
       
   144     TBool iTransparencyPossible;
       
   145     TFrameInfo iFrameInfo;
       
   146     TBool iFrameShift;
       
   147     };
       
   148 #endif /* GLXDRMGIFTEXTURECREATOR_H_ */