|
|
Classification: |
C++ |
Category: |
Timers |
Created: |
01/06/2003 |
Modified: |
01/10/2003 |
Number: |
FAQ-0843 |
Platform: |
Symbian OS v6.0 |
|
Question: I would like to know how to access and/or modify the system time-outs for such things as backlight and screen display on a
9200 Series communicator. Is this possible and if so how?
Answer: You can do this with a RSystemTimer session. This is defined in systimer.h and provides three useful methods:IMPORT_C void GetTimerL(TSysTimer aTimer, TTimeIntervalSeconds& aTimeout); IMPORT_C void SetTimerL(TSysTimer aTimer, TTimeIntervalSeconds aTimeout); IMPORT_C void ResetTimerL(TSysTimer aTimer);
The first of these allows you to get the time-out value (in seconds) currently associated with the particular system timer
defined by the TSysTimer enum passed: enum TSysTimer{ EScreenTimeout, EBacklightTimeout, EPasswordTimeout, EUikSaveTimeout };
The second of these methods allows you to modify the timeout value used, while the third method allows you to restart the
timer.
The default values for the screen and backlight are 300 (5 mins) and 180 (3 mins), respectively. The default value for the
password time-out is 0, which means a password, once successfully entered, does not expire. The save time-out relates to dialogs
but is unused by default.
The following code, which should be linked against systimer.lib, will recover the current password time-out value:
#include "systimer.h"
RSystemTimer systemTimer; User::LeaveIfError(systemTimer.Connect()); CleanupClosePushL(systemTimer); TTimeIntervalSeconds passwordTimeoutValue; systemTimer.GetTimerL(EPasswordTimeout, passwordTimeoutValue)); CleanupStack::PopAndDestroy(); // systemTimer
|
|
|