idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp
branchRCL_3
changeset 9 f966699dea19
parent 2 08c6ee43b396
child 15 ff572dfe6d86
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    39 // C++ default constructor can NOT contain any code, that
    39 // C++ default constructor can NOT contain any code, that
    40 // might leave.
    40 // might leave.
    41 // -----------------------------------------------------------------------------
    41 // -----------------------------------------------------------------------------
    42 //
    42 //
    43 EXPORT_C CXnAppUiAdapter::CXnAppUiAdapter( TUid aApplicationUid )
    43 EXPORT_C CXnAppUiAdapter::CXnAppUiAdapter( TUid aApplicationUid )
    44     : iApplicationUid( aApplicationUid )
    44     : iExitingApp( EFalse ), iApplicationUid( aApplicationUid )
    45     {    
    45     {    
    46     }
    46     }
    47 
    47 
    48 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    49 // CXnAppUiAdapter::ConstructL
    49 // CXnAppUiAdapter::ConstructL
    95 // Destructor
    95 // Destructor
    96 //
    96 //
    97 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    98 //
    98 //
    99 EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter()
    99 EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter()
   100     {          
   100     {
       
   101     iExitingApp = ETrue;
   101     delete iUiEngineAppIf;
   102     delete iUiEngineAppIf;
   102     
   103     
   103     delete iImpl;    
   104     delete iImpl;    
   104     }
   105     }
   105 
   106 
   153     CXnDomNode& /*aEvent*/ )
   154     CXnDomNode& /*aEvent*/ )
   154     {
   155     {
   155     }
   156     }
   156 
   157 
   157 // -----------------------------------------------------------------------------
   158 // -----------------------------------------------------------------------------
   158 // CXnAppUiAdapter::LoadDataPluginsL
   159 // CXnAppUiAdapter::LoadPublisher
   159 //
   160 //
   160 // -----------------------------------------------------------------------------
   161 // -----------------------------------------------------------------------------
   161 //
   162 //
   162 EXPORT_C void CXnAppUiAdapter::LoadDataPluginsL(
   163 EXPORT_C TInt CXnAppUiAdapter::LoadPublisher( CXnNodeAppIf& /*aPublisher*/, 
   163     RPointerArray< CXnNodeAppIf >& /*aList*/ )
   164     TInt /*aReason*/ )
   164     {
   165     {
   165     // Default empty implementation
   166     // Default empty implementation
       
   167     return KErrNone;
   166     }
   168     }
   167 
   169 
   168 // -----------------------------------------------------------------------------
   170 // -----------------------------------------------------------------------------
   169 // CXnAppUiAdapter::DestroyDataPluginsL
   171 // CXnAppUiAdapter::DestroyDataPluginsL
   170 //
   172 //
   171 // -----------------------------------------------------------------------------
   173 // -----------------------------------------------------------------------------
   172 //
   174 //
   173 EXPORT_C void CXnAppUiAdapter::DestroyDataPluginsL(
   175 EXPORT_C TInt CXnAppUiAdapter::DestroyPublisher( CXnNodeAppIf& /*aPublisher*/, 
   174     RPointerArray< CXnNodeAppIf >& /*aList*/ )
   176     TInt /*aReason*/ )
   175     {
   177     {
   176     // Default empty implementation
   178     // Default empty implementation
       
   179     return KErrNone;
   177     }
   180     }
   178 
   181 
   179 // -----------------------------------------------------------------------------
   182 // -----------------------------------------------------------------------------
   180 // CXnAppUiAdapter::DynInitMenuItemL
   183 // CXnAppUiAdapter::DynInitMenuItemL
   181 //
   184 //
   187     // Default empty implementation
   190     // Default empty implementation
   188     return EFalse;
   191     return EFalse;
   189     }
   192     }
   190 
   193 
   191 // -----------------------------------------------------------------------------
   194 // -----------------------------------------------------------------------------
   192 // CXnAppUiAdapter::SetOnlineStateL
       
   193 //
       
   194 // -----------------------------------------------------------------------------
       
   195 //    
       
   196 EXPORT_C void CXnAppUiAdapter::SetOnlineStateL( 
       
   197     RPointerArray< CXnNodeAppIf >& /*aList*/ )
       
   198     {
       
   199     // Default empty implementation
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CXnAppUiAdapter::View
   195 // CXnAppUiAdapter::View
   204 //
   196 //
   205 // -----------------------------------------------------------------------------
   197 // -----------------------------------------------------------------------------
   206 //    
   198 //    
   207 EXPORT_C CAknView& CXnAppUiAdapter::View() const
   199 EXPORT_C CAknView& CXnAppUiAdapter::View() const
   208     {
   200     {
   209     return iImpl->ViewAdapter();
   201     return iImpl->ViewAdapter();
   210     }
   202     }
   211 
   203 
   212 // -----------------------------------------------------------------------------
   204 // -----------------------------------------------------------------------------
   213 // CXnAppUiAdapter::HandlePageSwitch
   205 // CXnAppUiAdapter::HandleEnterEditModeL
   214 //
   206 //
   215 // -----------------------------------------------------------------------------
   207 // -----------------------------------------------------------------------------
   216 //
   208 //
   217 EXPORT_C void CXnAppUiAdapter::HandlePageSwitch()
   209 EXPORT_C void CXnAppUiAdapter::HandleEnterEditModeL( TBool /*aEnter*/ )
   218     {
   210     {
   219     // Default empty implementation
   211     // Default empty implementation
   220     }
   212     }
   221 
   213 
   222 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   223 // CXnAppUiAdapter::HandleEnterEditModeL
   215 // CXnAppUiAdapter::HandleEventL
   224 //
   216 //
   225 // -----------------------------------------------------------------------------
   217 // -----------------------------------------------------------------------------
   226 //
   218 //
   227 EXPORT_C void CXnAppUiAdapter::HandleEnterEditModeL( TBool /*aEnter*/ )
   219 EXPORT_C void CXnAppUiAdapter::HandleEventL( const TDesC& /*aEvent*/,
       
   220     CXnNodeAppIf& /*aDestination*/ )
   228     {
   221     {
   229     // Default empty implementation
   222     // Default empty implementation
   230     }
   223     }
   231        
   224 
       
   225 // -----------------------------------------------------------------------------
       
   226 // CXnAppUiAdapter::RemoveViewL
       
   227 //
       
   228 // -----------------------------------------------------------------------------
       
   229 //
       
   230 EXPORT_C void CXnAppUiAdapter::RemoveViewL( CAknView& aView )
       
   231     {
       
   232 	if ( iExitingApp ) return; // framework will destroy view
       
   233     TVwsViewId activeViewId(KNullUid,KNullUid);
       
   234     TBool activateDefaultView( EFalse );
       
   235     if ( GetActiveViewId( activeViewId ) == KErrNone &&
       
   236         activeViewId.iViewUid == aView.Id() )
       
   237         {
       
   238         // currently active, deactivate        
       
   239         activateDefaultView = ETrue;
       
   240         DeactivateActiveViewIfOwnerMatchL();
       
   241         }
       
   242     
       
   243     if ( iView == &aView ) { iView = NULL; }
       
   244     CCoeAppUi::DeregisterView( aView );
       
   245     
       
   246     const TInt count( iViews->Count() );       
       
   247     for ( TInt i = 0; i < count; ++i )
       
   248         {
       
   249         CAknView* view( iViews->At( i ) );       
       
   250         if ( view == &aView && 
       
   251             view->Id() == aView.Id() )
       
   252             {
       
   253             iViews->Delete( i );           
       
   254             delete view;
       
   255             view = NULL;
       
   256             break;
       
   257             }
       
   258         }
       
   259     
       
   260     if ( activateDefaultView )
       
   261         {
       
   262         // check which view is active now.
       
   263         activeViewId = TVwsViewId(KNullUid,KNullUid);
       
   264         GetActiveViewId( activeViewId );
       
   265     
       
   266         TVwsViewId defaultViewId( KNullUid,KNullUid );    
       
   267         // activate default if needed
       
   268         if ( GetDefaultViewId( defaultViewId ) == KErrNone && 
       
   269             activeViewId != defaultViewId )
       
   270             {
       
   271             ActivateViewL( defaultViewId );
       
   272             }
       
   273         }
       
   274     }
       
   275 
       
   276 // -----------------------------------------------------------------------------
       
   277 // CXnAppUiAdapter::PrepareToExit
       
   278 //
       
   279 // -----------------------------------------------------------------------------
       
   280 //
       
   281 EXPORT_C void CXnAppUiAdapter::PrepareToExit()
       
   282     {
       
   283     iExitingApp = ETrue;
       
   284     delete iUiEngineAppIf;
       
   285     iUiEngineAppIf = NULL;
       
   286     delete iImpl;
       
   287     iImpl = NULL;
       
   288     CAknViewAppUi::PrepareToExit();
       
   289     }
       
   290 
   232 // -----------------------------------------------------------------------------
   291 // -----------------------------------------------------------------------------
   233 // CXnAppUiAdapter::ReloadUiL
   292 // CXnAppUiAdapter::ReloadUiL
   234 //
   293 //
   235 // -----------------------------------------------------------------------------
   294 // -----------------------------------------------------------------------------
   236 //
   295 //
   333 // -----------------------------------------------------------------------------
   392 // -----------------------------------------------------------------------------
   334 // CXnAppUiAdapter::ShowFocus
   393 // CXnAppUiAdapter::ShowFocus
   335 //
   394 //
   336 // -----------------------------------------------------------------------------
   395 // -----------------------------------------------------------------------------
   337 //
   396 //
   338 void CXnAppUiAdapter::ShowFocus() 
   397 void CXnAppUiAdapter::ShowFocus()
   339     {
   398     {
   340     return iImpl->ViewAdapter().FocusControl().MakeVisible( ETrue );
   399     return iImpl->ViewAdapter().FocusControl().MakeVisible( ETrue );
   341     }
   400     }
   342 
   401 
   343 // End of file
   402 // End of file