diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-1941FC6C-4E2B-5549-96C8-6090DB0C40E1.dita --- a/Symbian3/PDK/Source/GUID-1941FC6C-4E2B-5549-96C8-6090DB0C40E1.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-1941FC6C-4E2B-5549-96C8-6090DB0C40E1.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,72 +1,72 @@ - - - - - -Activity -Manager Tutorial

This section explains how to implement Activity Manager.

An -object of the CUserActivityManager class must be included -as a member of the component which need to react to activity and inactivity.

- - -Create an object of CUserActivityManager. - - -Create an activity callback function implementing the transition to -device activity. - - -Create an inactivity callback function implementing the transition to -device inactivity. - - -Call the CUserActivityManager::StartL() function using -the object of CUserActivityManager. This function accepts -the following three arguments: -

    -
  • an integer representing the inactivity interval in seconds,

  • -
  • the inactivity callback, and

  • -
  • the activity callback.

  • -

-The callback arguments are instances of TCallBack. -
-
-Activity manager example #include <activitymanager.h> -… -// Activity Manager instance is created and started - -void CSomeComponent::ConstructL() - { - … - iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard ); - - iActivityManager->StartL( iTimeout, - TCallBack( HandleInactiveEvent, this ), - TCallBack( HandleActiveEvent, this ) ); - … - } -… -// Handles inactive event -TInt CSomeComponent::HandleInactivityEvent( TAny* aPtr ) - { - // Code to be executed in case of user inactivity - … - } - -// Handles active event -TInt CSomeComponent::HandleActivityEvent( TAny* aPtr ) - { - // Code to be executed in case of user activity after an inactivity period. - … - } - -
-Activity -Manager Overview + + + + + +Activity +Manager Tutorial

This section explains how to implement Activity Manager.

An +object of the CUserActivityManager class must be included +as a member of the component which need to react to activity and inactivity.

+ + +Create an object of CUserActivityManager. + + +Create an activity callback function implementing the transition to +device activity. + + +Create an inactivity callback function implementing the transition to +device inactivity. + + +Call the CUserActivityManager::StartL() function using +the object of CUserActivityManager. This function accepts +the following three arguments: +

    +
  • an integer representing the inactivity interval in seconds,

  • +
  • the inactivity callback, and

  • +
  • the activity callback.

  • +

+The callback arguments are instances of TCallBack. +
+
+Activity manager example #include <activitymanager.h> +… +// Activity Manager instance is created and started + +void CSomeComponent::ConstructL() + { + … + iActivityManager = CUserActivityManager::NewL( CActive::EPriorityStandard ); + + iActivityManager->StartL( iTimeout, + TCallBack( HandleInactiveEvent, this ), + TCallBack( HandleActiveEvent, this ) ); + … + } +… +// Handles inactive event +TInt CSomeComponent::HandleInactivityEvent( TAny* aPtr ) + { + // Code to be executed in case of user inactivity + … + } + +// Handles active event +TInt CSomeComponent::HandleActivityEvent( TAny* aPtr ) + { + // Code to be executed in case of user activity after an inactivity period. + … + } + +
+Activity +Manager Overview
\ No newline at end of file