securitydialogs/lockapp/inc/lockappsession.h
branchRCL_3
changeset 21 09b1ac925e3f
parent 20 63339781d179
child 22 03674e5abf46
equal deleted inserted replaced
20:63339781d179 21:09b1ac925e3f
     1 /*
       
     2 * Copyright (c) 2007 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:  LockApp server session requested by lockclient
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOCKAPPSESSION_H__
       
    20 #define __LOCKAPPSESSION_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <apaserverapp.h>
       
    24 #include "lockapp.hrh"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MLockAppStateControl;
       
    28 
       
    29 /**
       
    30  *  CLockAppSession class is the server side implementation of the Lockapp API. 
       
    31  *  The session class offers keyguard and devicelock API for clients wanting to 
       
    32  *  alter phone lock states.
       
    33  *
       
    34  *  @lib    lockapp
       
    35  *  @since  5.0
       
    36  *  @author Joona Petrell
       
    37  *  @author Tamas Koteles
       
    38  */
       
    39 class CLockAppSession : public CApaAppServiceBase
       
    40 	{
       
    41 	public:
       
    42 
       
    43 		/**
       
    44 		 * C++ default constructor.
       
    45 		 */
       
    46 		CLockAppSession( );
       
    47 
       
    48 	private:
       
    49 		/**
       
    50 		 * Destructor.
       
    51 		 */
       
    52 		~CLockAppSession( );
       
    53 
       
    54 		/**
       
    55 		 * From @c CApaAppServiceBase. Handles possible error in
       
    56 		 * service. Method is empty.
       
    57 		 * @param aMessage received message
       
    58 		 * @param aError an error id
       
    59 		 */
       
    60 		void ServiceError( const RMessage2& aMessage, TInt aError );
       
    61 
       
    62 		/**
       
    63 		 * From @c CApaAppServiceBase. Receives messages.
       
    64 		 * @param aMessage received message
       
    65 		 */
       
    66 		void ServiceL( const RMessage2& aMessage );
       
    67 
       
    68 	private:
       
    69 
       
    70 		/**
       
    71 		 * Ask state control to activate keyguard lock.
       
    72 		 *
       
    73 		 * @param aWithNote if "keys locked" note is shown
       
    74 		 * @return error code
       
    75 		 */
       
    76 		TInt DoEnableKeyguardL( TBool aWithNote );
       
    77 
       
    78 		/**
       
    79 		 * Ask state control to deacctivate keyguard lock.
       
    80 		 *
       
    81 		 * @param aWithNote if "keys active" note is shown.
       
    82 		 * @return error code
       
    83 		 */
       
    84 		TInt DoDisableKeyguardL( TBool aWithNote );
       
    85 
       
    86 		/**
       
    87 		 * Ask state control to activate devicelock.
       
    88 		 * @return error code
       
    89 		 */
       
    90 		TInt DoEnableDevicelockL( TDevicelockReason aReason );
       
    91 
       
    92 		/**
       
    93 		 * Ask state control to deactivate devicelock.
       
    94 		 * @return error code
       
    95 		 */
       
    96 		TInt DoDisableDevicelockL( );
       
    97 
       
    98 		/**
       
    99 		 * Ask state control to offer to enable keyguard.
       
   100 		 * by showing "offerkeylock" note.
       
   101 		 * @return error code
       
   102 		 */
       
   103 		TInt DoOfferKeyguardL( );
       
   104 
       
   105 		/**
       
   106 		 * Ask state control to inform user that keys are locked.
       
   107 		 * @return error code
       
   108 		 */
       
   109 		TInt DoShowKeysLockedNoteL( );
       
   110 
       
   111 	private:
       
   112 
       
   113 		/**
       
   114 		 * Access to lock state control
       
   115 		 * @return the main state control, from which lock states are changed
       
   116 		 */
       
   117 		MLockAppStateControl* StateControlL( );
       
   118 
       
   119 		/**
       
   120 		 * The main state control
       
   121 		 * Not owned.
       
   122 		 */
       
   123 		MLockAppStateControl* iStateControl;
       
   124 	};
       
   125 
       
   126 #endif //__LOCKAPPSESSION_H__