idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
changeset 5 c743ef5928ba
parent 4 4d54b72983ae
child 9 f966699dea19
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Tue Jan 26 11:48:23 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Tue Feb 02 00:04:13 2010 +0200
@@ -38,6 +38,8 @@
 #include "xntype.h"
 #include "xnbgcontrol.h"
 #include "xnfocuscontrol.h"
+#include "xneditor.h"
+#include "xnbackgroundmanager.h"
 
 #include "xnviewadapter.h"
 #include "xnmenu.h"
@@ -158,6 +160,7 @@
     delete iDeactivate;
     delete iEditState;
     delete iBgControl;
+    delete iBgManager;
     delete iFocusControl;
     }
 
@@ -190,6 +193,9 @@
     iBgControl = CXnBgControl::NewL();
     iBgControl->SetMopParent( this );
 
+    iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(),
+        iAppUiAdapter.ViewManager().Editor().HspsWrapper() );
+
     iFocusControl = CXnFocusControl::NewL( iAppUiAdapter );   
     
     iEventDispatcher = 
@@ -241,6 +247,7 @@
 void CXnViewAdapter::PrepareDestroy()
     {
     iAppUiAdapter.UiStateListener().RemoveObserver( *this );
+    iBgControl->PrepareDestroy();
     
     TRAP_IGNORE( DeactivateContainerL() );
     
@@ -274,6 +281,16 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnViewAdapter::BgManager
+// Returns background manager.
+// -----------------------------------------------------------------------------
+//
+CXnBackgroundManager& CXnViewAdapter::BgManager() const
+    {
+    return *iBgManager;
+    }
+
+// -----------------------------------------------------------------------------
 // CXnViewAdapter::BgControl
 // Returns focus control.
 // -----------------------------------------------------------------------------
@@ -323,6 +340,7 @@
         }
     
     iBgControl->MakeVisible( ETrue );
+    iBgManager->MakeVisible( ETrue );
     
     // Set the active container
     ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() );             
@@ -345,6 +363,8 @@
     TRAP_IGNORE( DeactivateContainerL() );
     
     iBgControl->MakeVisible( EFalse );
+    iBgManager->MakeVisible( EFalse );
+    
     iFocusControl->MakeVisible( EFalse );
     
     iFlags.Clear( EIsActivated );
@@ -480,7 +500,7 @@
         CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode();
         if( editMode )
             {
-            editMode->StopDraggingL();
+            TRAP_IGNORE( editMode->StopDraggingL() );
             }
 
         iFocusControl->MakeVisible( EFalse );