securitydialogs/Autolock/inc/AutoKeyguardObserver.h
branchGCC_SURGE
changeset 40 604cd42065d1
parent 29 b63e8c2d8cff
parent 38 e0432375ea67
equal deleted inserted replaced
29:b63e8c2d8cff 40:604cd42065d1
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _AUTOKEYGUARDOBSERVER_H__
       
    20 #define _AUTOKEYGUARDOBSERVER_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <aknappui.h>
       
    24 #include <e32property.h>
       
    25 
       
    26 class CUserActivityManager;
       
    27 class CAutoKeyguardCenRepI;
       
    28 
       
    29 class CAutoKeyguardObserver : public CBase
       
    30 	{
       
    31 	public:
       
    32 		/**
       
    33         * Creates instance of the CAutoKeyguardObserver class.
       
    34         *
       
    35 		* @return Returns the instance just created.
       
    36         */
       
    37 		static CAutoKeyguardObserver* NewL();
       
    38 		/**
       
    39         * Symbian OS constructor.
       
    40         */
       
    41 		void ConstructL( CAutoKeyguardObserver* aObserver );
       
    42 		/**
       
    43         * Destructor.
       
    44         */
       
    45 		~CAutoKeyguardObserver();
       
    46 	public:
       
    47 		/**
       
    48         * Gets new autokeyguard period and starts monitoring user activity 
       
    49         */
       
    50 		void ResetInactivityTimeout();
       
    51 		/**
       
    52         * Activates keyguard 
       
    53 		*/
       
    54 		void LockKeysL();
       
    55 	private:
       
    56 		/**
       
    57         * C++ default constructor.
       
    58         */
       
    59 		CAutoKeyguardObserver(); 
       
    60 	private:
       
    61 		/**
       
    62         * Return current autokeyguard period
       
    63 		*
       
    64 		* @return TInt (autokeyguard period in minutes)
       
    65         */	
       
    66 		TInt AutoKeyguardTimeout();
       
    67 		/**
       
    68         * Handles Active event. Called by ActivityManager
       
    69 		*
       
    70 		* @param aPtr 
       
    71         * @return KErNone
       
    72 		*/
       
    73 		static TInt HandleActiveEventL(TAny* aPtr);
       
    74 		/**
       
    75         * Handles Inactive event. Called by ActivityManager
       
    76 		*
       
    77 		* @param aPtr (pointer to CAutoKeyguardObserver)
       
    78         * @return KErNone
       
    79 		*/
       
    80 		static TInt HandleInactiveEventL(TAny* aPtr);
       
    81 		/**
       
    82         * Starts monitoring user activity
       
    83         */		
       
    84 		void StartActivityMonitoringL();
       
    85 		/**
       
    86         * Stop monitoring user activity.
       
    87         */
       
    88 		void StopActivityMonitoring();
       
    89 		/**
       
    90         * Initializes activymanager 
       
    91         */
       
    92 		void SetActivityManagerL();
       
    93 		/**
       
    94         * UnInitializes activymanager 
       
    95         */
       
    96 		void CancelActivityManager();
       
    97 	private: //data
       
    98 		CUserActivityManager*    iActivityManager;
       
    99         CAutoKeyguardCenRepI*    iCenRepI;
       
   100 	};
       
   101 #endif
       
   102 // END OF FILE