securitydialogs/lockapp/inc/lockappbasecontrol.h
branchRCL_3
changeset 22 03674e5abf46
parent 0 164170e6151a
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
       
     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:  Base control for logical UI components
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOCKAPPBASECONTROL_H__
       
    20 #define __LOCKAPPBASECONTROL_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include "lockappstateobserver.h"
       
    25 #include "lockapplockednote.h"
       
    26 #include "lockappkeypattern.h"
       
    27 #include <keylockpolicyapi.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MLockAppStateControl;
       
    31 class CEikButtonGroupContainer;
       
    32 
       
    33 /**
       
    34  *  CLockAppBaseControl class is the base control of lockapp state controls,
       
    35  *  provides common interface and some protected utility methods.
       
    36  *
       
    37  *  @lib    lockapp
       
    38  *  @since  5.0
       
    39  *  @author Joona Petrell
       
    40  *  @author Tamas Koteles
       
    41  */
       
    42 class CLockAppBaseControl : public CCoeControl, public MLockAppStateObserver
       
    43 	{
       
    44 	public:
       
    45 
       
    46 		/**
       
    47 		 * Destructor.
       
    48 		 */
       
    49 		~CLockAppBaseControl( );
       
    50 
       
    51 		/**
       
    52 		 * From @c MLockAppStateObserver. Method handles the lock state changes.
       
    53 		 *
       
    54 		 * @param aStatus The new lock state
       
    55 		 */
       
    56 		virtual void HandleLockStatusChangedL( TLockStatus aStatus );
       
    57 
       
    58 		/**
       
    59 		 * Handles control activation.
       
    60 		 * 
       
    61 		 * @param aEnvMask environment bitmask
       
    62 		 */
       
    63 		virtual void HandleActivateEventL( TUint aEnvMask );
       
    64 
       
    65 		/**
       
    66 		 * Handles control deactivation.
       
    67 		 * 
       
    68 		 * @param aEnvMask environment bitmask
       
    69 		 */
       
    70 		virtual void HandleDeActivateEventL( TUint aEnvMask );
       
    71 
       
    72 		/**
       
    73 		 * Handle environment bitmask change.
       
    74 		 * 
       
    75 		 * @param aEnvMask environment bitmask
       
    76 		 * @param aEventMask event bitmask
       
    77 		 */
       
    78 		virtual void HandleEnvironmentChange( TUint aEnvMask, TUint aEventMask );
       
    79 
       
    80 	protected:
       
    81 
       
    82 		/**
       
    83 		 * Default Constructor.
       
    84 		 * 
       
    85 		 * @param aStateControl state control interface
       
    86 		 */
       
    87 		CLockAppBaseControl( MLockAppStateControl& aStateControl );
       
    88 
       
    89 		/**
       
    90 		 * 2nd phase constructor.
       
    91 		 */
       
    92 		void ConstructL( );
       
    93 
       
    94 		/**
       
    95 		 * Set up the control's keypattern matcher with the specified keylockpolicy.
       
    96 		 * 
       
    97 		 * @param aType keylock policy type (lock,unlock,devicelock) 
       
    98 		 */
       
    99 		TBool SetupKeyPatternsWithPolicyL( TLockPolicyType aType );
       
   100 
       
   101 		/**
       
   102 		 * Show a note. (cancels previous one if shown)
       
   103 		 * 
       
   104 		 * @param aNote    note to be shown
       
   105 		 * @param aTimeout timeout for the note
       
   106 		 * @param aTone    tone type
       
   107 		 */
       
   108 		void ShowNote( CLockAppLockedNote* aNote, const TInt aTimeout,
       
   109 				const CAknNoteDialog::TTone aTone );
       
   110 
       
   111 		/**
       
   112 		 * Dismisses a note.
       
   113 		 */
       
   114 		void CancelNote( );
       
   115 
       
   116 		/**
       
   117 		 * Capture/Release primary keys.
       
   118 		 */
       
   119 		void CapturePrimaryKeys( const TBool aCapture );
       
   120 
       
   121 		/**
       
   122 		 * Show/Hide softkey cba.
       
   123 		 */
       
   124 		void ShowCba( const TBool aShow );
       
   125 		
       
   126 		/**
       
   127 		 * Capture/Release pointer events.
       
   128 		 */
       
   129 		void SetPointerEventCapture( const TBool aEnable );
       
   130 
       
   131 		/**
       
   132 		 * Show/Hide keyguard indicator state.
       
   133 		 */
       
   134 		void SetKeyguardIndicatorStateL( const TBool aEnable );
       
   135 
       
   136 	protected:
       
   137 
       
   138 		// interface to parent state control
       
   139 		MLockAppStateControl& iStateControl;
       
   140 
       
   141 		// application's window group
       
   142 		RWindowGroup& iWindowGroup;
       
   143 
       
   144 		// control's currently shown note (not owned)
       
   145 		CLockAppLockedNote* iCurrentNote;
       
   146 
       
   147 		// control's Cba (owned)
       
   148 		CEikButtonGroupContainer* iCba;
       
   149 
       
   150 		// key pattern matching (owned)
       
   151 		CLockAppKeyPattern* iKeyPattern;
       
   152 
       
   153 		// if control is active
       
   154 		TBool iActive;
       
   155 
       
   156 	};
       
   157 
       
   158 #endif // __LOCKAPPBASECONTROL_H__