idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
changeset 5 c743ef5928ba
parent 4 4d54b72983ae
child 9 f966699dea19
equal deleted inserted replaced
4:4d54b72983ae 5:c743ef5928ba
    36 #include "xnnodeimpl.h"
    36 #include "xnnodeimpl.h"
    37 #include "xnnode.h"
    37 #include "xnnode.h"
    38 #include "xntype.h"
    38 #include "xntype.h"
    39 #include "xnbgcontrol.h"
    39 #include "xnbgcontrol.h"
    40 #include "xnfocuscontrol.h"
    40 #include "xnfocuscontrol.h"
       
    41 #include "xneditor.h"
       
    42 #include "xnbackgroundmanager.h"
    41 
    43 
    42 #include "xnviewadapter.h"
    44 #include "xnviewadapter.h"
    43 #include "xnmenu.h"
    45 #include "xnmenu.h"
    44 #include "xneditmode.h"
    46 #include "xneditmode.h"
    45 
    47 
   156     {           
   158     {           
   157     delete iActivate;
   159     delete iActivate;
   158     delete iDeactivate;
   160     delete iDeactivate;
   159     delete iEditState;
   161     delete iEditState;
   160     delete iBgControl;
   162     delete iBgControl;
       
   163     delete iBgManager;
   161     delete iFocusControl;
   164     delete iFocusControl;
   162     }
   165     }
   163 
   166 
   164 // -----------------------------------------------------------------------------
   167 // -----------------------------------------------------------------------------
   165 // CXnViewAdapter::NewL
   168 // CXnViewAdapter::NewL
   188     iAppUiAdapter.AddViewL( this );    
   191     iAppUiAdapter.AddViewL( this );    
   189     
   192     
   190     iBgControl = CXnBgControl::NewL();
   193     iBgControl = CXnBgControl::NewL();
   191     iBgControl->SetMopParent( this );
   194     iBgControl->SetMopParent( this );
   192 
   195 
       
   196     iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(),
       
   197         iAppUiAdapter.ViewManager().Editor().HspsWrapper() );
       
   198 
   193     iFocusControl = CXnFocusControl::NewL( iAppUiAdapter );   
   199     iFocusControl = CXnFocusControl::NewL( iAppUiAdapter );   
   194     
   200     
   195     iEventDispatcher = 
   201     iEventDispatcher = 
   196         CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() );
   202         CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() );
   197     
   203     
   239 // -----------------------------------------------------------------------------
   245 // -----------------------------------------------------------------------------
   240 //
   246 //
   241 void CXnViewAdapter::PrepareDestroy()
   247 void CXnViewAdapter::PrepareDestroy()
   242     {
   248     {
   243     iAppUiAdapter.UiStateListener().RemoveObserver( *this );
   249     iAppUiAdapter.UiStateListener().RemoveObserver( *this );
       
   250     iBgControl->PrepareDestroy();
   244     
   251     
   245     TRAP_IGNORE( DeactivateContainerL() );
   252     TRAP_IGNORE( DeactivateContainerL() );
   246     
   253     
   247     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   254     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   248     delete iEventDispatcher;
   255     delete iEventDispatcher;
   272     {
   279     {
   273     return *iBgControl;
   280     return *iBgControl;
   274     }
   281     }
   275 
   282 
   276 // -----------------------------------------------------------------------------
   283 // -----------------------------------------------------------------------------
       
   284 // CXnViewAdapter::BgManager
       
   285 // Returns background manager.
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 CXnBackgroundManager& CXnViewAdapter::BgManager() const
       
   289     {
       
   290     return *iBgManager;
       
   291     }
       
   292 
       
   293 // -----------------------------------------------------------------------------
   277 // CXnViewAdapter::BgControl
   294 // CXnViewAdapter::BgControl
   278 // Returns focus control.
   295 // Returns focus control.
   279 // -----------------------------------------------------------------------------
   296 // -----------------------------------------------------------------------------
   280 //
   297 //
   281 CXnFocusControl& CXnViewAdapter::FocusControl() const
   298 CXnFocusControl& CXnViewAdapter::FocusControl() const
   321 
   338 
   322         iAppUiAdapter.RemoveFromStack( cba );        
   339         iAppUiAdapter.RemoveFromStack( cba );        
   323         }
   340         }
   324     
   341     
   325     iBgControl->MakeVisible( ETrue );
   342     iBgControl->MakeVisible( ETrue );
       
   343     iBgManager->MakeVisible( ETrue );
   326     
   344     
   327     // Set the active container
   345     // Set the active container
   328     ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() );             
   346     ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() );             
   329     }
   347     }
   330 
   348 
   343     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   361     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
   344 
   362 
   345     TRAP_IGNORE( DeactivateContainerL() );
   363     TRAP_IGNORE( DeactivateContainerL() );
   346     
   364     
   347     iBgControl->MakeVisible( EFalse );
   365     iBgControl->MakeVisible( EFalse );
       
   366     iBgManager->MakeVisible( EFalse );
       
   367     
   348     iFocusControl->MakeVisible( EFalse );
   368     iFocusControl->MakeVisible( EFalse );
   349     
   369     
   350     iFlags.Clear( EIsActivated );
   370     iFlags.Clear( EIsActivated );
   351     }
   371     }
   352 
   372 
   478         iFlags.Clear( EIsForeground );
   498         iFlags.Clear( EIsForeground );
   479 
   499 
   480         CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode();
   500         CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode();
   481         if( editMode )
   501         if( editMode )
   482             {
   502             {
   483             editMode->StopDraggingL();
   503             TRAP_IGNORE( editMode->StopDraggingL() );
   484             }
   504             }
   485 
   505 
   486         iFocusControl->MakeVisible( EFalse );
   506         iFocusControl->MakeVisible( EFalse );
   487         
   507         
   488         TRAP_IGNORE( ChangeControlsStateL( EFalse ) );
   508         TRAP_IGNORE( ChangeControlsStateL( EFalse ) );