skins/AknSkins/alinc/AknsAlShared.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Utility class for storing animation value and binding the animation
       
    15 *  value to timing model.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef AKNSALSHARED_H
       
    21 #define AKNSALSHARED_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 #include <AknsRlEffect.h>
       
    26 
       
    27 #include "AknsAlTimingModel.h"
       
    28 #include "AknsAlAnimationValue.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CAknsAlEffectParamContainer;
       
    32 class CAknsAlNamedReferenceContainer;
       
    33 
       
    34 class CAknsRlEffectPlugin;
       
    35 
       
    36 /**
       
    37 * Utility class for storing animation value and binding the animation value to
       
    38 * timing model.
       
    39 */
       
    40 NONSHARABLE_CLASS( CAknsAlAnimationValueContainer ): public CBase
       
    41     {
       
    42     protected:
       
    43         CAknsAlAnimationValueContainer();
       
    44         void ConstructL( MAknsAlAnimationValue* aValue,
       
    45                          const MAknsAlTimingModel* aModel );
       
    46 
       
    47     public:
       
    48         virtual ~CAknsAlAnimationValueContainer();
       
    49         static CAknsAlAnimationValueContainer* NewL( MAknsAlAnimationValue* aValue,
       
    50                                                      const MAknsAlTimingModel* aModel );
       
    51 
       
    52     public:
       
    53         inline void Tick( TUint32 aDeltaTime )
       
    54             {
       
    55             iAnimationValue->Tick( aDeltaTime, iTimingModel->RelativeValue() );
       
    56             }
       
    57 
       
    58         inline MAknsAlAnimationValue* AnimationValue() const
       
    59             {
       
    60             return iAnimationValue;
       
    61             }
       
    62 
       
    63         inline void Begin() { iAnimationValue->Begin(); }
       
    64 
       
    65     private:
       
    66         // Ownership vested here
       
    67         MAknsAlAnimationValue* iAnimationValue;
       
    68         // Only referencing
       
    69         const MAknsAlTimingModel* iTimingModel;
       
    70     };
       
    71 
       
    72 
       
    73 NONSHARABLE_CLASS( CAknsAlAnimationCommand ): public CBase
       
    74     {
       
    75     protected:
       
    76         CAknsAlAnimationCommand();
       
    77         void ConstructL();
       
    78 
       
    79     public:
       
    80         virtual ~CAknsAlAnimationCommand();
       
    81         static CAknsAlAnimationCommand* NewL();
       
    82 
       
    83         MAknsRlEffect* Effect();
       
    84         void AddParameterL( const TAknsRlParameterData& aParam );
       
    85         void AddNamedReferenceL( const TDesC& aName,
       
    86                                  const MAknsAlAnimationValue* aValue );
       
    87         /**
       
    88         * Ownership of plugin is transferred
       
    89         */
       
    90         void SetPlugin( CAknsRlEffectPlugin* aPlugin );
       
    91         void SetLayerConfig( const TAknsRlRenderOpParam& aConfig );
       
    92         const TAknsRlRenderOpParam& LayerConfig() const;
       
    93         MAknsRlParameterIterator* ParameterIterator();
       
    94         MAknsRlParameterIterator* NamedReferenceIterator();
       
    95 
       
    96     private:
       
    97 
       
    98         TAknsRlRenderOpParam iLayerConfig;
       
    99         // Effect plugin, owned
       
   100         CAknsRlEffectPlugin* iPlugin;
       
   101         // Stores initial (constant) parameters, owned
       
   102         CAknsAlEffectParamContainer* iParamContainer;
       
   103         // Stores time bound parameters (references to animation values), owned
       
   104         CAknsAlNamedReferenceContainer* iReferenceContainer;
       
   105     };
       
   106 
       
   107 #endif // AKNSALSHARED_H