idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp
branchRCL_3
changeset 11 ff572dfe6d86
parent 9 f966699dea19
equal deleted inserted replaced
9:f966699dea19 11:ff572dfe6d86
    16 */
    16 */
    17 #include <AknsUtils.h>
    17 #include <AknsUtils.h>
    18 #include <AknsDrawUtils.h>
    18 #include <AknsDrawUtils.h>
    19 #include <AknsConstants.h>
    19 #include <AknsConstants.h>
    20 #include <barsread.h>
    20 #include <barsread.h>
       
    21 #include <debug.h>
       
    22 
    21 #include "xnnodepluginif.h"
    23 #include "xnnodepluginif.h"
    22 #include "xndomproperty.h"
    24 #include "xndomproperty.h"
    23 #include "xnproperty.h"
    25 #include "xnproperty.h"
    24 #include "xncontroladapter.h"
    26 #include "xncontroladapter.h"
    25 
    27 
   110            }
   112            }
   111         }
   113         }
   112     }
   114     }
   113 
   115 
   114 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
       
   117 // CXnAnimationAdapter::DoEnterPowerSaveModeL
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120 void CXnAnimationAdapter::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ )
       
   121     {
       
   122     iInPowerSaveMode = ETrue;
       
   123     StopAnimation();
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CXnAnimationAdapter::DoExitPowerSaveModeL
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 void CXnAnimationAdapter::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ )
       
   131     {
       
   132     iInPowerSaveMode = EFalse;
       
   133     StartAnimation();
       
   134     }
       
   135 
       
   136 // -----------------------------------------------------------------------------
   115 // CXnNewstickerAdapter::MakeVisible()
   137 // CXnNewstickerAdapter::MakeVisible()
   116 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   117 //
   139 //
   118 void CXnAnimationAdapter::MakeVisible( TBool aVisible )
   140 void CXnAnimationAdapter::MakeVisible( TBool aVisible )
   119     {
   141     {
   174 // The call back function.
   196 // The call back function.
   175 // ----------------------------------------------------------------------------
   197 // ----------------------------------------------------------------------------
   176 //
   198 //
   177 TInt CXnAnimationAdapter::TimerCallBack(TAny* aAny)
   199 TInt CXnAnimationAdapter::TimerCallBack(TAny* aAny)
   178     {
   200     {
       
   201     __PRINTS( "CXnAnimationAdapter::TimerCallback, timer runs" );
   179     CXnAnimationAdapter* self = static_cast<CXnAnimationAdapter*> (aAny);
   202     CXnAnimationAdapter* self = static_cast<CXnAnimationAdapter*> (aAny);
   180 
   203 
   181     // Update widget
   204     // Update widget
   182     self->Update();
   205     self->Update();
   183 
   206 
   188 // CXnAnimationAdapter::StartAnimation()
   211 // CXnAnimationAdapter::StartAnimation()
   189 // ----------------------------------------------------------------------------
   212 // ----------------------------------------------------------------------------
   190 //
   213 //
   191 void CXnAnimationAdapter::StartAnimation()
   214 void CXnAnimationAdapter::StartAnimation()
   192     {
   215     {
   193     if ( !iPeriodicTimer && IsVisible() )
   216     if ( !iPeriodicTimer && IsVisible() && !iInPowerSaveMode )
   194         {
   217         {
   195        TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) );
   218        TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) );
   196        if ( err == KErrNone )
   219        if ( err == KErrNone )
   197            {
   220            {
   198 		   const TInt KPeriodicTimerInterval = 100000; // 0.1 sec
   221 		   const TInt KPeriodicTimerInterval = 100000; // 0.1 sec