photosgallery/slideshow/view/src/shwslideshowbacklighttimer.cpp
branchRCL_3
changeset 9 6b87b143d312
parent 0 4e91876724a2
child 13 71da52165949
child 16 0bc0ea26031e
equal deleted inserted replaced
5:f7f0874bfe7d 9:6b87b143d312
    26 #include "shwcallback.h"
    26 #include "shwcallback.h"
    27 
    27 
    28 namespace
    28 namespace
    29 	{
    29 	{
    30 	const TInt KMicroSecondsInASecond = 1000000;
    30 	const TInt KMicroSecondsInASecond = 1000000;
       
    31     
       
    32 	// @ref: Minimum slideshow transition delay
       
    33 	const TInt KMinTimeoutDelay = 2; // secs 
    31 	}
    34 	}
    32 
    35 
    33 // -----------------------------------------------------------------------------
    36 // -----------------------------------------------------------------------------
    34 // CShwSlideshowBackLightTimer::CShwSlideshowBackLightTimer
    37 // CShwSlideshowBackLightTimer::CShwSlideshowBackLightTimer
    35 // C++ default constructor can NOT contain any code, that
    38 // C++ default constructor can NOT contain any code, that
    93         screenSaverTimeout );
    96         screenSaverTimeout );
    94     CleanupStack::PopAndDestroy( repository );
    97     CleanupStack::PopAndDestroy( repository );
    95     
    98     
    96     // Take the smaller of the two timeout values
    99     // Take the smaller of the two timeout values
    97     iSettingsDelay = Min( iSettingsDelay, screenSaverTimeout );
   100     iSettingsDelay = Min( iSettingsDelay, screenSaverTimeout );
       
   101     
       
   102     // Set the timeout delay to minimum value as it can not be zero!
       
   103     if (iSettingsDelay == 0)
       
   104         {
       
   105         iSettingsDelay = KMinTimeoutDelay;
       
   106         }
       
   107     
    98     // Convert the value to microseconds
   108     // Convert the value to microseconds
    99     iSettingsDelay *= KMicroSecondsInASecond;
   109     iSettingsDelay *= KMicroSecondsInASecond;
   100     // Halve the value to ensure out timer kicks beforehand
   110     // Halve the value to ensure out timer kicks beforehand
   101     iSettingsDelay /= 2;
   111     iSettingsDelay /= 2;
   102     
   112     
   108 // CShwSlideshowBackLightTimer::Tick - handler code for the timer
   118 // CShwSlideshowBackLightTimer::Tick - handler code for the timer
   109 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   110 //
   120 //
   111 TInt CShwSlideshowBackLightTimer::Tick()
   121 TInt CShwSlideshowBackLightTimer::Tick()
   112     {
   122     {
   113 	// Timer must be reset to prevent screen saver to appear in 
   123 	// Timer must be reset to prevent screen saver to appear
   114 	// Aalto when the slide is closed. Should not cause any side effects.
       
   115 	User::ResetInactivityTime();
   124 	User::ResetInactivityTime();
   116 	iStartTime.HomeTime();
   125 	iStartTime.HomeTime();
   117 
   126 
   118 	return 1; // continues always
   127 	return 1; // continues always
   119     }
   128     }