inc/screensaveractivitymanager.h
branchRCL_3
changeset 13 4784a3bc2236
child 15 0bfd55b8504e
equal deleted inserted replaced
12:1c806ee746e7 13:4784a3bc2236
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // CScreensaverActivityManager class
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef SCREENSAVERACTIVITYMANAGER_H
       
    19 #define SCREENSAVERACTIVITYMANAGER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 
       
    24 class CScreensaverActivityManager : public CTimer
       
    25 	{
       
    26 public:
       
    27  	static CScreensaverActivityManager* NewL(TInt aPriority);
       
    28 	~CScreensaverActivityManager();
       
    29 	void Start(TTimeIntervalSeconds aInterval,
       
    30 	                    TCallBack aInactiveCallback,
       
    31 	                    TCallBack aActiveCallback);
       
    32 	void SetInactivityTimeout(TTimeIntervalSeconds aInterval);
       
    33 private:
       
    34 	void RunL();
       
    35 	CScreensaverActivityManager(TInt aPriority);
       
    36 	void MonitorInactivity();
       
    37 private:
       
    38 
       
    39     enum TState {
       
    40         EStUndefined = 0,    //< Never used, reserved
       
    41         EStNotActive,        //< Constructed but not started
       
    42         EStMonForInactivity, //< Monitoring user inactivity mode
       
    43         EStMonForActivity    //< Monitoring user activity mode
       
    44     };
       
    45 
       
    46     /** Inactivity interval */
       
    47     TTimeIntervalSeconds iInterval;
       
    48     
       
    49     /** Callback to be used in case that user inactivity is detected */
       
    50 	TCallBack            iInactiveCallback;
       
    51 	
       
    52     /** Callback to be used in case of user activity after inactivity period */
       
    53 	TCallBack            iActiveCallback;
       
    54 	
       
    55     /** State of object, what form of monitoring is active. */
       
    56 	TState                iState;
       
    57 	};
       
    58 
       
    59 #endif // SCREENSAVERACTIVITYMANAGER_H