mmsharing/mmshui/src/musuibackgroundviewcontainer.cpp
branchRCL_3
changeset 38 ac48f0cc9f9c
parent 33 bc78a40cd63c
child 41 755f0370535b
equal deleted inserted replaced
35:6c57ef9392d2 38:ac48f0cc9f9c
    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"
    21 
    22 
    22 #include <AknsControlContext.h>
    23 #include <AknsControlContext.h>
    23 #include <AknsBasicBackgroundControlContext.h>
    24 #include <AknsBasicBackgroundControlContext.h>
    24 #include <AknsDrawUtils.h>
    25 #include <AknsDrawUtils.h>
    25 #include <StringLoader.h>                // StringLoader
    26 #include <StringLoader.h>                // StringLoader
    52 // -----------------------------------------------------------------------------
    53 // -----------------------------------------------------------------------------
    53 //
    54 //
    54 // -----------------------------------------------------------------------------
    55 // -----------------------------------------------------------------------------
    55 //
    56 //
    56 CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( 
    57 CMusUiBackgroundViewContainer::CMusUiBackgroundViewContainer( 
    57     TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition )
    58     TInt aOrdinalPosition ) : iOrdinalPosition( aOrdinalPosition ),
       
    59             iController( NULL )
    58     {
    60     {
    59     }
    61     }
    60 
    62 
    61 // -----------------------------------------------------------------------------
    63 // -----------------------------------------------------------------------------
    62 //
    64 //
   170     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue()" );
   172     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::UpdateOrdinalPositionValue()" );
   171     }
   173     }
   172 
   174 
   173 
   175 
   174 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
       
   177 // Sets the event controller
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CMusUiBackgroundViewContainer::SetUiEventController( CMusUiEventController* aController )
       
   181 	{
       
   182 	iController = aController;
       
   183 	}
       
   184 
       
   185 
       
   186 // -----------------------------------------------------------------------------
   175 // Called by framework when the view size is changed
   187 // Called by framework when the view size is changed
   176 // -----------------------------------------------------------------------------
   188 // -----------------------------------------------------------------------------
   177 //
   189 //
   178 void CMusUiBackgroundViewContainer::SizeChanged()
   190 void CMusUiBackgroundViewContainer::SizeChanged()
   179     {
   191     {
   185         }
   197         }
   186 
   198 
   187     SetOrdinalPosition();
   199     SetOrdinalPosition();
   188     //MakeVisible( EFalse );
   200     //MakeVisible( EFalse );
   189     MUS_LOG( "mus: [MUSUI ]  <- CMusUiBackgroundViewContainer::SizeChanged()" );
   201     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" );
   190     }
   229     }
   191 
   230 
   192 
   231 
   193 // -----------------------------------------------------------------------------
   232 // -----------------------------------------------------------------------------
   194 // Called by framework when to retrieve the no. of controls.
   233 // Called by framework when to retrieve the no. of controls.