securitydialogs/lockapp/src/lockappappui.cpp
branchRCL_3
changeset 11 9971b621ef6c
parent 1 d5423fbb4f29
child 14 33ad376816a8
equal deleted inserted replaced
10:bbcfd14ce6a7 11:9971b621ef6c
    31 // ---------------------------------------------------------------------------
    31 // ---------------------------------------------------------------------------
    32 // Second phase constructor
    32 // Second phase constructor
    33 // ---------------------------------------------------------------------------
    33 // ---------------------------------------------------------------------------
    34 void CLockAppAppUi::ConstructL( )
    34 void CLockAppAppUi::ConstructL( )
    35     {
    35     {
       
    36     	#if defined(_DEBUG)
    36     	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x8 );
    37     	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x8 );
       
    38     	#endif
    37     	    
    39     	    
    38    // default appui constructor has to be called
    40    // default appui constructor has to be called
    39     BaseConstructL( );    	    
    41     BaseConstructL( );    	    
    40     	    
    42     	    
    41     TInt use_old_autolock=1;
    43     TInt use_old_autolock=1;
    42     if(use_old_autolock)
    44     if(use_old_autolock)
    43     	{
    45     	{
    44 			// start autolock instead of lockapp . This is a backup solution to use in case that not all SysAp and Avkon changes are implemented
    46 			// start autolock instead of lockapp . This is a backup solution to use in case that not all SysAp and Avkon changes are implemented
       
    47 			#if defined(_DEBUG)
    45 	 	  RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
    48 	 	  RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x1 );
       
    49  	  	#endif
    46 	    TApaTaskList taskList( iCoeEnv->WsSession() );
    50 	    TApaTaskList taskList( iCoeEnv->WsSession() );
    47 	    TApaTask task( taskList.FindApp( _L("autolock.exe" )) );
    51 	    TApaTask task( taskList.FindApp( _L("autolock.exe" )) );
    48 	    if ( !task.Exists() )
    52 	    if ( !task.Exists() )
    49 	        {
    53 	        {
    50 	        RApaLsSession ls;                   
    54 	        RApaLsSession ls;                   
    55 	        commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
    59 	        commandLine->SetExecutableNameL( _L("autolock.exe" ) );     
    56 	        commandLine->SetCommandL( EApaCommandRun );
    60 	        commandLine->SetCommandL( EApaCommandRun );
    57 	        
    61 	        
    58 		    // Try to launch the application.        
    62 		    // Try to launch the application.        
    59 	        User::LeaveIfError(ls.StartApp(*commandLine));
    63 	        User::LeaveIfError(ls.StartApp(*commandLine));
       
    64 	        #if defined(_DEBUG)
    60 	    	  RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x7 );
    65 	    	  RDebug::Printf( "%s %s (%u) autolock.exe created=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x7 );
       
    66 	    	  #endif
    61 	        
    67 	        
    62 	        CleanupStack::PopAndDestroy(2); // commandLine, ls
    68 	        CleanupStack::PopAndDestroy(2); // commandLine, ls
    63 			}
    69 			}
    64 	    Exit();
    70 	    Exit();
    65 	  }
    71 	  }
   180 // ----------------------------------------------------------
   186 // ----------------------------------------------------------
   181 // Handle window-server events
   187 // Handle window-server events
   182 // ----------------------------------------------------------
   188 // ----------------------------------------------------------
   183 void CLockAppAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
   189 void CLockAppAppUi::HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination )
   184     {
   190     {
       
   191     #if defined(_DEBUG)
   185 		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   192 		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
       
   193 		#endif
   186     if ( aEvent.Type() == TRawEvent::EKeyDown )
   194     if ( aEvent.Type() == TRawEvent::EKeyDown )
   187         {
   195         {
       
   196         #if defined(_DEBUG)
   188         RDebug::Printf("CLockAppAppUi::HandleWsEventL() - aEvent.Key()->iCode: %d", aEvent.Key()->iCode );
   197         RDebug::Printf("CLockAppAppUi::HandleWsEventL() - aEvent.Key()->iCode: %d", aEvent.Key()->iCode );
       
   198         #endif
   189         }
   199         }
   190 
   200 
   191     // call super-class
   201     // call super-class
   192     CAknAppUi::HandleWsEventL( aEvent, aDestination );
   202     CAknAppUi::HandleWsEventL( aEvent, aDestination );
   193     // propagate call
   203     // propagate call