mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp
branchRCL_3
changeset 41 755f0370535b
parent 38 ac48f0cc9f9c
equal deleted inserted replaced
38:ac48f0cc9f9c 41:755f0370535b
    16 */
    16 */
    17 
    17 
    18 #include "musuibackgroundviewcontainer.h"
    18 #include "musuibackgroundviewcontainer.h"
    19 #include "musuiappui.h"
    19 #include "musuiappui.h"
    20 #include "muslogger.h" // debug logging
    20 #include "muslogger.h" // debug logging
    21 #include "musuieventcontroller.h"
       
    22 
    21 
    23 #include <AknsControlContext.h>
    22 #include <AknsControlContext.h>
    24 #include <AknsBasicBackgroundControlContext.h>
    23 #include <AknsBasicBackgroundControlContext.h>
    25 #include <AknsDrawUtils.h>
    24 #include <AknsDrawUtils.h>
    26 #include <StringLoader.h>                // StringLoader
    25 #include <StringLoader.h>                // StringLoader
    53 // -----------------------------------------------------------------------------
    52 // -----------------------------------------------------------------------------
    54 //
    53 //
    55 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    56 //
    55 //
    57 CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( 
    56 CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( 
    58     TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition ),
    57     TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition )
    59             iController( NULL )
       
    60     {
    58     {
    61     }
    59     }
    62 
    60 
    63 // -----------------------------------------------------------------------------
    61 // -----------------------------------------------------------------------------
    64 //
    62 //
   172     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue()" );
   170     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue()" );
   173     }
   171     }
   174 
   172 
   175 
   173 
   176 // -----------------------------------------------------------------------------
   174 // -----------------------------------------------------------------------------
   177 // Sets the event controller
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CMusUiBackgroundViewContainer::SetUiEventController( CMusUiEventController* aController )
       
   181 	{
       
   182 	iController = aController;
       
   183 	}
       
   184 
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 // Called by framework when the view size is changed
   175 // Called by framework when the view size is changed
   188 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   189 //
   177 //
   190 void CMusUiBackgroundViewContainer::SizeChanged()
   178 void CMusUiBackgroundViewContainer::SizeChanged()
   191     {
   179     {
   197         }
   185         }
   198 
   186 
   199     SetOrdinalPosition();
   187     SetOrdinalPosition();
   200     //MakeVisible( EFalse );
   188     //MakeVisible( EFalse );
   201     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::SizeChanged()" );
   189     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::SizeChanged()" );
   202     }
       
   203 
       
   204 
       
   205 // -----------------------------------------------------------------------------
       
   206 // From base class CCoeControl.  Handles a change to the application's
       
   207 // resources which are shared across the environment.
       
   208 // -----------------------------------------------------------------------------
       
   209 //
       
   210 void CMusUiBackgroundViewContainer::HandleResourceChange( TInt aType )
       
   211     {
       
   212     MUS_LOG( "mus: [MUSUI ]  -> CMusUiBackgroundViewContainer::HandleResourceChange" );
       
   213     CCoeControl::HandleResourceChange( aType );
       
   214     
       
   215     TBool displayEnabled( EFalse );
       
   216     if ( iController )
       
   217         {
       
   218         TRAP_IGNORE( displayEnabled = iController->IsDisplayEnabledL() )
       
   219         }
       
   220         
       
   221     if ( aType == KEikDynamicLayoutVariantSwitch && !displayEnabled )
       
   222         {
       
   223         TRect mainPaneRect;
       
   224         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
       
   225             mainPaneRect );
       
   226         SetRect( mainPaneRect );
       
   227         }
       
   228     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::HandleResourceChange" );
       
   229     }
   190     }
   230 
   191 
   231 
   192 
   232 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   233 // Called by framework when to retrieve the no. of controls.
   194 // Called by framework when to retrieve the no. of controls.