diff -r 000000000000 -r 164170e6151a securitydialogs/Autolock/inc/AutoKeyguardObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securitydialogs/Autolock/inc/AutoKeyguardObserver.h Tue Jan 26 15:20:08 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef _AUTOKEYGUARDOBSERVER_H__ +#define _AUTOKEYGUARDOBSERVER_H__ + +#include +#include +#include + +class CUserActivityManager; +class CAutoKeyguardCenRepI; + +class CAutoKeyguardObserver : public CBase + { + public: + /** + * Creates instance of the CAutoKeyguardObserver class. + * + * @return Returns the instance just created. + */ + static CAutoKeyguardObserver* NewL(); + /** + * Symbian OS constructor. + */ + void ConstructL( CAutoKeyguardObserver* aObserver ); + /** + * Destructor. + */ + ~CAutoKeyguardObserver(); + public: + /** + * Gets new autokeyguard period and starts monitoring user activity + */ + void ResetInactivityTimeout(); + /** + * Activates keyguard + */ + void LockKeysL(); + private: + /** + * C++ default constructor. + */ + CAutoKeyguardObserver(); + private: + /** + * Return current autokeyguard period + * + * @return TInt (autokeyguard period in minutes) + */ + TInt AutoKeyguardTimeout(); + /** + * Handles Active event. Called by ActivityManager + * + * @param aPtr + * @return KErNone + */ + static TInt HandleActiveEventL(TAny* aPtr); + /** + * Handles Inactive event. Called by ActivityManager + * + * @param aPtr (pointer to CAutoKeyguardObserver) + * @return KErNone + */ + static TInt HandleInactiveEventL(TAny* aPtr); + /** + * Starts monitoring user activity + */ + void StartActivityMonitoringL(); + /** + * Stop monitoring user activity. + */ + void StopActivityMonitoring(); + /** + * Initializes activymanager + */ + void SetActivityManagerL(); + /** + * UnInitializes activymanager + */ + void CancelActivityManager(); + private: //data + CUserActivityManager* iActivityManager; + CAutoKeyguardCenRepI* iCenRepI; + }; +#endif +// END OF FILE