idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
branchRCL_3
changeset 28 d721605b30d0
parent 26 1b758917cafc
equal deleted inserted replaced
26:1b758917cafc 28:d721605b30d0
   320 // -----------------------------------------------------------------------------
   320 // -----------------------------------------------------------------------------
   321 //
   321 //
   322 void CXnViewAdapter::PrepareToExit()
   322 void CXnViewAdapter::PrepareToExit()
   323     {                
   323     {                
   324     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   324     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
       
   325     
   325     delete iEventDispatcher;
   326     delete iEventDispatcher;
   326     iEventDispatcher = NULL;
   327     iEventDispatcher = NULL;
   327     
   328     
   328     iAppUiAdapter.UiEngine().SetEventDispatcher( NULL );
   329     iAppUiAdapter.UiEngine().SetEventDispatcher( NULL );
   329     
   330     
   386         return;
   387         return;
   387         }
   388         }
   388 
   389 
   389     __TICK( "CXnViewAdapter::DoActivateL" );
   390     __TICK( "CXnViewAdapter::DoActivateL" );
   390     __TIME_MARK( time );
   391     __TIME_MARK( time );
       
   392 
       
   393     TBool wasActive( iFlags.IsSet( EIsActivated ) );
   391     
   394     
   392     iFlags.Set( EIsActivated );
   395     iFlags.Set( EIsActivated );
   393     
   396     
   394     // State must be cleared before adding to stack
       
   395     iEventDispatcher->ClearStateL();
   397     iEventDispatcher->ClearStateL();
       
   398            
       
   399     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   396     iAppUiAdapter.AddToStackL( *this, iEventDispatcher );
   400     iAppUiAdapter.AddToStackL( *this, iEventDispatcher );
   397 
       
   398     // enable statuspane transparancy 
       
   399     CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
       
   400 
   401 
   401     CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() );
   402     CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() );
   402     
   403     
   403     if ( bgc )
   404     if ( bgc )
   404         {
   405         {
   406         CEikCba* cba( 
   407         CEikCba* cba( 
   407             static_cast< CEikCba* >( bgc->ButtonGroup() ) );
   408             static_cast< CEikCba* >( bgc->ButtonGroup() ) );
   408 
   409 
   409         iAppUiAdapter.RemoveFromStack( cba );        
   410         iAppUiAdapter.RemoveFromStack( cba );        
   410         }
   411         }
   411         
   412        
   412     iBgManager->MakeVisible( ETrue );
   413     iBgManager->MakeVisible( ETrue );
   413 
   414         
   414     // Set status pane layout
       
   415     CXnViewData& viewData( iAppUiAdapter.ViewManager().ActiveViewData() );
   415     CXnViewData& viewData( iAppUiAdapter.ViewManager().ActiveViewData() );
   416     CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( 
   416     
   417         XnPropertyNames::view::KStatusPaneLayout ) );
   417     if ( !wasActive )
   418 
   418         {
   419     // Is there status pane declaration available
   419         // Set status pane layout        
   420     TInt spane( DetermineStatusPaneLayout( prop ) );
   420         CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( 
   421 
   421             XnPropertyNames::view::KStatusPaneLayout ) );
   422     if ( spane != KErrNotFound )
   422     
   423         {
   423         CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
   424         if ( sp && sp->CurrentLayoutResId() != spane )
   424         
   425             {
   425         // Is there status pane declaration available
   426             sp->SwitchLayoutL( spane );
   426         TInt spane( DetermineStatusPaneLayout( prop ) );
   427             sp->ApplyCurrentSettingsL();
   427     
   428             }
   428         if ( spane != KErrNotFound )
   429         }    
   429             {
   430     
   430             if ( sp && sp->CurrentLayoutResId() != spane )
   431     if ( sp && !sp->IsTransparent() ) 
   431                 {
   432         { 
   432                 sp->SwitchLayoutL( spane );
   433         sp->EnableTransparent( ETrue );
   433                 sp->ApplyCurrentSettingsL();
   434         sp->DrawNow();
   434                 }
       
   435             }    
       
   436         
       
   437         // enable statuspane transparancy        
       
   438         if ( sp && !sp->IsTransparent() ) 
       
   439             { 
       
   440             sp->EnableTransparent( ETrue );
       
   441             sp->DrawNow();
       
   442             }    
   435         }
   443         }
   436 
   444 
   437     if ( aCustomMessage == KSetWallpaper )
   445     if ( aCustomMessage == KSetWallpaper )
   438         {
   446         {
   439         iAction = ESetWallpaper;
   447         iAction = ESetWallpaper;