menufw/menufwui/mmwidgets/src/mmgrid.cpp
branchv5backport
changeset 14 1abc632eb502
parent 13 6205fd287e8a
child 20 636d517f67e6
equal deleted inserted replaced
13:6205fd287e8a 14:1abc632eb502
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *  Version     : %version: MM_98 % << Don't touch! Updated by Synergy at check-out.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <AknsDrawUtils.h>
       
    21 #include <layoutmetadata.cdl.h>
       
    22 #include "mmgrid.h"
       
    23 #include "mmgridmodel.h"
       
    24 #include "mmlistboxitemdrawer.h"
       
    25 #include "mmgridview.h"
       
    26 #include "mmtemplatelibrary.h"
       
    27 #include "mmlistboxmodel.h"
       
    28 #include "mmmarqueeadapter.h"
       
    29 #include "mmwidgetsconstants.h"
       
    30 #include "mmwidgetcontainer.h"
       
    31 #include "hnsuitemodel.h"
       
    32 #include "mmdraweranimator.h"
       
    33 
       
    34 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
    35 #include <aknlistloadertfx.h>
       
    36 #include <aknlistboxtfxinternal.h>
       
    37 #endif
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CMmGrid::CMmGrid()
       
    44     {
       
    45     // No implementation required
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CMmGrid::~CMmGrid()
       
    53     {
       
    54     delete iRedrawTimer;
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 CMmGrid* CMmGrid::NewLC( const CCoeControl* aParent, TInt aFlags,
       
    62         CMmTemplateLibrary* aTemplateLibrary)
       
    63     {
       
    64     CMmGrid* self = new (ELeave)CMmGrid();
       
    65     CleanupStack::PushL(self);
       
    66     self->ConstructL( aParent, aFlags, aTemplateLibrary );
       
    67     return self;
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CMmGrid* CMmGrid::NewL( const CCoeControl* aParent, TInt aFlags,
       
    75         CMmTemplateLibrary* aTemplateLibrary )
       
    76     {
       
    77     CMmGrid* self = CMmGrid::NewLC( aParent, aFlags, aTemplateLibrary );
       
    78     CleanupStack::Pop( self );
       
    79     return self;
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // If a parent to the supplied control has its Gc set, this function will find
       
    84 // it and return it. (Copied from EIKLBX.CPP, needed by CMmGrid::Draw)
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 LOCAL_C CWindowGc* ReplaceGcWithCustomGc( const CEikListBox* aListBox )
       
    88     {
       
    89     const CCoeControl* parent = aListBox;
       
    90     CWindowGc* customGc;
       
    91     while(parent)
       
    92         {
       
    93         customGc = parent->GetGc();
       
    94         if ( customGc )
       
    95             {
       
    96             CListItemDrawer* itemDrawer = aListBox->View()->ItemDrawer();
       
    97             CWindowGc* originalGc = itemDrawer->Gc();
       
    98             if ( customGc == originalGc )
       
    99                 {
       
   100                 return NULL;
       
   101                 }
       
   102             else
       
   103                 {
       
   104                 itemDrawer->SetGc( customGc );
       
   105                 return originalGc;
       
   106                 }
       
   107             }
       
   108         parent = parent->Parent();
       
   109         }
       
   110     return NULL;
       
   111     }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 void CMmGrid::Draw(const TRect& aRect) const
       
   118     {
       
   119     if ( View()->RedrawDisabled () || !IsVisible () )
       
   120         {
       
   121         return;
       
   122         }
       
   123     iMmDrawer->SetNumberOfColsInView(
       
   124             static_cast<CMmGridView*>(iView)->NumberOfColsInView() );
       
   125 
       
   126     // If a parent has a custom gc, draw listbox using that gc
       
   127     CWindowGc* replacedGc = ReplaceGcWithCustomGc( this );
       
   128 
       
   129     CWindowGc* gc = iItemDrawer->Gc();
       
   130     TGulBorder::TColors borderColors;
       
   131     iBorder.Draw(*gc, Rect(), borderColors);
       
   132 
       
   133 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   134     MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal(
       
   135             static_cast<CMmGridView*>(iView)->Gc() );
       
   136     TBool effects = transApi && !transApi->EffectsDisabled();
       
   137     if ( effects )
       
   138         {
       
   139         // ViewRect might have been moved to the right to prevent grid items
       
   140         // from overlapping the scrollbar in mirrored layout.
       
   141         // However, we still have to draw scrollbar background, thus the
       
   142         // rectangle object passed to MAknListBoxTfxInternal::BeginRedraw must
       
   143         // be placed at (0, 0) so that it covers the area where scrollbar is
       
   144         // drawn.
       
   145         TRect r( View()->ViewRect().Size() );
       
   146         transApi->BeginRedraw( MAknListBoxTfxInternal::EListView, r );
       
   147         transApi->StartDrawing( MAknListBoxTfxInternal::EListView );
       
   148         }
       
   149 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
   150 
       
   151     ClearMargins();
       
   152     RedrawScrollbarBackground();
       
   153 
       
   154 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   155     if ( effects )
       
   156         {
       
   157         transApi->StopDrawing();
       
   158         }
       
   159 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
   160     iView->Draw(&aRect);
       
   161 
       
   162 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   163     if ( effects )
       
   164         {
       
   165         transApi->EndViewRedraw( aRect );
       
   166         }
       
   167 #endif // RD_UI_TRANSITION_EFFECTS_LIST
       
   168 
       
   169     if ( replacedGc )
       
   170         {
       
   171         // Stop using the custom gc
       
   172         iItemDrawer->SetGc( replacedGc );
       
   173         }
       
   174     }
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 // -----------------------------------------------------------------------------
       
   178 //
       
   179 void CMmGrid::DrawView()
       
   180     {
       
   181     iDisableChildComponentDrawing = ETrue;
       
   182     DrawNow(Rect());
       
   183     iDisableChildComponentDrawing = EFalse;
       
   184     }
       
   185 
       
   186 // -----------------------------------------------------------------------------
       
   187 //
       
   188 // -----------------------------------------------------------------------------
       
   189 //
       
   190 void CMmGrid::CreateItemDrawerL()
       
   191     {
       
   192     iItemDrawer = iMmDrawer;
       
   193     }
       
   194 
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 // -----------------------------------------------------------------------------
       
   198 //
       
   199 void CMmGrid::CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary )
       
   200     {
       
   201     CFormattedCellListBoxData* data=CFormattedCellGridData::NewL();
       
   202     CleanupStack::PushL(data);
       
   203 
       
   204     iMmDrawer = CMmListBoxItemDrawer::NewL(
       
   205         MmModel()->MmListBoxModel(), iEikonEnv->NormalFont(), data, EGrid,
       
   206         aTemplateLibrary );
       
   207     iItemDrawer = iMmDrawer;
       
   208     data->SetControl( this );
       
   209     CleanupStack::Pop( data );
       
   210     }
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 //
       
   214 // -----------------------------------------------------------------------------
       
   215 //
       
   216 void CMmGrid::HandleScrollEventL( CEikScrollBar* aScrollBar,
       
   217         TEikScrollEvent aEventType )
       
   218     {
       
   219     if ( aEventType == EEikScrollThumbDragVert && !iScrollbarThumbIsBeingDragged )
       
   220         {
       
   221         iScrollbarThumbIsBeingDragged = ETrue;
       
   222         static_cast<CMmListBoxItemDrawer*>(
       
   223                 View()->ItemDrawer() )->EnableCachedDataUse( ETrue );
       
   224         iRedrawTimer->Start( KScrollingRedrawInterval, KScrollingRedrawInterval,
       
   225                 TCallBack( &CMmGrid::RedrawTimerCallback, static_cast<TAny*>( this ) ) );
       
   226         }
       
   227     else if ( aEventType == EEikScrollThumbReleaseVert )
       
   228         {
       
   229         iScrollbarThumbIsBeingDragged = EFalse;
       
   230         static_cast<CMmListBoxItemDrawer*>(
       
   231                 View()->ItemDrawer() )->EnableCachedDataUse( EFalse );
       
   232         // The view will be redrawn with cache disabled when ProcessScrollEventL
       
   233         // calls the base class's HandleScrollEventL method -- no need to
       
   234         // explicitly redraw the view.
       
   235         iRedrawTimer->Cancel();
       
   236         }
       
   237 
       
   238     if ( !iScrollbarThumbIsBeingDragged )
       
   239         {
       
   240         ProcessScrollEventL( aScrollBar, aEventType );
       
   241         }
       
   242     else
       
   243         {
       
   244         __ASSERT_DEBUG( aEventType == EEikScrollThumbDragVert, User::Invariant() );
       
   245         ++iSkippedScrollbarEventsCount;
       
   246         }
       
   247     }
       
   248 
       
   249 // -----------------------------------------------------------------------------
       
   250 // Clearing ELeftDownInViewRect flag before invoking the base class
       
   251 // HandlePointerEventL method effectively prevents that method from doing most
       
   252 // of the things it would normally do in response to EButton1Down event.
       
   253 // This flag is explicitly cleared to achieve two things:
       
   254 // 1. Prevent kinetic scrolling (flick) in edit mode.
       
   255 // 2. Prevent highlight removal when popup menu is displayed.
       
   256 // -----------------------------------------------------------------------------
       
   257 //
       
   258 void CMmGrid::HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent )
       
   259     {
       
   260     if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   261         {
       
   262         iButton1DownPos = aPointerEvent.iPosition;
       
   263         }
       
   264     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
       
   265         {
       
   266         CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
       
   267         TPoint dragDelta = iButton1DownPos - aPointerEvent.iPosition;
       
   268         if ( Abs( dragDelta.iY ) > KDragTreshold || parent->LongTapInProgress() )
       
   269             {
       
   270             iListBoxFlags &= ~ELeftDownInViewRect;
       
   271             }
       
   272         }
       
   273 
       
   274     TInt itemUnderPointerIndex = KErrNotFound;
       
   275     if ( aPointerEvent.iType == TPointerEvent::EButton1Up ||
       
   276             aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   277         {
       
   278         CAknGrid::HandlePointerEventL( aPointerEvent );
       
   279         }
       
   280     else if ( View()->XYPosToItemIndex(
       
   281             aPointerEvent.iPosition, itemUnderPointerIndex ) )
       
   282         {
       
   283         if ( CurrentItemIndex() != itemUnderPointerIndex )
       
   284             {
       
   285             CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
       
   286     		if ( parent->IsNoItemDragged() )
       
   287     			{
       
   288     			if ( ItemDrawer()->Flags() & CListItemDrawer::EPressedDownState )
       
   289     				{
       
   290     				ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState );
       
   291     				iView->DrawItem( CurrentItemIndex() );
       
   292     				}
       
   293     			}
       
   294     		else
       
   295     			{
       
   296     			iView->SetCurrentItemIndex( itemUnderPointerIndex );
       
   297 				iView->DrawItem(itemUnderPointerIndex);
       
   298     			}
       
   299             }
       
   300         }
       
   301 
       
   302     HandleScrollingInEditMode( aPointerEvent );
       
   303     }
       
   304 
       
   305 // -----------------------------------------------------------------------------
       
   306 //
       
   307 // -----------------------------------------------------------------------------
       
   308 //
       
   309 void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent )
       
   310     {
       
   311     CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
       
   312     if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   313 		{
       
   314         const TInt KIgnoreRectSize = 40;
       
   315         TRect ignoreDragRect(aPointerEvent.iPosition,
       
   316                 TSize(KIgnoreRectSize, KIgnoreRectSize));
       
   317         ignoreDragRect.Move( - KIgnoreRectSize / 2, - KIgnoreRectSize / 2 );
       
   318         Window().RequestPointerRepeatEvent( 50000, ignoreDragRect );
       
   319 		}
       
   320     else if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat )
       
   321         {
       
   322         HandleButtonRepeatEventInNormalModeL( aPointerEvent );
       
   323         }
       
   324 	CAknGrid::HandlePointerEventL(aPointerEvent);
       
   325     }
       
   326 
       
   327 // -----------------------------------------------------------------------------
       
   328 //
       
   329 // -----------------------------------------------------------------------------
       
   330 //
       
   331 void CMmGrid::HandleButtonRepeatEventInNormalModeL(
       
   332         const TPointerEvent& aPointerEvent )
       
   333     {
       
   334     TInt itemUnderPointerIndex = KErrNotFound;
       
   335     TBool itemFound = View()->XYPosToItemIndex(
       
   336             aPointerEvent.iPosition, itemUnderPointerIndex );
       
   337     if ( !itemFound )
       
   338         {
       
   339         return;
       
   340         }
       
   341 
       
   342     View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState );
       
   343     CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
       
   344     TBool highlightWasVisible = parent->IsHighlightVisible();
       
   345 
       
   346     if( itemUnderPointerIndex == View()->CurrentItemIndex() )
       
   347         {
       
   348 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   349         MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
       
   350                 iMmDrawer->Gc() );
       
   351          if ( transApi )
       
   352              {
       
   353              transApi->Remove( MAknListBoxTfxInternal::EListHighlight );
       
   354              View()->DrawItem( itemUnderPointerIndex );
       
   355              TRect itemUnderPointerIndexRect (
       
   356                      View()->ItemPos(itemUnderPointerIndex),
       
   357                      View()->ItemSize(itemUnderPointerIndex));
       
   358              transApi->Draw( itemUnderPointerIndexRect );
       
   359              }
       
   360          else
       
   361         	 {
       
   362         	 View()->DrawItem( itemUnderPointerIndex );
       
   363         	 }
       
   364 #else
       
   365          View()->DrawItem( itemUnderPointerIndex );
       
   366 #endif
       
   367         }
       
   368      else
       
   369         {
       
   370         TInt previouslyHighlightedItemIndex = View()->CurrentItemIndex();
       
   371         parent->SetManualHighlightL( itemUnderPointerIndex , EFalse );
       
   372         if ( highlightWasVisible )
       
   373             {
       
   374             View()->DrawItem( previouslyHighlightedItemIndex );
       
   375             }
       
   376         }
       
   377     }
       
   378 
       
   379 // -----------------------------------------------------------------------------
       
   380 //
       
   381 // -----------------------------------------------------------------------------
       
   382 //
       
   383 void CMmGrid::HandleScrollingInEditMode( const TPointerEvent& aPointerEvent )
       
   384     {
       
   385     if ( aPointerEvent.iType == TPointerEvent::EDrag
       
   386             || aPointerEvent.iType == TPointerEvent::EButtonRepeat )
       
   387         {
       
   388         TInt nextScrollDelay = ScrollIfNeeded( aPointerEvent );
       
   389         if ( nextScrollDelay )
       
   390             {
       
   391             TRect ignoreDragRect(
       
   392                 TPoint(aPointerEvent.iParentPosition.iX - MmEffects::KDragIgnoreRectValue,
       
   393                     aPointerEvent.iParentPosition.iY - MmEffects::KDragIgnoreRectValue),
       
   394                 TPoint(aPointerEvent.iParentPosition.iX + MmEffects::KDragIgnoreRectValue,
       
   395                     aPointerEvent.iParentPosition.iY + MmEffects::KDragIgnoreRectValue));
       
   396 
       
   397             Window().CancelPointerRepeatEventRequest();
       
   398             Window().RequestPointerRepeatEvent( nextScrollDelay, ignoreDragRect );
       
   399             }
       
   400         }
       
   401     }
       
   402 
       
   403 // -----------------------------------------------------------------------------
       
   404 //
       
   405 // -----------------------------------------------------------------------------
       
   406 //
       
   407 TBool CMmGrid::IsPointerInTopScrollingThreshold(
       
   408             const TPointerEvent& aPointerEvent ) const
       
   409     {
       
   410     TInt topScrollingTreshold = Rect().iTl.iY
       
   411         + ( MmEffects::KFocusScrollingThreshold
       
   412             * TReal( View()->ItemSize().iHeight ) );
       
   413 
       
   414     return ( aPointerEvent.iPosition.iY < topScrollingTreshold );
       
   415     }
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 //
       
   419 // -----------------------------------------------------------------------------
       
   420 //
       
   421 TBool CMmGrid::IsPointerInBottomScrollingThreshold(
       
   422             const TPointerEvent& aPointerEvent ) const
       
   423     {
       
   424     TInt bottomScrollingTreshold = Rect().iBr.iY
       
   425         - ( MmEffects::KFocusScrollingThreshold
       
   426             * TReal( View()->ItemSize().iHeight ) );
       
   427 
       
   428     return ( aPointerEvent.iPosition.iY > bottomScrollingTreshold );
       
   429     }
       
   430 
       
   431 // -----------------------------------------------------------------------------
       
   432 //
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 void CMmGrid::ScrollWithoutRedraw( TInt distanceInPixels )
       
   436     {
       
   437     CAknGridView* view = static_cast<CAknGridView*>( iView );
       
   438     const TInt rowHeight = ItemHeight();
       
   439     const TInt numOfCols = view->NumberOfColsInView();
       
   440     const TInt itemCount = iModel->NumberOfItems();
       
   441     TInt totalNumberOfRows = itemCount / numOfCols;
       
   442     if ( itemCount % numOfCols )
       
   443         {
       
   444         ++totalNumberOfRows;
       
   445         }
       
   446     const TInt topItemRowIndex = TopItemIndex() / numOfCols;
       
   447     
       
   448     // desired view position relative to the first item in grid (always positive)
       
   449     TInt desiredViewPosition = rowHeight * topItemRowIndex - VerticalItemOffset();
       
   450     
       
   451     desiredViewPosition += distanceInPixels;
       
   452     
       
   453     const TInt viewPositionMin = 0;
       
   454     const TInt viewPositionMax = 
       
   455 		Max( 0, ( totalNumberOfRows * rowHeight ) - view->ViewRect().Height() );
       
   456     
       
   457     desiredViewPosition = Min( desiredViewPosition, viewPositionMax );
       
   458     desiredViewPosition = Max( desiredViewPosition, viewPositionMin );
       
   459    
       
   460     ASSERT( desiredViewPosition >= 0 );
       
   461     
       
   462     TInt newTopItemIndex = ( desiredViewPosition / rowHeight ) * numOfCols;
       
   463     TInt newVerticalOffset = -( desiredViewPosition % rowHeight ); 
       
   464     SetTopItemIndex( newTopItemIndex );
       
   465     SetVerticalItemOffset( newVerticalOffset );
       
   466     }
       
   467 
       
   468 // -----------------------------------------------------------------------------
       
   469 //
       
   470 // -----------------------------------------------------------------------------
       
   471 //
       
   472 TInt CMmGrid::ScrollIfNeeded( const TPointerEvent& aPointerEvent )
       
   473     {
       
   474     CAknGridView* view = static_cast<CAknGridView*>( View() );
       
   475     TInt nextScrollDelay = 0;
       
   476 
       
   477     TBool readyForScrolling = iMmDrawer->GetAnimator()->IsReadyForNewAnimation()
       
   478 		&& iMmDrawer->GetFloatingItemCount() != 0;
       
   479 
       
   480 	if ( IsPointerInTopScrollingThreshold( aPointerEvent ) )
       
   481 		{
       
   482 		// scroll up by one row
       
   483 		TInt newCurrentItemIndex = CurrentItemIndex() - view->NumberOfColsInView();
       
   484         if ( newCurrentItemIndex < 0 )
       
   485             {
       
   486             newCurrentItemIndex = CurrentItemIndex();
       
   487             }
       
   488 
       
   489        nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor *
       
   490 		   Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY );
       
   491 
       
   492 		if ( readyForScrolling )
       
   493 			{
       
   494 			ScrollWithoutRedraw( -iItemHeight );
       
   495 			View()->SetCurrentItemIndex( newCurrentItemIndex );
       
   496 			}
       
   497 		}
       
   498 	else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) )
       
   499 		{
       
   500 		TInt newCurrentItemIndex = CurrentItemIndex() + view->NumberOfColsInView();
       
   501 		if ( newCurrentItemIndex > iModel->NumberOfItems() - 1 )
       
   502 			{
       
   503 			newCurrentItemIndex = CurrentItemIndex();
       
   504 			}
       
   505 	
       
   506 		nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor *
       
   507 			Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY );
       
   508 
       
   509 		if ( readyForScrolling )
       
   510 			{
       
   511 			ScrollWithoutRedraw( iItemHeight );
       
   512 			View()->SetCurrentItemIndex( newCurrentItemIndex );
       
   513 			}
       
   514 		}
       
   515 
       
   516     return nextScrollDelay;
       
   517     }
       
   518 
       
   519 // -----------------------------------------------------------------------------
       
   520 //
       
   521 // -----------------------------------------------------------------------------
       
   522 //
       
   523 void CMmGrid::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   524     {
       
   525 //    if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
       
   526 //            iMmDrawer->CachedDataUseIsEnabled() )
       
   527 //        {
       
   528 //        // Touching the screen stops flick but avkon does not send us
       
   529 //        // MEikListBoxObserver::EEventFlickStopped event in such case.
       
   530 //        // Thus this little hack:
       
   531 //        iMmDrawer->EnableCachedDataUse( EFalse );
       
   532 //        DrawView();
       
   533 //        }
       
   534 
       
   535     CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
       
   536     if ( parent->IsEditMode() )
       
   537         {
       
   538         HandlePointerEventInEditModeL( aPointerEvent );
       
   539         }
       
   540     else
       
   541         {
       
   542         HandlePointerEventInNormalModeL( aPointerEvent );
       
   543         }
       
   544 
       
   545     if ( iMmDrawer->GetFloatingItemCount() > 0 &&
       
   546             iMmDrawer->GetAnimator()->IsActive() )
       
   547         {
       
   548         iMmDrawer->GetAnimator()->CancelNextRedrawL();
       
   549         }
       
   550     }
       
   551 
       
   552 // -----------------------------------------------------------------------------
       
   553 //
       
   554 // -----------------------------------------------------------------------------
       
   555 //
       
   556 void CMmGrid::HandleOverridenHighlightDrawing( const TPointerEvent& aPointerEvent,
       
   557         TInt aIndexBefore, TInt aIndexAfter )
       
   558     {
       
   559     // In grid our behaviour is a little different than defalt avkon.
       
   560     // It is required to clean the highlight after the finger has been raised,
       
   561     // and simulate the tap effect, when an item that has an invisible
       
   562     // highlight is tapped again.
       
   563     TBool effects (EFalse);
       
   564 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   565         MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
       
   566                 iMmDrawer->Gc() );
       
   567         effects = transApi && !transApi->EffectsDisabled();
       
   568 #endif
       
   569     if (effects)
       
   570         {
       
   571         CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() );
       
   572         if ( aIndexBefore == aIndexAfter
       
   573                 && !parent->IsEditMode()
       
   574                 && aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   575             {
       
   576             DrawItem( aIndexAfter );
       
   577 
       
   578 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   579             MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
       
   580                     iMmDrawer->Gc() );
       
   581              if ( transApi )
       
   582                  {
       
   583                  transApi->SetMoveType( MAknListBoxTfxInternal::EListTap);
       
   584                  transApi->Draw( Rect() );
       
   585                  }
       
   586 #endif
       
   587             }
       
   588         else if ( aIndexBefore == aIndexAfter
       
   589                 && aPointerEvent.iType == TPointerEvent::EButton1Up
       
   590                 && !parent->IsHighlightVisible())
       
   591             {
       
   592 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
   593             MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
       
   594                     iMmDrawer->Gc() );
       
   595              if ( transApi )
       
   596                  {
       
   597                  transApi->Draw( Rect() );
       
   598                  }
       
   599 #endif
       
   600             }
       
   601         }
       
   602 
       
   603     }
       
   604 // -----------------------------------------------------------------------------
       
   605 //
       
   606 // -----------------------------------------------------------------------------
       
   607 //
       
   608 void CMmGrid::FixViewForMirroredLayout()
       
   609     {
       
   610     TInt scrollbarWidth = ScrollBarOffset() +
       
   611             ScrollBarFrame()->VerticalScrollBar()->Rect().Width();
       
   612     TRect r( View()->ViewRect() );
       
   613     TInt currentShift = r.iTl.iX;
       
   614     TBool scrollbarVisible = ScrollBarFrame()->VerticalScrollBar()->IsVisible();
       
   615     TBool layoutMirrored = AknLayoutUtils::LayoutMirrored();
       
   616 
       
   617     if ( layoutMirrored )
       
   618         {
       
   619         // Extra width, which results from the fact that it is not always
       
   620         // possible to divide screen width by the number of columns without
       
   621         // a non-zero remainder. This makes the distance of grid items from
       
   622         // scrollbar in mirrored layout exactly the same as in normal layout.
       
   623         scrollbarWidth += ( r.Width() - scrollbarWidth ) %
       
   624             ( (CAknGridView*) View() )->NumberOfColsInView();
       
   625         }
       
   626 
       
   627     if ( layoutMirrored && scrollbarVisible && currentShift != scrollbarWidth )
       
   628         {
       
   629         // shift view rect to the right
       
   630         r.Move( scrollbarWidth - currentShift, 0 );
       
   631         View()->SetViewRect( r );
       
   632         }
       
   633     else if ( ( !layoutMirrored || !scrollbarVisible ) && currentShift != 0 )
       
   634         {
       
   635         // restore view rect to its normal position
       
   636         r.Move( -currentShift, 0 );
       
   637         View()->SetViewRect( r );
       
   638         }
       
   639     }
       
   640 
       
   641 // -----------------------------------------------------------------------------
       
   642 //
       
   643 // -----------------------------------------------------------------------------
       
   644 //
       
   645 void CMmGrid::ConstructL( const CCoeControl* aParent, TInt aFlags,
       
   646         CMmTemplateLibrary* aTemplateLibrary )
       
   647     {
       
   648     iDisableChildComponentDrawing = EFalse;
       
   649     iModel = iMmModel = CMmGridModel::NewL();
       
   650     CreateItemDrawerL(aTemplateLibrary);
       
   651     CAknGrid::ConstructL( aParent, aFlags );
       
   652     iMmDrawer->SetView( this );
       
   653 
       
   654     //set initial value so avkon does not panic
       
   655     if ( Layout_Meta_Data::IsLandscapeOrientation() )
       
   656         {
       
   657         iViewLayout = TSize( MmGrid::K4By3LayoutX, MmGrid::K4By3LayoutY );
       
   658         }
       
   659     else
       
   660         {
       
   661         iViewLayout = TSize( MmGrid::K3By4LayoutX, MmGrid::K3By4LayoutY );
       
   662         }
       
   663 
       
   664     DoSetupLayoutL();
       
   665     iRedrawTimer = CPeriodic::NewL( EPriorityRealTime );
       
   666     }
       
   667 
       
   668 // -----------------------------------------------------------------------------
       
   669 //
       
   670 // -----------------------------------------------------------------------------
       
   671 //
       
   672 CListBoxView* CMmGrid::MakeViewClassInstanceL()
       
   673     {
       
   674     return CMmGridView::NewL();
       
   675     }
       
   676 
       
   677 // -----------------------------------------------------------------------------
       
   678 //
       
   679 // -----------------------------------------------------------------------------
       
   680 //
       
   681 CMmGridModel* CMmGrid::MmModel()
       
   682     {
       
   683     return iMmModel;
       
   684     }
       
   685 
       
   686 // -----------------------------------------------------------------------------
       
   687 //
       
   688 // -----------------------------------------------------------------------------
       
   689 //
       
   690 TKeyResponse CMmGrid::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
       
   691     {
       
   692     TKeyEvent eventCopy( aKeyEvent );
       
   693     if ( AknLayoutUtils::LayoutMirrored() )
       
   694         {
       
   695         if ( eventCopy.iCode == EKeyLeftArrow )
       
   696             {
       
   697             eventCopy.iCode = EKeyRightArrow;
       
   698             }
       
   699         else if ( eventCopy.iCode == EKeyRightArrow )
       
   700             {
       
   701             eventCopy.iCode = EKeyLeftArrow;
       
   702             }
       
   703         }
       
   704     return CAknGrid::OfferKeyEventL( eventCopy, aType );
       
   705     }
       
   706 
       
   707 // -----------------------------------------------------------------------------
       
   708 //
       
   709 // -----------------------------------------------------------------------------
       
   710 //
       
   711 void CMmGrid::HandleViewRectSizeChangeL()
       
   712     {
       
   713     if ( !AknLayoutUtils::LayoutMirrored() )
       
   714         {
       
   715         CAknGrid::HandleViewRectSizeChangeL();
       
   716         }
       
   717     else
       
   718         {
       
   719         // for mirrored layout this function should do
       
   720         // exactly the same things as CAknGrid::HandleViewRectSizeChangeL
       
   721         // would do for normal layout
       
   722         iView->CalcBottomItemIndex();
       
   723         if ( CurrentItemIndex() >= 0 )
       
   724             {
       
   725             AdjustTopItemIndex();
       
   726             iView->CalcDataWidth();
       
   727             UpdateScrollBarsL();
       
   728             iView->CalcBottomItemIndex();
       
   729             }
       
   730         }
       
   731     }
       
   732 
       
   733 // -----------------------------------------------------------------------------
       
   734 //
       
   735 // -----------------------------------------------------------------------------
       
   736 //
       
   737 void CMmGrid::AdjustTopItemIndex() const
       
   738     {
       
   739     CAknGridView* view = static_cast<CAknGridView*>( iView );
       
   740     const TInt numOfCols = view->NumberOfColsInView();
       
   741     const TInt numOfRows = view->NumberOfRowsInView();
       
   742     const TInt itemCount = iModel->NumberOfItems();
       
   743 
       
   744     ASSERT( numOfCols > 0 );
       
   745 
       
   746     TInt lastRow = 0;
       
   747     if ( itemCount > 0 )
       
   748         {
       
   749         lastRow = ( itemCount - 1 ) / numOfCols;
       
   750         }
       
   751     TInt maxPossibleTopRow = Max( 0, lastRow - numOfRows + 1 );
       
   752 
       
   753     TInt topRow = TopItemIndex() / numOfCols;
       
   754 
       
   755     if ( !( TopItemIndex() % numOfCols == 0 &&
       
   756          topRow <= maxPossibleTopRow ) )
       
   757         {
       
   758         topRow = Min( topRow, maxPossibleTopRow );
       
   759         SetTopItemIndex( topRow * numOfCols );
       
   760         }
       
   761 
       
   762     // prevent problems with view being scrolled up beyond limits
       
   763     if ( topRow == maxPossibleTopRow && VerticalItemOffset() < 0 )
       
   764         {
       
   765         TRAP_IGNORE(
       
   766                 ( ( CMmWidgetContainer* ) Parent() )->AlignBottomOfViewL() );
       
   767         }
       
   768     }
       
   769 
       
   770 // -----------------------------------------------------------------------------
       
   771 //
       
   772 // -----------------------------------------------------------------------------
       
   773 //
       
   774 void CMmGrid::DoHandleResourceChangeL( TSize& aCellSize,
       
   775         TSize& aViewLayout )
       
   776     {
       
   777     TBool cond = Layout_Meta_Data::IsLandscapeOrientation();
       
   778     TRAPD( err, DoHandleResourceChangeL( cond, aCellSize, aViewLayout ) );
       
   779     if ( err == KErrNotFound )
       
   780         {
       
   781         aViewLayout = iViewLayout;
       
   782         aCellSize = TSize (1,1);
       
   783         }
       
   784     else if ( err == KErrNoMemory )
       
   785         {
       
   786         User::Leave( KErrNoMemory );
       
   787         }
       
   788     }
       
   789 
       
   790 // -----------------------------------------------------------------------------
       
   791 //
       
   792 // -----------------------------------------------------------------------------
       
   793 //
       
   794 void CMmGrid::DoHandleResourceChangeL( TBool aIsLandscape, TSize& aCellSize,
       
   795         TSize& aViewLayout )
       
   796     {
       
   797     CHnSuiteModel* model = iMmModel->MmListBoxModel()->GetSuiteModel();
       
   798     const TDesC8& templ = (model) ? model->GetTemplate() : KNullDesC8();
       
   799     aCellSize = iMmDrawer->TemplateLibrary()->GetSize(
       
   800         EGrid, templ, aIsLandscape, EFalse, iView->ViewRect() );
       
   801     aViewLayout = iMmDrawer->TemplateLibrary()->GetLayoutSizeL(
       
   802         EGrid, templ, aIsLandscape );
       
   803     iViewLayout = aViewLayout;
       
   804     }
       
   805 
       
   806 // -----------------------------------------------------------------------------
       
   807 //
       
   808 // -----------------------------------------------------------------------------
       
   809 //
       
   810 void CMmGrid::SetItemDrawerAndViewBgContext(
       
   811         CAknsBasicBackgroundControlContext * aBgContext )
       
   812     {
       
   813     iMmDrawer->SetBgContext (aBgContext);
       
   814     }
       
   815 
       
   816 // -----------------------------------------------------------------------------
       
   817 //
       
   818 // -----------------------------------------------------------------------------
       
   819 //
       
   820 TBool CMmGrid::HandleScrollbarVisibilityChangeL()
       
   821     {
       
   822     TBool ret = EFalse;
       
   823     if ( AllItemsFitInViewRect() )
       
   824         {
       
   825         if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible()
       
   826              || iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() )
       
   827             {
       
   828             ScrollBarFrame()->VerticalScrollBar()->MakeVisible( EFalse );
       
   829             iMmDrawer->SetScrollbarVisibilityL( EFalse );
       
   830             SetTopItemIndex( 0 );
       
   831             iCurrentTopItemIndex = 0;
       
   832             ret = ETrue;
       
   833             }
       
   834         }
       
   835     else if ( !ScrollBarFrame()->VerticalScrollBar()->IsVisible()
       
   836             || !iMmDrawer->TemplateLibrary()->GetScrollbarVisibility() )
       
   837         {
       
   838         ScrollBarFrame()->VerticalScrollBar()->MakeVisible( ETrue );
       
   839         iMmDrawer->SetScrollbarVisibilityL( ETrue );
       
   840         ret = ETrue;
       
   841         }
       
   842 
       
   843     return ret;
       
   844     }
       
   845 
       
   846 // -----------------------------------------------------------------------------
       
   847 //
       
   848 // -----------------------------------------------------------------------------
       
   849 //
       
   850 
       
   851 TBool CMmGrid::AllItemsFitInViewRect()
       
   852     {
       
   853     if ( iMmModel->NumberOfItems() <= iViewLayout.iWidth * iViewLayout.iHeight
       
   854             || iViewLayout == TSize(0,0) )
       
   855         {
       
   856         return ETrue;
       
   857         }
       
   858     else
       
   859         {
       
   860         return EFalse;
       
   861         }
       
   862     }
       
   863 
       
   864 // -----------------------------------------------------------------------------
       
   865 //
       
   866 // -----------------------------------------------------------------------------
       
   867 //
       
   868 void CMmGrid::UpdateScrollBarsL()
       
   869     {
       
   870     TBool visibilityChanged = HandleScrollbarVisibilityChangeL();
       
   871     if (ScrollBarFrame()->VerticalScrollBar()->IsVisible())
       
   872         {
       
   873         CAknGrid::UpdateScrollBarsL();
       
   874         }
       
   875     iCurrentTopItemIndex = TopItemIndex();
       
   876     iMmDrawer->TemplateLibrary()->SetScrollbarWidthL(
       
   877             ScrollBarFrame()->VerticalScrollBar()->Rect().Width() + ScrollBarOffset() );
       
   878     FixViewForMirroredLayout();
       
   879     if ( visibilityChanged )
       
   880         {
       
   881         CMmGridView* view = static_cast<CMmGridView*>( iView );
       
   882         view->UpdateItemHeightAndWidth();
       
   883         }
       
   884     }
       
   885 
       
   886 // -----------------------------------------------------------------------------
       
   887 //
       
   888 // -----------------------------------------------------------------------------
       
   889 //
       
   890 void CMmGrid::SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter )
       
   891     {
       
   892     iMarqueeAdapter = aAdapter;
       
   893     }
       
   894 
       
   895 
       
   896 // -----------------------------------------------------------------------------
       
   897 //
       
   898 // -----------------------------------------------------------------------------
       
   899 //
       
   900 void CMmGrid::SetupLayout()
       
   901     {
       
   902     TRAP_IGNORE( DoSetupLayoutL() );
       
   903     }
       
   904 
       
   905 // -----------------------------------------------------------------------------
       
   906 //
       
   907 // -----------------------------------------------------------------------------
       
   908 //
       
   909 void CMmGrid::DoSetupLayoutL()
       
   910     {
       
   911     TSize cellSize;
       
   912     TSize viewLayout;
       
   913     DoHandleResourceChangeL( cellSize, viewLayout );
       
   914 //  The mirrored layout arabic item lineout ( right to left )
       
   915 //  is handled by CMmGridView::ItemPos( TInt aItemIndex )
       
   916 //  and CMmGridView::XYPosToItemIndex( TPoint aPosition, TInt& aItemIndex )
       
   917     SetLayoutL( EFalse, ETrue /*!AknLayoutUtils::LayoutMirrored()*/, ETrue, viewLayout.iWidth,
       
   918         viewLayout.iHeight, cellSize, 0, 0 );
       
   919     iMmDrawer->SetNumberOfColsInView(
       
   920             static_cast<CMmGridView*>(iView)->NumberOfColsInView() );
       
   921     // setting the top item index when changing orientation
       
   922     TInt cols( static_cast<CMmGridView*>(iView)->NumberOfColsInView() );
       
   923     SetTopItemIndex( ( (TInt) ( iCurrentTopItemIndex / cols ) ) * cols );
       
   924     UpdateScrollBarsL();
       
   925     AknsUtils::RegisterControlPosition( iMmDrawer->FormattedCellData()->Control() );
       
   926     }
       
   927 
       
   928 // -----------------------------------------------------------------------------
       
   929 //
       
   930 // -----------------------------------------------------------------------------
       
   931 //
       
   932 TInt CMmGrid::ScrollBarOffset()
       
   933     {
       
   934     TInt offset = 0;
       
   935     if ( ScrollBarFrame()->ScrollBarExists( CEikScrollBar::EVertical ) )
       
   936         {
       
   937         if ( AknLayoutUtils::LayoutMirrored() )
       
   938             {
       
   939             offset = ScrollBarFrame()->VerticalScrollBar()->Position().iX;
       
   940             }
       
   941         else
       
   942             {
       
   943             offset = View()->ViewRect().Width()
       
   944                     - ( ScrollBarFrame()->VerticalScrollBar()->Position().iX
       
   945                         + ScrollBarFrame()->VerticalScrollBar()->Rect().Width() );
       
   946             }
       
   947         }
       
   948     return offset;
       
   949     }
       
   950 
       
   951 // -----------------------------------------------------------------------------
       
   952 //
       
   953 // -----------------------------------------------------------------------------
       
   954 //
       
   955 void CMmGrid::RedrawScrollbarBackground() const
       
   956     {
       
   957     TRect viewRect( View()->ViewRect() );
       
   958     if ( viewRect.iTl.iX > 0 )
       
   959         {
       
   960         TRect scrollbarRect( TPoint( 0, 0 ),
       
   961                 TSize( viewRect.iTl.iX, viewRect.Height() ) );
       
   962 
       
   963         CWindowGc* gc = iItemDrawer->Gc();
       
   964         CMmListBoxItemDrawer* itemDrawer =
       
   965                 static_cast<CMmListBoxItemDrawer*>( iItemDrawer );
       
   966         MAknsSkinInstance *skin = AknsUtils::SkinInstance();
       
   967         CCoeControl* control = itemDrawer->FormattedCellData()->Control();
       
   968         MAknsControlContext *cc = AknsDrawUtils::ControlContext( control );
       
   969         if( gc )
       
   970             {
       
   971             if ( control )
       
   972                 {
       
   973                 AknsDrawUtils::Background( skin, cc, control, *gc, scrollbarRect );
       
   974                 }
       
   975             else
       
   976                 {
       
   977                 gc->SetBrushColor( BackColor() );
       
   978                 gc->Clear( scrollbarRect );
       
   979                 }
       
   980             }
       
   981         }
       
   982     }
       
   983 
       
   984 // -----------------------------------------------------------------------------
       
   985 //
       
   986 // -----------------------------------------------------------------------------
       
   987 //
       
   988 void CMmGrid::ProcessScrollEventL( CEikScrollBar* aScrollBar, 
       
   989             TEikScrollEvent aEventType )
       
   990     {
       
   991     CAknGrid::HandleScrollEventL( aScrollBar, aEventType );
       
   992     iCurrentTopItemIndex = TopItemIndex();
       
   993 
       
   994     // setting default highligh in order not to overwrite the top item index
       
   995     // set before in the SetLayout method
       
   996     CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() );
       
   997     if (!parent->IsHighlightVisible())
       
   998          {
       
   999          parent->SetDefaultHighlightL( EFalse );
       
  1000 
       
  1001 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
       
  1002          MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal(
       
  1003                  static_cast<CMmGridView*>(iView)->Gc() );
       
  1004          TBool effects = transApi && !transApi->EffectsDisabled();
       
  1005          if ( effects && aEventType == EEikScrollPageUp ||
       
  1006                  aEventType == EEikScrollPageDown )
       
  1007              {
       
  1008              DrawNow();
       
  1009              }
       
  1010 #endif
       
  1011 
       
  1012          }
       
  1013     }
       
  1014 
       
  1015 // -----------------------------------------------------------------------------
       
  1016 //
       
  1017 // -----------------------------------------------------------------------------
       
  1018 //
       
  1019 void CMmGrid::HandleRedrawTimerEvent()
       
  1020     {
       
  1021     if ( iSkippedScrollbarEventsCount )
       
  1022         {
       
  1023         ProcessScrollEventL( ScrollBarFrame()->VerticalScrollBar(),
       
  1024                 EEikScrollThumbDragVert );
       
  1025         }
       
  1026     iSkippedScrollbarEventsCount = 0;
       
  1027     }
       
  1028     
       
  1029 // -----------------------------------------------------------------------------
       
  1030 //
       
  1031 // -----------------------------------------------------------------------------
       
  1032 //
       
  1033 TInt CMmGrid::RedrawTimerCallback( TAny* aPtr )
       
  1034     {
       
  1035     CMmGrid* self = static_cast<CMmGrid*>( aPtr );
       
  1036     self->HandleRedrawTimerEvent();
       
  1037     return 0;
       
  1038     }
       
  1039 
       
  1040 // -----------------------------------------------------------------------------
       
  1041 //
       
  1042 // -----------------------------------------------------------------------------
       
  1043 //
       
  1044 void CMmGrid::SetVerticalItemOffset(TInt aOffset)
       
  1045 	{
       
  1046 	static_cast<CMmGridView*> (View())->SetItemOffsetInPixels(aOffset);
       
  1047 	UpdateScrollBarThumbs();
       
  1048 	}
       
  1049 
       
  1050 // -----------------------------------------------------------------------------
       
  1051 //
       
  1052 // -----------------------------------------------------------------------------
       
  1053 //
       
  1054 TInt CMmGrid::VerticalItemOffset() const
       
  1055 	{
       
  1056 	return static_cast<CMmGridView*> (View())->VerticalItemOffset();
       
  1057 	}
       
  1058 
       
  1059 // -----------------------------------------------------------------------------
       
  1060 //
       
  1061 // -----------------------------------------------------------------------------
       
  1062 //
       
  1063 void CMmGrid::SetItemHeight( TInt aItemHeight )
       
  1064 	{
       
  1065 	iItemHeight = aItemHeight;
       
  1066 	}
       
  1067 
       
  1068 // -----------------------------------------------------------------------------
       
  1069 //
       
  1070 // -----------------------------------------------------------------------------
       
  1071 //
       
  1072 void CMmGrid::UpdateScrollBarThumbs()
       
  1073 	{
       
  1074 	CAknGrid::UpdateScrollBarThumbs();
       
  1075 	}
       
  1076 
       
  1077 // -----------------------------------------------------------------------------
       
  1078 //
       
  1079 // -----------------------------------------------------------------------------
       
  1080 //
       
  1081 TInt CMmGrid::CountComponentControls() const
       
  1082     {
       
  1083     TInt componentControls(0);
       
  1084     if ( !iDisableChildComponentDrawing )
       
  1085     	{
       
  1086         componentControls = CAknGrid::CountComponentControls();
       
  1087     	}
       
  1088     return componentControls;
       
  1089     }
       
  1090 // -----------------------------------------------------------------------------
       
  1091 //
       
  1092 // -----------------------------------------------------------------------------
       
  1093 //
       
  1094 void CMmGrid::SetDisableChildComponentDrawing( TBool aDisable )
       
  1095     {
       
  1096     iDisableChildComponentDrawing = aDisable;
       
  1097     }
       
  1098 //End of file