mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp
branchRCL_3
changeset 38 ac48f0cc9f9c
parent 33 bc78a40cd63c
child 41 755f0370535b
--- a/mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp	Tue Sep 14 21:13:00 2010 +0300
+++ b/mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp	Wed Sep 15 12:09:15 2010 +0300
@@ -18,6 +18,7 @@
 #include "musuibackgroundviewcontainer.h"
 #include "musuiappui.h"
 #include "muslogger.h" // debug logging
+#include "musuieventcontroller.h"
 
 #include <AknsControlContext.h>
 #include <AknsBasicBackgroundControlContext.h>
@@ -54,7 +55,8 @@
 // -----------------------------------------------------------------------------
 //
 CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( 
-    TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition )
+    TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition ),
+            iController( NULL )
     {
     }
 
@@ -172,6 +174,16 @@
 
 
 // -----------------------------------------------------------------------------
+// Sets the event controller
+// -----------------------------------------------------------------------------
+//
+void CMusUiBackgroundViewContainer::SetUiEventController( CMusUiEventController* aController )
+	{
+	iController = aController;
+	}
+
+
+// -----------------------------------------------------------------------------
 // Called by framework when the view size is changed
 // -----------------------------------------------------------------------------
 //
@@ -191,6 +203,33 @@
 
 
 // -----------------------------------------------------------------------------
+// From base class CCoeControl.  Handles a change to the application's
+// resources which are shared across the environment.
+// -----------------------------------------------------------------------------
+//
+void CMusUiBackgroundViewContainer::HandleResourceChange( TInt aType )
+    {
+    MUS_LOG( "mus: [MUSUI ]  -> CMusUiBackgroundViewContainer::HandleResourceChange" );
+    CCoeControl::HandleResourceChange( aType );
+    
+    TBool displayEnabled( EFalse );
+    if ( iController )
+        {
+        TRAP_IGNORE( displayEnabled = iController->IsDisplayEnabledL() )
+        }
+        
+    if ( aType == KEikDynamicLayoutVariantSwitch && !displayEnabled )
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
+            mainPaneRect );
+        SetRect( mainPaneRect );
+        }
+    MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::HandleResourceChange" );
+    }
+
+
+// -----------------------------------------------------------------------------
 // Called by framework when to retrieve the no. of controls.
 // -----------------------------------------------------------------------------
 //