menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp
branchRCL_3
changeset 9 f966699dea19
parent 5 c743ef5928ba
child 15 ff572dfe6d86
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *  Version     : %version: MM_71.1.17.1.51 % << Don't touch! Updated by Synergy at check-out.
    15 *  Version     : %version: MM_71.1.17.1.55 % << Don't touch! Updated by Synergy at check-out.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #include <e32keys.h>
    20 #include <e32keys.h>
   235 
   235 
   236     CCoeControl::HandleResourceChange( aType );
   236     CCoeControl::HandleResourceChange( aType );
   237 
   237 
   238 	if ( aType == KEikDynamicLayoutVariantSwitch && !IsHighlightVisible() )
   238 	if ( aType == KEikDynamicLayoutVariantSwitch && !IsHighlightVisible() )
   239 		{
   239 		{
   240 		SetDefaultHighlightL( EFalse );
   240 		TRAP_IGNORE( SetDefaultHighlightL( EFalse ) );
   241 		}
   241 		}
   242     }
   242     }
   243 
   243 
   244 // -----------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   245 //
   245 //
   610     	iMarqueeAdapter->StopMarqueeDrawing();
   610     	iMarqueeAdapter->StopMarqueeDrawing();
   611     	}
   611     	}
   612 
   612 
   613     TInt index = KErrNotFound;
   613     TInt index = KErrNotFound;
   614     TBool itemExists = iWidget->View()->XYPosToItemIndex( aPointerEvent.iPosition, index );
   614     TBool itemExists = iWidget->View()->XYPosToItemIndex( aPointerEvent.iPosition, index );
   615     
   615 
   616     if ( iLongTapDetector )
   616     if ( iLongTapDetector )
   617         {
   617         {
   618         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
   618         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
   619             {
   619             {
   620             iLongTapDetector->EnableLongTapAnimation( itemExists &&
   620             iLongTapDetector->EnableLongTapAnimation( itemExists &&
   731 //
   731 //
   732 EXPORT_C void CMmWidgetContainer::SetHighlightVisibilityL( TBool aEnable )
   732 EXPORT_C void CMmWidgetContainer::SetHighlightVisibilityL( TBool aEnable )
   733     {
   733     {
   734     // activate the model
   734     // activate the model
   735     CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel();
   735     CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel();
   736 
       
   737     if ( suiteModel )
   736     if ( suiteModel )
   738         {
   737         {
   739         suiteModel->SetActiveL( aEnable );
   738         suiteModel->SetActiveL( aEnable );
   740         }
   739         }
       
   740 
       
   741     if ( ( !!aEnable != !!iPreviousHighlightVisibility ) // Ex-OR
       
   742             || ( !!aEnable != !!IsHighlightVisible() ) ) // Ex-OR
       
   743         {
   741 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   744 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   742 	    MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
   745             MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
   743 	    		iDrawer->Gc() );
   746                     iDrawer->Gc() );
   744 #endif
   747 #endif
   745     if ( !aEnable )
   748         if ( !aEnable )
   746         {
   749             {
   747         iWidget->View()->ItemDrawer()->SetFlags(
   750             iWidget->View()->ItemDrawer()->SetFlags(
   748             CListItemDrawer::ESingleClickDisabledHighlight );
   751                 CListItemDrawer::ESingleClickDisabledHighlight );
   749 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   752 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
   750 	    if ( transApi )
   753             if ( transApi )
   751 	        {
   754                 {
   752            	transApi->Remove( MAknListBoxTfxInternal::EListHighlight );
   755                 transApi->Remove( MAknListBoxTfxInternal::EListHighlight );
   753   	        }
   756                 }
   754 #endif
   757 #endif
   755         }
   758             }
   756     else
   759         else
   757         {
   760             {
   758         iWidget->View()->ItemDrawer()->ClearFlags(
   761             iWidget->View()->ItemDrawer()->ClearFlags(
   759             CListItemDrawer::ESingleClickDisabledHighlight );
   762                 CListItemDrawer::ESingleClickDisabledHighlight );
   760         }
   763             }
   761     
   764     
   762     if ( IsVisible() )
   765         if ( IsVisible() )
   763         {
   766             {
   764         TInt highlight = GetHighlight();
   767             TInt highlight = GetHighlight();
   765         CListBoxView* view = Widget()->View();
   768             CListBoxView* view = Widget()->View();
   766         Widget()->DrawNow( TRect( view->ItemPos( highlight ),
   769             Widget()->DrawNow( TRect( view->ItemPos( highlight ),
   767                 view->ItemSize( highlight ) ) );
   770                     view->ItemSize( highlight ) ) );
       
   771             }
       
   772         iPreviousHighlightVisibility = aEnable;
   768         }
   773         }
   769     }
   774     }
   770 
   775 
   771 // -----------------------------------------------------------------------------
   776 // -----------------------------------------------------------------------------
   772 //
   777 //
   773 // ----------------------------------------------------------------------------
   778 // ----------------------------------------------------------------------------
   774 //
   779 //
   775 EXPORT_C TBool CMmWidgetContainer::IsHighlightVisible()
   780 EXPORT_C TBool CMmWidgetContainer::IsHighlightVisible()
   776     {
   781     {
   777     return !( iWidget->View()->ItemDrawer()->Flags() & 
   782     return !( iWidget->View()->ItemDrawer()->Flags() &
   778     		CListItemDrawer::ESingleClickDisabledHighlight );
   783     		CListItemDrawer::ESingleClickDisabledHighlight );
   779     }
   784     }
   780 
   785 
   781 // -----------------------------------------------------------------------------
   786 // -----------------------------------------------------------------------------
   782 //
   787 //
  1593 		}
  1598 		}
  1594 	CCoeControl::MakeVisible(aVisible);
  1599 	CCoeControl::MakeVisible(aVisible);
  1595 	iWidget->MakeVisible(aVisible);
  1600 	iWidget->MakeVisible(aVisible);
  1596 	if ( !aVisible )
  1601 	if ( !aVisible )
  1597         {
  1602         {
  1598         SetHighlightVisibilityL( EFalse );
  1603 		TRAP_IGNORE( SetHighlightVisibilityL( EFalse ) );
  1599         }
  1604         }
  1600 	}
  1605 	}
  1601 
  1606 
  1602 // ---------------------------------------------------------------------------
  1607 // ---------------------------------------------------------------------------
  1603 //
  1608 //