securitydialogs/Autolock/inc/AutoKeyguardObserver.h
branchRCL_3
changeset 21 09b1ac925e3f
parent 20 63339781d179
child 22 03674e5abf46
equal deleted inserted replaced
20:63339781d179 21:09b1ac925e3f
     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 class MAutolockAppUiInterface;
       
    29 
       
    30 class CAutoKeyguardObserver : public CBase
       
    31 	{
       
    32 	public:
       
    33 		/**
       
    34         * Creates instance of the CAutoKeyguardObserver class.
       
    35         *
       
    36 		* @return Returns the instance just created.
       
    37         */
       
    38 		static CAutoKeyguardObserver* NewL( MAutolockAppUiInterface* aAppUiI );
       
    39 		/**
       
    40         * Symbian OS constructor.
       
    41         */
       
    42 		void ConstructL( CAutoKeyguardObserver* aObserver );
       
    43 		/**
       
    44         * Destructor.
       
    45         */
       
    46 		~CAutoKeyguardObserver();
       
    47 	public:
       
    48 		/**
       
    49         * Gets new autokeyguard period and starts monitoring user activity 
       
    50         */
       
    51 		void ResetInactivityTimeout();
       
    52 		/**
       
    53         * Activates keyguard 
       
    54 		*/
       
    55 		void LockKeysL();
       
    56 	private:
       
    57 		/**
       
    58         * C++ default constructor.
       
    59         */
       
    60 		CAutoKeyguardObserver( MAutolockAppUiInterface* aAppUiI ); 
       
    61 	private:
       
    62 		/**
       
    63         * Return current autokeyguard period
       
    64 		*
       
    65 		* @return TInt (autokeyguard period in minutes)
       
    66         */	
       
    67 		TInt AutoKeyguardTimeout();
       
    68 		/**
       
    69         * Handles Active event. Called by ActivityManager
       
    70 		*
       
    71 		* @param aPtr 
       
    72         * @return KErNone
       
    73 		*/
       
    74 		static TInt HandleActiveEventL(TAny* aPtr);
       
    75 		/**
       
    76         * Handles Inactive event. Called by ActivityManager
       
    77 		*
       
    78 		* @param aPtr (pointer to CAutoKeyguardObserver)
       
    79         * @return KErNone
       
    80 		*/
       
    81 		static TInt HandleInactiveEventL(TAny* aPtr);
       
    82 		/**
       
    83         * Starts monitoring user activity
       
    84         */		
       
    85 		void StartActivityMonitoringL();
       
    86 		/**
       
    87         * Stop monitoring user activity.
       
    88         */
       
    89 		void StopActivityMonitoring();
       
    90 		/**
       
    91         * Initializes activymanager 
       
    92         */
       
    93 		void SetActivityManagerL();
       
    94 		/**
       
    95         * UnInitializes activymanager 
       
    96         */
       
    97 		void CancelActivityManager();
       
    98 	private: //data
       
    99 		CUserActivityManager*    iActivityManager;
       
   100         CAutoKeyguardCenRepI*    iCenRepI;
       
   101         MAutolockAppUiInterface* iAppUiI;
       
   102 	};
       
   103 #endif
       
   104 // END OF FILE