uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiskinanimationtexture.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:   Texture class to support Legacy theme animation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __HUISKINANIMATIONTEXTURE__
       
    21 #define __HUISKINANIMATIONTEXTURE__
       
    22 
       
    23 #include <uiacceltk/HuiAnimatedTexture.h>
       
    24 #include <uiacceltk/HuiTextureManager.h>
       
    25 
       
    26 class CHuiSkinBitmapProvider;
       
    27 
       
    28 /**
       
    29  * @deprecated <b>Trying to create this class will leave with KErrNotSupported!</b>
       
    30  * 
       
    31  * Loads a sequence of images from S60 theme to support animated texture.
       
    32  */    
       
    33 NONSHARABLE_CLASS(CHuiSkinAnimationTexture) : public CHuiAnimatedTexture,
       
    34                                 public MHuiTextureLoadingCompletedObserver
       
    35     {
       
    36 public:
       
    37     // Animation state
       
    38     enum TAnimationState
       
    39         {
       
    40         EInitializing   = 0x1,
       
    41         ERunning        = 0x2,
       
    42         EStopped        = 0x4
       
    43         };
       
    44 
       
    45      /**
       
    46      * @deprecated <b>Trying to create this class will leave with KErrNotSupported!</b>
       
    47      * 
       
    48      * Loads a sequence of images and makes it an animated texture.
       
    49      *
       
    50      * @param aSkinName             Logical name of animated element
       
    51      * @param aId                   Id for the texture. Must be unique.
       
    52      * @param aFlags                Specify load/upload behavior
       
    53      *
       
    54      * @return Reference to the texture.
       
    55      *
       
    56      * @see SetImagePathL() To set the image search path. Set to "" to use
       
    57      * absolute image filenames.
       
    58      * @see IsLoaded()
       
    59      */
       
    60     IMPORT_C static CHuiSkinAnimationTexture* NewL(const TDesC& aSkinName,
       
    61                                                       CHuiTextureManager& aManager,
       
    62                                                       TInt aID,
       
    63                                                       THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
       
    64     //destructor
       
    65     IMPORT_C ~CHuiSkinAnimationTexture();
       
    66 
       
    67     // animation framework callback
       
    68     void AdvanceTime(TReal32 aElapsedTime) __SOFTFP;
       
    69     
       
    70     // Framework callback after load texture complete
       
    71     void TextureLoadingCompleted(CHuiTexture& aTexture,
       
    72                                          TInt aTextureId,
       
    73                                          TInt aErrorCode);
       
    74                                        
       
    75     IMPORT_C TInt Id();
       
    76     
       
    77     /** Start animation, continue refresh from current frame */
       
    78     IMPORT_C void Start();
       
    79     
       
    80     /** Stop animation, stop refresh to current frame */
       
    81     IMPORT_C void Stop();
       
    82 
       
    83 protected:
       
    84     CHuiSkinAnimationTexture(CHuiTextureManager& aManager,THuiTextureUploadFlags aFlags, TInt aId);
       
    85     void ConstructL(const TDesC& aFilename);
       
    86     void ReplaceTexture(CHuiTexture* aTexture);
       
    87 
       
    88 private:
       
    89     TInt iCurrentTextureId;
       
    90     TInt iFrameInterval;
       
    91     TInt iFrameCount;
       
    92     
       
    93     TInt iAnimationState; // todo: is this supposed operate based on finary flags or not ?
       
    94     
       
    95     THuiTextureUploadFlags iFlags;
       
    96     TInt iId;
       
    97     TReal32 iElapsedTime;
       
    98     CHuiSkinBitmapProvider* iSkinBitmapProvider;	// Skin Bitmap provider
       
    99     };
       
   100 
       
   101 
       
   102 #endif