idlehomescreen/xmluicontroller/src/appui.cpp
branchRCL_3
changeset 23 7be2816dbabd
parent 18 d05a55b217df
child 26 1b758917cafc
equal deleted inserted replaced
19:79311d856354 23:7be2816dbabd
    81 //
    81 //
    82 void CAppUi::ConstructL()
    82 void CAppUi::ConstructL()
    83     {
    83     {
    84     __TICK( "CAppUi::ConstructL" );
    84     __TICK( "CAppUi::ConstructL" );
    85     
    85     
       
    86     iUiCtl.SetAppUi( *this );
       
    87     
       
    88     iUiCtl.NotifyAppEnvReadyL();
       
    89            
    86     // Always reset the phoneforward P&S key on startup just in case
    90     // Always reset the phoneforward P&S key on startup just in case
    87     RProperty::Set( KPSUidAiInformation,
    91     RProperty::Set( KPSUidAiInformation,
    88       KActiveIdleForwardNumericKeysToPhone, EPSAiForwardNumericKeysToPhone );
    92       KActiveIdleForwardNumericKeysToPhone, EPSAiForwardNumericKeysToPhone );
    89         
    93         
    90     iEditModeTitle = StringLoader::LoadL( R_QTN_HS_TITLE_EDITMODE );
    94     iEditModeTitle = StringLoader::LoadL( R_QTN_HS_TITLE_EDITMODE );
   114     __ASSERT_ALWAYS( uiEngine, Panic(ECriticalPointerNull) );
   118     __ASSERT_ALWAYS( uiEngine, Panic(ECriticalPointerNull) );
   115     
   119     
   116     iUiCtl.SetObserver( *iContentRenderer );
   120     iUiCtl.SetObserver( *iContentRenderer );
   117     
   121     
   118     iContentRenderer->SetEventHandler( *iUiCtl.FwEventHandler() );
   122     iContentRenderer->SetEventHandler( *iUiCtl.FwEventHandler() );
   119     
   123            
   120     iUiCtl.SetAppUi( *this );
       
   121     
       
   122     iEventHandler = iUiCtl.CreateXuikonEventHandlerL( *iContentRenderer );
   124     iEventHandler = iUiCtl.CreateXuikonEventHandlerL( *iContentRenderer );
   123     
   125     
   124     TAiIdleKeySoundConfig keySoundConfig;
   126     TAiIdleKeySoundConfig keySoundConfig;
   125     keySoundConfig.iKeySounds = KeySounds();
   127     keySoundConfig.iKeySounds = KeySounds();
   126     keySoundConfig.iContextResId = R_XUI_DEFAULT_SKEY_LIST;
   128     keySoundConfig.iContextResId = R_XUI_DEFAULT_SKEY_LIST;
   127     
   129            
   128     iUiCtl.NotifyAppEnvReadyL();
       
   129     
       
   130     iHelper = COnlineOfflineHelper::NewL( iUiCtl );
   130     iHelper = COnlineOfflineHelper::NewL( iUiCtl );
   131     
   131     
   132     iIdleIntegration = CAiUiIdleIntegration::NewL
   132     iIdleIntegration = CAiUiIdleIntegration::NewL
   133         ( *iEikonEnv, keySoundConfig, iUiCtl.FwEventHandler() );
   133         ( *iEikonEnv, keySoundConfig, iUiCtl.FwEventHandler() );
   134                
   134                
   178         
   178         
   179         // Load device status plugin here because it is always needed    
   179         // Load device status plugin here because it is always needed    
   180         iDeviceStatusInfo = THsPublisherInfo( KDeviceStatusPluginUid, 
   180         iDeviceStatusInfo = THsPublisherInfo( KDeviceStatusPluginUid, 
   181             KDeviceStatusPluginName, KNs ); 
   181             KDeviceStatusPluginName, KNs ); 
   182                            
   182                            
   183         iUiCtl.FwStateHandler()->LoadPlugin( 
   183         TAiFwPublisherInfo info( iDeviceStatusInfo,
   184             iDeviceStatusInfo, EAiFwSystemStartup );                                           
   184             TAiFwCallback(), EAiFwSystemStartup );
       
   185         
       
   186         iUiCtl.FwStateHandler()->LoadPlugin( info );
   185         }        
   187         }        
   186     
   188     
   187     __PRINTS( "*** CAppUi::ActivateUi - done" );
   189     __PRINTS( "*** CAppUi::ActivateUi - done" );
   188     }
   190     }
   189 
   191 
   198     iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl );
   200     iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl );
   199     
   201     
   200     __PRINTS( "*** CAppUi::HandleUiReadyEventL - done" );    
   202     __PRINTS( "*** CAppUi::HandleUiReadyEventL - done" );    
   201     }
   203     }
   202 
   204 
       
   205 // ----------------------------------------------------------------------------
       
   206 // CAppUi::PublisherInfo()
       
   207 // ----------------------------------------------------------------------------
       
   208 //
       
   209 TInt CAppUi::PublisherInfo( CXnNodeAppIf& aNode, THsPublisherInfo& aInfo )
       
   210     {
       
   211     TRAPD( err, iUiCtl.PublisherInfoL( aNode, aInfo ) );
       
   212     
       
   213     return err;
       
   214     }
       
   215      
   203 // ----------------------------------------------------------------------------
   216 // ----------------------------------------------------------------------------
   204 // CAppUi::PrepareToExit()
   217 // CAppUi::PrepareToExit()
   205 // ----------------------------------------------------------------------------
   218 // ----------------------------------------------------------------------------
   206 //
   219 //
   207 void CAppUi::PrepareToExit()
   220 void CAppUi::PrepareToExit()
   332 //
   345 //
   333 void CAppUi::HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination )
   346 void CAppUi::HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination )
   334     {
   347     {
   335     THsPublisherInfo info;
   348     THsPublisherInfo info;
   336     
   349     
   337     iUiCtl.PublisherInfoL( aDestination, info );
   350     TInt ret( PublisherInfo( aDestination, info ) );
   338     
   351         
   339     iUiCtl.FwEventHandler()->HandlePluginEventL( info, aEvent );
   352     if ( ret == KErrNone )
   340     }
   353         {
   341 
   354         iUiCtl.FwEventHandler()->HandlePluginEventL( info, aEvent );
   342 // ----------------------------------------------------------------------------
   355         }    
   343 // CAppUi::LoadDataPluginsL()
   356     }
   344 // ----------------------------------------------------------------------------
   357 
   345 //
   358 // ----------------------------------------------------------------------------
   346 TInt CAppUi::LoadPublisher( CXnNodeAppIf& aPublisher, TInt aReason )
   359 // CAppUi::LoadPublisher()
   347     {
   360 // ----------------------------------------------------------------------------
   348     THsPublisherInfo info;
   361 //
   349     
   362 void CAppUi::LoadPublisher( const TAiFwPublisherInfo& aPublisher )         
   350     TRAP_IGNORE( iUiCtl.PublisherInfoL( aPublisher, info ) );
   363     {          
   351 
   364     if ( aPublisher.Info().Uid() == KDeviceStatusPluginUid )
   352     if ( info.Uid() == KDeviceStatusPluginUid )
       
   353         {
   365         {
   354         // Update device status info
   366         // Update device status info
   355         iDeviceStatusInfo = info;
   367         iDeviceStatusInfo = aPublisher.Info();
   356         }
   368         }
   357     
   369     
   358     return iUiCtl.FwStateHandler()->LoadPlugin( 
   370     iUiCtl.FwStateHandler()->LoadPlugin( aPublisher );                
   359         info, (TAiFwLoadReason) aReason );        
       
   360     }
   371     }
   361 
   372 
   362 // ----------------------------------------------------------------------------
   373 // ----------------------------------------------------------------------------
   363 // CAppUi::DestroyPublisher()
   374 // CAppUi::DestroyPublisher()
   364 // ----------------------------------------------------------------------------
   375 // ----------------------------------------------------------------------------
   365 //
   376 //
   366 TInt CAppUi::DestroyPublisher( CXnNodeAppIf& aPublisher, TInt aReason )
   377 void CAppUi::DestroyPublisher( const TAiFwPublisherInfo& aPublisher )        
   367     {
   378     {                           
   368     THsPublisherInfo info;
   379     iUiCtl.FwStateHandler()->DestroyPlugin( aPublisher );                
   369            
       
   370     TRAP_IGNORE( iUiCtl.PublisherInfoL( aPublisher, info ) );
       
   371             
       
   372     iUiCtl.FwStateHandler()->DestroyPlugin( 
       
   373         info, (TAiFwDestroyReason) aReason );
       
   374     
       
   375     return KErrNone;
       
   376     }
   380     }
   377 
   381 
   378 // ----------------------------------------------------------------------------
   382 // ----------------------------------------------------------------------------
   379 // CAppUi::DynInitMenuItemL()
   383 // CAppUi::DynInitMenuItemL()
   380 // ----------------------------------------------------------------------------
   384 // ----------------------------------------------------------------------------
   510         }    
   514         }    
   511     else if ( xmlViewId == aViewIdToBeDeactivated && activeViewId == xmlViewId )
   515     else if ( xmlViewId == aViewIdToBeDeactivated && activeViewId == xmlViewId )
   512         {
   516         {
   513         if ( iInEditMode )
   517         if ( iInEditMode )
   514             {
   518             {
   515             TRAP_IGNORE( SetTitlePaneTextL( KNullDesC ) );
   519             //TRAP_IGNORE( SetTitlePaneTextL( KNullDesC ) );
   516             }
   520             }
   517         else
   521         else
   518             {
   522             {
   519             // Xml Ui view became inactive
   523             // Xml Ui view became inactive
   520             iUiCtl.FwEventHandler()->SuspendContent( 
   524             iUiCtl.FwEventHandler()->SuspendContent( 
   618     {
   622     {
   619     CEikStatusPane* sp( StatusPane() );  
   623     CEikStatusPane* sp( StatusPane() );  
   620     if ( !sp ) { return; }
   624     if ( !sp ) { return; }
   621     
   625     
   622     // make sure status pane is transparent.
   626     // make sure status pane is transparent.
   623     sp->EnableTransparent( ETrue );
   627     //sp->EnableTransparent( ETrue );
   624     
   628     
   625     TUid titlePaneUid( TUid::Uid( EEikStatusPaneUidTitle ) );
   629     TUid titlePaneUid( TUid::Uid( EEikStatusPaneUidTitle ) );
   626            
   630            
   627     CEikStatusPaneBase::TPaneCapabilities subPaneTitle( 
   631     CEikStatusPaneBase::TPaneCapabilities subPaneTitle( 
   628         sp->PaneCapabilities( titlePaneUid ) ); 
   632         sp->PaneCapabilities( titlePaneUid ) ); 
   638             title->DrawNow();
   642             title->DrawNow();
   639             }               
   643             }               
   640         }
   644         }
   641     
   645     
   642     // redraw statuspane
   646     // redraw statuspane
   643     sp->DrawNow();
   647     //sp->DrawNow();
   644     }
   648     }
   645 
   649 
   646 // -----------------------------------------------------------------------------
   650 // -----------------------------------------------------------------------------
   647 // CAppUi::HelpContextL
   651 // CAppUi::HelpContextL
   648 // Returns the help context
   652 // Returns the help context