idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp
branchRCL_3
changeset 15 ff572dfe6d86
parent 9 f966699dea19
--- a/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp	Fri Feb 19 22:42:37 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationadapter.cpp	Fri Mar 12 15:41:49 2010 +0200
@@ -18,6 +18,8 @@
 #include <AknsDrawUtils.h>
 #include <AknsConstants.h>
 #include <barsread.h>
+#include <debug.h>
+
 #include "xnnodepluginif.h"
 #include "xndomproperty.h"
 #include "xnproperty.h"
@@ -112,6 +114,26 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnAnimationAdapter::DoEnterPowerSaveModeL
+// -----------------------------------------------------------------------------
+//
+void CXnAnimationAdapter::DoEnterPowerSaveModeL( TModeEvent /*aEvent*/ )
+    {
+    iInPowerSaveMode = ETrue;
+    StopAnimation();
+    }
+
+// -----------------------------------------------------------------------------
+// CXnAnimationAdapter::DoExitPowerSaveModeL
+// -----------------------------------------------------------------------------
+//
+void CXnAnimationAdapter::DoExitPowerSaveModeL( TModeEvent /*aEvent*/ )
+    {
+    iInPowerSaveMode = EFalse;
+    StartAnimation();
+    }
+
+// -----------------------------------------------------------------------------
 // CXnNewstickerAdapter::MakeVisible()
 // -----------------------------------------------------------------------------
 //
@@ -176,6 +198,7 @@
 //
 TInt CXnAnimationAdapter::TimerCallBack(TAny* aAny)
     {
+    __PRINTS( "CXnAnimationAdapter::TimerCallback, timer runs" );
     CXnAnimationAdapter* self = static_cast<CXnAnimationAdapter*> (aAny);
 
     // Update widget
@@ -190,7 +213,7 @@
 //
 void CXnAnimationAdapter::StartAnimation()
     {
-    if ( !iPeriodicTimer && IsVisible() )
+    if ( !iPeriodicTimer && IsVisible() && !iInPowerSaveMode )
         {
        TRAPD(err, iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle) );
        if ( err == KErrNone )