imstutils/imconversationview/imcvuiapp/src/cimcvappui.cpp
changeset 0 5e5d6b214f4f
child 3 3aab497fdbb7
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  application ui
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include 	"cimcvappui.h"
       
    20 #include 	<avkon.hrh>
       
    21 #include 	<aknnotewrappers.h> 
       
    22 #include 	"cimcvappview.h"
       
    23 #include 	"imcvuiapp.hrh"
       
    24 #include 	<imcvuiapp.rsg>
       
    25 #include 	<aknview.h>
       
    26 #include 	"cimcvapplayoutinfo.h"
       
    27 #include 	"cimcvappmessageextensionshandler.h"
       
    28 #include 	"cimcvengine.h"
       
    29 #include 	"imcvuiliterals.h"
       
    30 #include 	"cimcvappstatuspanehandler.h"
       
    31 #include 	"mimcvenginemessagehandler.h"
       
    32 // logs
       
    33 #include 	"imcvlogger.h"
       
    34 #include 	"mimcvapplayoutchangeobserver.h"
       
    35 #include 	<aknapp.h>
       
    36 #include  	<AknDef.h>
       
    37 #include 	<layoutmetadata.cdl.h>
       
    38 #include 	<aknlayoutscalable_avkon.cdl.h>
       
    39 #include 	<AknStatuspaneUtils.h>
       
    40 #include 	<AknLayoutScalable_Avkon.cdl.common.h>
       
    41 #include 	"imcvuicommonuids.h"
       
    42 #include    "cimcvuiappskinvariant.h"
       
    43 #include 	"imcvuiparams.h"
       
    44 #include 	<e32property.h>
       
    45 #include    <apgtask.h>
       
    46 #include    <eikenv.h>
       
    47 #include   <StringLoader.h>
       
    48 #include   <e32property.h>
       
    49 
       
    50 #include    "imcvuiliterals.h"
       
    51 #include    "conversations.h"
       
    52 #include    "imcvuiapp.h"
       
    53 #include "cimcvenginefactory.h"
       
    54 #include "mimcvenginefactory.h"
       
    55 // imconnectionprovider
       
    56 #include "cimcvappinputabsorber.h"
       
    57 #include "cimcvengine.h"
       
    58 
       
    59 // ConstructL is called by the application framework
       
    60 void CIMCVAppUi::ConstructL()
       
    61     {
       
    62     IM_CV_LOGS(TXT("CIMCVAppUi::ConstructL() start") );
       
    63     iDestructingFlag = EFalse;
       
    64     
       
    65     BaseConstructL( EAknEnableSkin | ENoAppResourceFile |
       
    66                     EAppOrientationAutomatic | EAknEnableMSK );
       
    67     //Message extension handler. This must be created before views.
       
    68     
       
    69     iChatMbmFullPath = Application()->BitmapStoreName();
       
    70     
       
    71     // Input absorber
       
    72     iInputAbsorber = CIMCVAppInputAbsorber::NewL();    
       
    73     
       
    74     ///////////////////////////////
       
    75     
       
    76     TDriveName drive( TParsePtrC( iChatMbmFullPath ).Drive( ) ); // solve drive
       
    77 
       
    78     // leave to stack, LC method
       
    79     HBufC* resourceFilePath = HBufC::NewLC( KAMaxResourcePathLength );
       
    80     TPtr ptr( resourceFilePath->Des() );
       
    81     ptr.Append( KADefaultIconFile() ); // without drive
       
    82     ptr.Insert( 0, drive ); // insert drive
       
    83 
       
    84     // NearestLanguageFile takes only TFileName
       
    85     iChatMbmFullPath.Zero();
       
    86     iChatMbmFullPath.Append( *resourceFilePath );
       
    87     /////////////////////////////////
       
    88     CleanupStack::PopAndDestroy();
       
    89     
       
    90     iSkinVariant = CIMCVUiAppSkinVariant::NewL();   
       
    91     
       
    92     iEngineFactory = CIMCVEngineFactory::InstanceL();
       
    93        
       
    94     iMessageHandler = CIMCVAppMessageExtensionsHandler::NewL(*iSkinVariant, *this, *iEngineFactory );
       
    95     
       
    96     
       
    97     
       
    98     iLayoutInfo = CIMCVAppLayoutInfo::NewL( TChatListBoxLayout::EWithoutEditor );
       
    99     iLayoutInfo->LayoutChangedL();
       
   100     CalculatePreviewPaneWidth();
       
   101     
       
   102 	// connected create view and activate it
       
   103 	iCIMCVAppView = new (ELeave) CIMCVAppView();
       
   104 	iCIMCVAppView->ConstructL( R_CONVERSATIONVIEW_VIEW, KUidConversationView ,*iMessageHandler);
       
   105 	AddViewL( iCIMCVAppView );      // transfer ownership to CAknViewAppUi
       
   106 
       
   107     IM_CV_LOGS(TXT("CIMCVAppUi::ConstructL() end ") );
       
   108     }
       
   109 // ---------------------------------------------------------
       
   110 // CIMCVAppUi::CIMCVAppUi()
       
   111 // ---------------------------------------------------------
       
   112 //
       
   113 CIMCVAppUi::CIMCVAppUi() :
       
   114 iIsAppForeground(ETrue)                             
       
   115     {
       
   116 	// no implementation required
       
   117     }
       
   118 // ---------------------------------------------------------
       
   119 // CIMCVAppUi::CIMCVAppUi()
       
   120 // ---------------------------------------------------------
       
   121 //
       
   122 CIMCVAppUi::~CIMCVAppUi()
       
   123     {
       
   124     iLayoutObservers.Close();
       
   125     
       
   126     iResourceObservers.Close();
       
   127     
       
   128     delete iLayoutInfo;
       
   129      
       
   130     delete iInputAbsorber;
       
   131     
       
   132     iDestructingFlag = ETrue;
       
   133     
       
   134     if( iSkinVariant )
       
   135 	    {
       
   136 	    delete iSkinVariant;
       
   137 	    }
       
   138     
       
   139    
       
   140     delete iMessageHandler;
       
   141     
       
   142     CIMCVEngineFactory::Release();
       
   143    
       
   144     }
       
   145 // -----------------------------------------------------------------------------
       
   146 // CIMCVAppUi::IsAppInForeground
       
   147 // (other items were commented in a header).
       
   148 // -----------------------------------------------------------------------------
       
   149 //
       
   150 TBool CIMCVAppUi::IsAppInForeground()
       
   151 	{
       
   152 	return iIsAppForeground;	
       
   153 	}
       
   154    
       
   155   // -----------------------------------------------------------------------------
       
   156 // CIMCVAppUi::IsUnderDestruction
       
   157 // (other items were commented in a header).
       
   158 // -----------------------------------------------------------------------------
       
   159 //
       
   160 TBool CIMCVAppUi::IsUnderDestruction()
       
   161     {
       
   162     return iDestructingFlag;
       
   163     }
       
   164 // ---------------------------------------------------------
       
   165 // CIMCVAppUi::CIMCVAppUi()
       
   166 // ---------------------------------------------------------
       
   167 // handle any menu commands
       
   168 void CIMCVAppUi::HandleCommandL(TInt aCommand)
       
   169     {
       
   170     IM_CV_LOGS(TXT("CIMCVAppUi::HandleCommandL() start") );
       
   171     switch(aCommand)
       
   172         {
       
   173         case EEikCmdExit:
       
   174         case EAknSoftkeyExit:
       
   175         case EIMCVCmdExit:
       
   176         case EAknSoftkeyBack:
       
   177             {
       
   178             //Deactivate conversation is done in HandleForegroundEventL so that 
       
   179             //notification can be received in UI in case of new messages
       
   180             if( iPbkApplicationUid != 0 )
       
   181                 {				
       
   182                 // activate previous application
       
   183                 BringToForeground( TUid::Uid(iPbkApplicationUid ) );							  
       
   184                 }            
       
   185             TApaTask task(iEikonEnv->WsSession());
       
   186             task.SetWgId( CEikonEnv::Static()->RootWin().Identifier());
       
   187             task.SendToBackground();
       
   188             break;  
       
   189             }
       
   190       
       
   191 	   default:
       
   192             break;
       
   193         }
       
   194     IM_CV_LOGS(TXT("CIMCVAppUi::HandleCommandL() end") );
       
   195     }
       
   196 // -----------------------------------------------------------------------------
       
   197 // CIMCVAPPAppUi::HandleWsEventL
       
   198 // (other items were commented in a header).
       
   199 // -----------------------------------------------------------------------------
       
   200 //
       
   201 void CIMCVAppUi::HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination )
       
   202     {
       
   203     IM_CV_LOGS(TXT("CIMCVAppUi::HandleWsEventL() start") );
       
   204     switch( aEvent.Type() )
       
   205         {
       
   206         case  KAknUidValueEndKeyCloseEvent:
       
   207             {
       
   208             
       
   209             break;
       
   210             }
       
   211         default:
       
   212             {
       
   213             CAknViewAppUi::HandleWsEventL( aEvent, aDestination );
       
   214             break;
       
   215             }
       
   216         }
       
   217     IM_CV_LOGS(TXT("CIMCVAppUi::HandleWsEventL() end") );
       
   218     }
       
   219 
       
   220 // -----------------------------------------------------------------------------
       
   221 // CIMCVAppUi::LayoutInfo
       
   222 // (other items were commented in a header).
       
   223 // -----------------------------------------------------------------------------
       
   224 //
       
   225 MIMCVAppLayoutInfo* CIMCVAppUi::LayoutInfo()
       
   226     {
       
   227     return iLayoutInfo;
       
   228     }
       
   229 // -----------------------------------------------------------------------------
       
   230 // CIMCVAppUi::LayoutInfo
       
   231 // (other items were commented in a header).
       
   232 // -----------------------------------------------------------------------------
       
   233 //
       
   234 CIMCVEngine& CIMCVAppUi::ActiveEngine() const
       
   235     {
       
   236     return iCIMCVAppView->ActiveEngine();
       
   237     }
       
   238     
       
   239 // ---------------------------------------------------------
       
   240 // CIMCVAPPAppUi::AddLayoutChangeObserver
       
   241 // (other items were commented in a header).
       
   242 // ---------------------------------------------------------
       
   243 //
       
   244 void CIMCVAppUi::AddLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver )
       
   245     {
       
   246     IM_CV_LOGS(TXT("CIMCVAppUi::AddLayoutChangeObserver() start") );
       
   247     TInt err( iLayoutObservers.Append( aObserver ) );
       
   248     if ( err )
       
   249         {
       
   250         CActiveScheduler::Current()->Error( err );
       
   251         }
       
   252     IM_CV_LOGS(TXT("CIMCVAppUi::AddLayoutChangeObserver() End") );
       
   253     }
       
   254 
       
   255 // ---------------------------------------------------------
       
   256 // CIMCVAPPAppUi::RemoveLayoutChangeObserver
       
   257 // (other items were commented in a header).
       
   258 // ---------------------------------------------------------
       
   259 //
       
   260 void CIMCVAppUi::RemoveLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver )
       
   261     {
       
   262     IM_CV_LOGS(TXT("CIMCVAppUi::RemoveLayoutChangeObserver() start") );
       
   263     // remove from end first (LIFO) to avoid
       
   264     // tweaking the index while removing
       
   265     TInt count( iLayoutObservers.Count() );
       
   266     for( TInt i( count - 1 ); i >= 0; i-- )
       
   267         {
       
   268         if( iLayoutObservers[i] == aObserver )
       
   269             {
       
   270             iLayoutObservers.Remove( i );
       
   271             }
       
   272         }
       
   273     iLayoutObservers.Compress();
       
   274     IM_CV_LOGS(TXT("CIMCVAppUi::RemoveLayoutChangeObserver() end") );
       
   275     }
       
   276 
       
   277 // ---------------------------------------------------------
       
   278 // CIMCVAPPAppUi::AddResourceChangeObserver
       
   279 // (other items were commented in a header).
       
   280 // ---------------------------------------------------------
       
   281 //
       
   282 void CIMCVAppUi::AddResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver )
       
   283     {
       
   284     IM_CV_LOGS(TXT("CIMCVAppUi::AddResourceChangeObserver() start") );
       
   285     TInt err( iResourceObservers.Append( aObserver ) );
       
   286     if ( err )
       
   287         {
       
   288         CActiveScheduler::Current()->Error( err );
       
   289         }
       
   290     IM_CV_LOGS(TXT("CIMCVAppUi::AddResourceChangeObserver() end") );
       
   291     }
       
   292 
       
   293 // ---------------------------------------------------------
       
   294 // CIMCVAPPAppUi::RemoveResourceChangeObserver
       
   295 // (other items were commented in a header).
       
   296 // ---------------------------------------------------------
       
   297 //
       
   298 void CIMCVAppUi::RemoveResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver )
       
   299     {
       
   300     IM_CV_LOGS(TXT("CIMCVAppUi::RemoveResourceChangeObserver() start") );
       
   301     // remove from end first (LIFO) to avoid
       
   302     // tweaking the index while removing
       
   303     TInt count( iResourceObservers.Count() );
       
   304     for( TInt i( count - 1 ); i >= 0; i-- )
       
   305         {
       
   306         if( iResourceObservers[i] == aObserver )
       
   307             {
       
   308             iResourceObservers.Remove( i );
       
   309             }
       
   310         }
       
   311     iResourceObservers.Compress();
       
   312     IM_CV_LOGS(TXT("CIMCVAppUi::RemoveResourceChangeObserver() start") );
       
   313     }
       
   314 
       
   315 
       
   316 // ---------------------------------------------------------
       
   317 // CIMCVAPPAppUi::MbmFullPath
       
   318 // (other items were commented in a header).
       
   319 // ---------------------------------------------------------
       
   320 //
       
   321 TDes& CIMCVAppUi::MbmFullPath()
       
   322     {
       
   323     return iChatMbmFullPath;
       
   324     }
       
   325 // ---------------------------------------------------------
       
   326 // CIMCVAPPAppUi::StorePreviousViewDetails
       
   327 // (other items were commented in a header).
       
   328 // ---------------------------------------------------------
       
   329 //
       
   330 void CIMCVAppUi::StorePreviousViewDetails(TInt aPreviousApplicationUid,TInt aPreviousViewUid )
       
   331     {
       
   332     IM_CV_LOGS(TXT("CIMCVAppUi::StorePreviousViewDetails() start") );
       
   333     iPbkApplicationUid = aPreviousApplicationUid;
       
   334     iPbkActiveViewUid = aPreviousViewUid;
       
   335     IM_CV_LOGS(TXT("CIMCVAppUi::StorePreviousViewDetails() end") );
       
   336     }
       
   337 
       
   338 // ---------------------------------------------------------------------------
       
   339 //// CIMCVAPPAppUi::SendMeToBackground
       
   340 // Send this application to background
       
   341 // ---------------------------------------------------------------------------
       
   342 //
       
   343 void CIMCVAppUi::SendMeToBackground()
       
   344     {
       
   345     IM_CV_LOGS(TXT("CIMCVAppUi::SendMeToBackground() start") );
       
   346     TApaTaskList taskList( iEikonEnv->WsSession() );
       
   347     TApaTask xmppImApp = taskList.FindApp( TUid::Uid(KIMCVUIAPPEXEUID3 ) );
       
   348     xmppImApp.SendToBackground();
       
   349     IM_CV_LOGS(TXT("CIMCVAppUi::SendMeToBackground() end") );
       
   350     }
       
   351  
       
   352  // ---------------------------------------------------------------------------
       
   353 //// CIMCVAppUi::ShutDownAndCloseApplicationL
       
   354 // Send this application to background
       
   355 // ---------------------------------------------------------------------------
       
   356 //
       
   357 void CIMCVAppUi::ShutDownAndCloseApplicationL()
       
   358 	{
       
   359 	IM_CV_LOGS(TXT("CIMCVAppUi::ShutDownAndCloseApplicationL() start") );
       
   360 	TApaTaskList taskList( iEikonEnv->WsSession() );
       
   361 	TApaTask xmppImApp = taskList.FindApp( TUid::Uid(KIMCVUIAPPEXEUID3 ) );
       
   362 	xmppImApp.KillTask();
       
   363     IM_CV_LOGS(TXT("CIMCVAppUi::ShutDownAndCloseApplicationL() end") );
       
   364 	}
       
   365 // ---------------------------------------------------------
       
   366 // CIMCVAppUi::HandleResourceChangeL
       
   367 // (other items were commented in a header).
       
   368 // ---------------------------------------------------------
       
   369 //
       
   370 void CIMCVAppUi::HandleResourceChangeL( TInt aType )
       
   371     {
       
   372     IM_CV_LOGS(TXT("CIMCVAppUi::HandleResourceChangeL() Start") );
       
   373     CAknViewAppUi::HandleResourceChangeL( aType );
       
   374     if ( aType == KEikDynamicLayoutVariantSwitch )
       
   375         {
       
   376         // skin change for this app ui class
       
   377         iLayoutInfo->LayoutChangedL( aType );
       
   378         
       
   379         CalculatePreviewPaneWidth();
       
   380         
       
   381         iSkinVariant->UpdateLayout();
       
   382 	   }
       
   383         
       
   384         
       
   385     if ( aType == KEikDynamicLayoutVariantSwitch ||
       
   386         aType == KAknsMessageSkinChange )
       
   387         {
       
   388         TInt count( iLayoutObservers.Count() );
       
   389         for( TInt i( 0 ); i < count; ++i )
       
   390             {
       
   391             iLayoutObservers[i]->LayoutChangedL( aType );
       
   392             }
       
   393         }
       
   394     IM_CV_LOGS(TXT("CIMCVAppUi::HandleResourceChangeL() end") );
       
   395     }
       
   396 // ---------------------------------------------------------
       
   397 // CIMCVAppUi::CalculatePreviewPaneWidth()
       
   398 // ---------------------------------------------------------
       
   399 //   
       
   400 void CIMCVAppUi::CalculatePreviewPaneWidth()
       
   401 	{
       
   402 	IM_CV_LOGS(TXT("CIMCVAppUi::CalculatePreviewPaneWidth() Start") );
       
   403 	// Get parameter and table limits for popup preview text window
       
   404     TAknLayoutScalableParameterLimits limits = 
       
   405         AknLayoutScalable_Avkon::popup_preview_text_window_ParamLimits();
       
   406 
       
   407     TAknLayoutScalableTableLimits tableLimits =
       
   408         AknLayoutScalable_Avkon::popup_preview_text_window_t_Limits();
       
   409 
       
   410     // Get layout rects
       
   411     TRect rectScreen = iAvkonAppUi->ApplicationRect();
       
   412     TRect rectMainPane = rectScreen;
       
   413 
       
   414     // Use first variety to be able to get the font for text parsing
       
   415     TInt firstVariety = SelectWindowVariety( 1, limits );
       
   416 
       
   417     TRect rectPopupWindow = RectFromLayout( rectMainPane,
       
   418         AknLayoutScalable_Avkon::popup_preview_text_window( firstVariety ) );
       
   419 
       
   420     TInt firstIndex = tableLimits.FirstIndex();
       
   421     TInt firstLineVariety = AknLayoutScalable_Avkon::
       
   422         popup_preview_text_window_t_ParamLimits( firstIndex ).FirstVariety();
       
   423         
       
   424     TAknTextLineLayout popupTextLayout =
       
   425         AknLayoutScalable_Avkon::popup_preview_text_window_t(
       
   426             firstIndex, firstLineVariety );
       
   427 
       
   428     TAknLayoutText layoutText;
       
   429     layoutText.LayoutText( rectPopupWindow, popupTextLayout );
       
   430     
       
   431     IM_CV_LOGS(TXT("CIMCVAppUi::CalculatePreviewPaneWidth() End") );   
       
   432 	}
       
   433 // ---------------------------------------------------------
       
   434 // CIMCVAppUi::SelectWindowVariety()
       
   435 // ---------------------------------------------------------
       
   436 //   
       
   437 TInt CIMCVAppUi::SelectWindowVariety( const TInt aNumberOfLines,
       
   438         const TAknLayoutScalableParameterLimits& aLimits ) const
       
   439     {
       
   440     TInt index = aNumberOfLines - 1;
       
   441     if ( Layout_Meta_Data::IsLandscapeOrientation() )
       
   442         {
       
   443         index += 5;
       
   444         }
       
   445 
       
   446     return Min( Max( index, aLimits.FirstVariety() ),
       
   447                 aLimits.LastVariety() );
       
   448     }
       
   449     
       
   450 // ---------------------------------------------------------
       
   451 // CIMCVAppUi::RectFromLayout()
       
   452 // ---------------------------------------------------------
       
   453 //   
       
   454 TRect CIMCVAppUi::RectFromLayout( const TRect& aParent,
       
   455         const TAknWindowComponentLayout& aComponentLayout ) const
       
   456     {
       
   457     TAknWindowLineLayout lineLayout = aComponentLayout.LayoutLine();
       
   458     TAknLayoutRect layoutRect;
       
   459     layoutRect.LayoutRect(aParent, lineLayout);
       
   460     return layoutRect.Rect();
       
   461     }    
       
   462 
       
   463 // -----------------------------------------------------------------------------
       
   464 // CIMCVAppUi::SkinVariantL
       
   465 // -----------------------------------------------------------------------------
       
   466 //
       
   467 MIMCVUiAppSkinVariant*	CIMCVAppUi::SkinVariantL()
       
   468 	{
       
   469 	return iSkinVariant;
       
   470 	} 
       
   471 
       
   472 // ---------------------------------------------------------------------------
       
   473 // Proceses message from external application
       
   474 // Used from Phonebooks external tab (Buddylist) to start instant messaging
       
   475 // or from xmpp server to show new messages
       
   476 // ---------------------------------------------------------------------------
       
   477 //
       
   478 void CIMCVAppUi::ProcessMessageL( TUid /*aUid*/, const TDesC8& aParamData )
       
   479     {
       
   480     IM_CV_LOGS(TXT("CIMCVAppUi::ProcessMessageL() Start") );
       
   481     
       
   482     iCIMCVAppView->ShowMeL(aParamData);    
       
   483     
       
   484     IM_CV_LOGS(TXT("CIMCVAppUi::ProcessMessageL() End ") );
       
   485     }
       
   486 
       
   487 /// -----------------------------------------------------------------------------
       
   488 // CIMCVAppUi::HandleServiceCloseExitL
       
   489 // -----------------------------------------------------------------------------
       
   490 //
       
   491 void CIMCVAppUi::HandleServiceCloseExitL(TInt /*aEventValue*/ )
       
   492     {
       
   493     IM_CV_LOGS(TXT("CIMCVAppUi::HandleServiceCloseExitL() Start") );
       
   494     
       
   495     IM_CV_LOGS(TXT("CIMCVAppUi::HandleServiceCloseExitL() Start") );
       
   496     }
       
   497 
       
   498 // ---------------------------------------------------------
       
   499 // CIMCVAppUi::CaptureEventsL
       
   500 // (other items were commented in a header).
       
   501 // ---------------------------------------------------------
       
   502 //
       
   503 void CIMCVAppUi::CaptureEventsL()
       
   504     {
       
   505     if ( !AreEventsCaptured() )
       
   506         {
       
   507         iInputAbsorber->CaptureEventsL();
       
   508         }
       
   509     }
       
   510 
       
   511 // ---------------------------------------------------------
       
   512 // CIMCVAppUi::ReleaseCapturingL()
       
   513 // (other items were commented in a header).
       
   514 // ---------------------------------------------------------
       
   515 //
       
   516 void CIMCVAppUi::ReleaseCapturingL()
       
   517     {
       
   518     if ( AreEventsCaptured() )
       
   519         {
       
   520         iInputAbsorber->Release();
       
   521         }
       
   522     }
       
   523 
       
   524 // ---------------------------------------------------------
       
   525 // CIMCVAppUi::AreEventsCaptured
       
   526 // (other items were commented in a header).
       
   527 // ---------------------------------------------------------
       
   528 //
       
   529 TBool CIMCVAppUi::AreEventsCaptured() const
       
   530     {
       
   531     return iInputAbsorber->IsCaptured();
       
   532     }  
       
   533     
       
   534 // ---------------------------------------------------------
       
   535 // CIMCVAppUi::BringToForeground
       
   536 // (other items were commented in a header).
       
   537 // ---------------------------------------------------------
       
   538 //
       
   539 void CIMCVAppUi::BringToForeground( TUid aAppUid )
       
   540 	{
       
   541 	
       
   542 	IM_CV_LOGS(TXT("CIMCVAppUi::BringToForeground() start") );
       
   543     TApaTaskList taskList( iEikonEnv->WsSession() );
       
   544     TApaTask task = taskList.FindApp( aAppUid );
       
   545     if ( task.Exists() )
       
   546         {        
       
   547         task.BringToForeground();
       
   548         }    
       
   549     IM_CV_LOGS(TXT("CIMCVAppUi::BringToForeground() end") );
       
   550 			    	
       
   551 	}
       
   552 
       
   553 	
       
   554 // --------------------------------------------------------------------------
       
   555 // CIMCVAppUi::HandleForegroundEventL
       
   556 // --------------------------------------------------------------------------
       
   557 //
       
   558 void CIMCVAppUi::HandleForegroundEventL( TBool aForeground )
       
   559     {
       
   560     iIsAppForeground = aForeground;
       
   561 
       
   562     if( !aForeground )
       
   563 	    {
       
   564 	    ActiveEngine().MessageHandler().DeactivateConversationL();	
       
   565 	    }
       
   566 
       
   567     CAknViewAppUi::HandleForegroundEventL( aForeground );
       
   568     }		       
       
   569 // end of file