uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiAnimatedTexture.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:   Defines CHuiAnimatedTexture base class, which can be used as 
       
    15 *                a base class for application-specific animated textures.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __HUIANIMATEDTEXTURE_H__
       
    22 #define __HUIANIMATEDTEXTURE_H__
       
    23 
       
    24 
       
    25 #include <uiacceltk/HuiTexture.h>
       
    26 #include <uiacceltk/HuiTimeObserver.h>
       
    27 
       
    28 
       
    29 /* Forward declarations. */
       
    30 class CHuiTextureManager;
       
    31 
       
    32 
       
    33 /**
       
    34  * Animated textures are informed of the progress of time. Before a display
       
    35  * refresh occurs, the texture manager will tell all animated textures to
       
    36  * update themselves.
       
    37  *
       
    38  * CHuiAnimatedTexture can be used as a base class for application-specific
       
    39  * animated texture classes.
       
    40  */
       
    41 class CHuiAnimatedTexture : public CBase,
       
    42                             public MHuiTexture,
       
    43                             public MHuiSegmentedTexture,
       
    44                             public MHuiTimeObserver
       
    45     {
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     IMPORT_C ~CHuiAnimatedTexture();
       
    52 
       
    53 
       
    54 public: // new methods
       
    55 
       
    56     /**
       
    57      * Returns the texture object associated with this animated texture.
       
    58      */
       
    59     IMPORT_C CHuiTexture& Texture();
       
    60 
       
    61     /**
       
    62      * Called to update the texture when time progresses.
       
    63      */
       
    64     virtual void AdvanceTime(TReal32 aElapsedTime) __SOFTFP = 0;
       
    65 
       
    66 
       
    67 public: // from MHuiTexture
       
    68 
       
    69     IMPORT_C MHuiSegmentedTexture* SegmentedTexture();
       
    70 
       
    71     IMPORT_C const MHuiSegmentedTexture* SegmentedTexture() const;
       
    72     
       
    73     IMPORT_C MHuiShadowedTexture* ShadowedTexture();
       
    74     
       
    75     IMPORT_C const MHuiShadowedTexture* ShadowedTexture() const;
       
    76 
       
    77     IMPORT_C TBool HasContent() const;
       
    78 
       
    79 
       
    80 public: //  MHuiSegmentedTexture
       
    81 
       
    82     IMPORT_C TSize Size() const;
       
    83     
       
    84     IMPORT_C TInt SegmentCount() const;
       
    85     
       
    86     IMPORT_C TUint SegmentName(TInt aSegment) const;
       
    87     
       
    88     IMPORT_C TSize SegmentSize(TInt aSegment) const;
       
    89     
       
    90     IMPORT_C TSize SegmentTextureSize(TInt aSegment) const;
       
    91     
       
    92     IMPORT_C TPoint SegmentOffset(TInt aSegment) const;
       
    93     
       
    94 	IMPORT_C TBool TextureChanged() const;
       
    95 
       
    96 	IMPORT_C void TextureClearChanged() const;    
       
    97 
       
    98 protected:
       
    99 
       
   100     /**
       
   101      * Default constructor.
       
   102      */
       
   103     IMPORT_C CHuiAnimatedTexture(CHuiTextureManager& aManager);
       
   104 
       
   105     /**
       
   106      * Second-phase constructor.
       
   107      */
       
   108     IMPORT_C void BaseConstructL();
       
   109     
       
   110 protected: // from MHuiTexture
       
   111     
       
   112     IMPORT_C void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
       
   113 
       
   114 protected:
       
   115 
       
   116     /** Texture manager who owns this texture. */
       
   117     CHuiTextureManager& iManager;
       
   118 
       
   119     /** Contents of the animated texture. */
       
   120     CHuiTexture* iTexture;
       
   121 private:
       
   122     TAny* iSpare;
       
   123     };
       
   124 
       
   125 
       
   126 #endif // __HUIANIMATEDTEXTURE_H__