securitydialogs/Autolock/inc/AutoLockCenRepI.h
branchRCL_3
changeset 22 03674e5abf46
parent 0 164170e6151a
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
       
     1 /*
       
     2 * Copyright (c) 2002 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 _AUTOLOCKCENREPI_H__
       
    20 #define _AUTOLOCKCENREPI_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <cenrepnotifyhandler.h> // link against CenRepNotifHandler.lib
       
    24 #include "AutolockAppUiPS.h"
       
    25 
       
    26 
       
    27 class CAutolockCenRepI : public CBase, public MCenRepNotifyHandlerCallback
       
    28 	{
       
    29 	public:
       
    30 		/**
       
    31         * Creates instance of the CAutolockShareDataI class.
       
    32         *
       
    33 		* @param aAppUi (pointer to autolock appui)
       
    34 		* @return Returns the instance just created.
       
    35         */
       
    36 		static CAutolockCenRepI* NewLC(CAutolockAppUi* aAppUi);
       
    37 		/**
       
    38         * Creates instance of the CAutolockShareDataI class.
       
    39         *
       
    40 		* @param aAppUi (pointer to autolock appui)
       
    41 		* @return Returns the instance just created.
       
    42         */
       
    43 		static CAutolockCenRepI* NewL(CAutolockAppUi* aAppUi);
       
    44 		/**
       
    45         * Destructor.
       
    46         */      
       
    47 		~CAutolockCenRepI();
       
    48 	public:
       
    49 		/**
       
    50         * Currenst autolock period
       
    51         *
       
    52 		* @return TInt (curenst autolock period in minutes) 
       
    53 		*/      
       
    54 		TInt Timeout();	
       
    55 		/**
       
    56         * Sets device lock value in SharedData
       
    57         *
       
    58 		* @param: aLocked (decice lock on/off) 
       
    59 		*/
       
    60 		void SetLockedL(TBool aLockValue);
       
    61         /**
       
    62         * From MCenRepNotifyHandlerCallback. Handles period changed event. Called by CenRep.
       
    63 		*
       
    64 		* @param aId (The id of the changed setting)
       
    65         * @param aNewValue (The new value of the changed setting)
       
    66         * @return KErNone
       
    67 		*/
       
    68         void HandleNotifyInt(TUint32 aId, TInt aNewValue);
       
    69 
       
    70         void HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler);
       
    71 
       
    72         void HandleNotifyGeneric(TUint32 aId);
       
    73 
       
    74 	private:
       
    75 		/**
       
    76         * C++ default constructor.
       
    77 		*
       
    78 		* @param aAppUi (pointer to autolock appui)
       
    79         */
       
    80 		CAutolockCenRepI(CAutolockAppUi* aAppUi);
       
    81 		/**
       
    82         * Symbian OS constructor.
       
    83         */
       
    84 		void ConstructL();
       
    85 	private:
       
    86 		/**
       
    87         * Handles period changed event. Called by CSharedDataInteger
       
    88 		*
       
    89 		* @param aPtr (pointer to CAutolockShareDataI)
       
    90         * @return KErNone
       
    91 		*/
       
    92 		TInt HandleTimeoutChangedL();
       
    93 		/**
       
    94         * Tells model that autolock period has been changed
       
    95 		*/
       
    96 		void ResetInactivityTimeout();	
       
    97 	private: // data
       
    98 		CAutolockAppUi*          iAppUi; //not owned!
       
    99         CCenRepNotifyHandler* iNotifyHandler;
       
   100         CRepository* iSession;
       
   101 
       
   102 	};
       
   103 
       
   104 #endif
       
   105 // END OF FILE