emailuis/uicomponents/src/fstreevisualizerbase.cpp
branchRCL_3
changeset 22 d620048b4810
parent 20 efd4f1afd43e
child 23 dcf0eedfc1a3
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
  1528 // CFsTreeVisualizerBase::SetFocusVisibility
  1528 // CFsTreeVisualizerBase::SetFocusVisibility
  1529 // ---------------------------------------------------------------------------
  1529 // ---------------------------------------------------------------------------
  1530 //
  1530 //
  1531 void CFsTreeVisualizerBase::SetFocusVisibility( TBool aShow )
  1531 void CFsTreeVisualizerBase::SetFocusVisibility( TBool aShow )
  1532     {
  1532     {
  1533     if ( iFocusVisible != aShow )
  1533     if ( ( iFocusVisible && !aShow ) || ( !iFocusVisible && aShow ) )
  1534         {
  1534         {
  1535         iFocusVisible = aShow;
  1535         iFocusVisible = aShow;
  1536         TRAP_IGNORE(
  1536         TRAP_IGNORE(
  1537             MakeSelectorVisibleL( aShow );
  1537             MakeSelectorVisibleL( aShow );
  1538             UpdateItemL( iFocusedItem ); );
  1538             UpdateItemL( iFocusedItem ); );
  1547     {
  1547     {
  1548     TBool eventHandled(EFalse);
  1548     TBool eventHandled(EFalse);
  1549     if (iDragHandler && iOwnerControl->ControlGroup()->AcceptInput())
  1549     if (iDragHandler && iOwnerControl->ControlGroup()->AcceptInput())
  1550         {
  1550         {
  1551         TPointerEvent::TType type = aEvent.PointerEvent().iType;
  1551         TPointerEvent::TType type = aEvent.PointerEvent().iType;
  1552         const TInt id(EventItemId(aEvent));
  1552         const TFsTreeItemId id(EventItemId(aEvent));
  1553         INFO_1("visual: $%x", aEvent.Visual());
  1553         INFO_1("visual: $%x", aEvent.Visual());
  1554         if (KErrNotFound != id || type == TPointerEvent::EDrag ||
  1554         if ( KFsTreeNoneID != id || type == TPointerEvent::EDrag ||
  1555                 type  == TPointerEvent::EButtonRepeat ||
  1555                 type  == TPointerEvent::EButtonRepeat ||
  1556                 type  == TPointerEvent::EButton1Up ||
  1556                 type  == TPointerEvent::EButton1Up ||
  1557                 type  == TPointerEvent::EButton1Down)
  1557                 type  == TPointerEvent::EButton1Down)
  1558             {
  1558             {
  1559             switch (type)
  1559             switch (type)
  1595                         {
  1595                         {
  1596                         iPhysics->StopPhysics();
  1596                         iPhysics->StopPhysics();
  1597                         }*/
  1597                         }*/
  1598                     iDragHandler->PointerUp( aEvent.PointerEvent(), id );
  1598                     iDragHandler->PointerUp( aEvent.PointerEvent(), id );
  1599                     iFlags.Clear(EIgnorePointerUpAction);
  1599                     iFlags.Clear(EIgnorePointerUpAction);
       
  1600                     iFlags.Clear( EListPanning );
  1600                     break;
  1601                     break;
  1601                     }
  1602                     }
  1602                 case TPointerEvent::EDrag:
  1603                 case TPointerEvent::EDrag:
  1603                     {
  1604                     {
  1604                     eventHandled = ETrue;
  1605                     eventHandled = ETrue;
  1682 // ---------------------------------------------------------------------------
  1683 // ---------------------------------------------------------------------------
  1683 //
  1684 //
  1684 TFsTreeItemId CFsTreeVisualizerBase::VisualItemId(const CAlfVisual* aVisual) const
  1685 TFsTreeItemId CFsTreeVisualizerBase::VisualItemId(const CAlfVisual* aVisual) const
  1685     {
  1686     {
  1686     FUNC_LOG;
  1687     FUNC_LOG;
  1687     TInt itemId(KErrNotFound);
  1688     TFsTreeItemId itemId( KFsTreeNoneID );
  1688     if (aVisual)
  1689     if (aVisual)
  1689         {
  1690         {
  1690         aVisual->PropertyFindInteger(KPropertyItemId(), &itemId);
  1691         aVisual->PropertyFindInteger(KPropertyItemId(), &itemId);
  1691         }
  1692         }
  1692     return itemId;
  1693     return itemId;
  2885 // ---------------------------------------------------------------------------
  2886 // ---------------------------------------------------------------------------
  2886 //
  2887 //
  2887 void CFsTreeVisualizerBase::RemoveItemL(TFsTreeItemId aItemId)
  2888 void CFsTreeVisualizerBase::RemoveItemL(TFsTreeItemId aItemId)
  2888     {
  2889     {
  2889     FUNC_LOG;
  2890     FUNC_LOG;
  2890     TInt removedindex = iWorld.IndexOfItem(aItemId);
  2891     const TInt removedindex(iWorld.IndexOfItem(aItemId));
  2891     iWorld.RemoveL(aItemId);
  2892     iWorld.RemoveL(aItemId);
  2892     if (iFocusedItem == aItemId)
  2893     if (iFocusedItem == aItemId)
  2893         {
  2894         {
  2894         if (iWorld.ItemCount() > removedindex)
  2895         if (iWorld.ItemCount() > removedindex)
  2895             {
  2896             {
  5049 // ---------------------------------------------------------------------------
  5050 // ---------------------------------------------------------------------------
  5050 //
  5051 //
  5051 void CFsTreeVisualizerBase::SetPanningPosition(const TPoint& aDelta)
  5052 void CFsTreeVisualizerBase::SetPanningPosition(const TPoint& aDelta)
  5052     {
  5053     {
  5053     FUNC_LOG;
  5054     FUNC_LOG;
  5054     iPhysics->RegisterPanningPosition(aDelta);
  5055     iPhysics->RegisterPanningPosition(aDelta);    
       
  5056     iFlags.Set( EListPanning );
       
  5057     SetFocusVisibility( EFalse );
  5055     }
  5058     }
  5056 
  5059 
  5057 // ---------------------------------------------------------------------------
  5060 // ---------------------------------------------------------------------------
  5058 // Starts flicking.
  5061 // Starts flicking.
  5059 // ---------------------------------------------------------------------------
  5062 // ---------------------------------------------------------------------------
  5226 //
  5229 //
  5227 // ---------------------------------------------------------------------------
  5230 // ---------------------------------------------------------------------------
  5228 //
  5231 //
  5229 CFsTreeVisualizerBase::CDragHandler* CFsTreeVisualizerBase::CDragHandler::NewL(
  5232 CFsTreeVisualizerBase::CDragHandler* CFsTreeVisualizerBase::CDragHandler::NewL(
  5230         CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout,
  5233         CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout,
  5231         const TBitFlagsT<TUint>& aFlags)
  5234         const TBitFlags& aFlags)
  5232     {
  5235     {
  5233     FUNC_LOG;
  5236     FUNC_LOG;
  5234     CDragHandler* self = new (ELeave) CDragHandler(aTree, aHighlightTimeout,
  5237     CDragHandler* self = new (ELeave) CDragHandler(aTree, aHighlightTimeout,
  5235             aFlags);
  5238             aFlags);
  5236     CleanupStack::PushL(self);
  5239     CleanupStack::PushL(self);
  5425 //
  5428 //
  5426 // ---------------------------------------------------------------------------
  5429 // ---------------------------------------------------------------------------
  5427 //
  5430 //
  5428 CFsTreeVisualizerBase::CDragHandler::CDragHandler(
  5431 CFsTreeVisualizerBase::CDragHandler::CDragHandler(
  5429         CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout,
  5432         CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout,
  5430         const TBitFlagsT<TUint>& aFlags) :
  5433         const TBitFlags& aFlags) :
  5431     iTree(aTree), iHighlightTimeout(aHighlightTimeout * 1000),
  5434     iTree(aTree), iHighlightTimeout(aHighlightTimeout * 1000),
  5432             iTreeVisualizerFlags(aFlags)
  5435             iTreeVisualizerFlags(aFlags)
  5433     {
  5436     {
  5434     FUNC_LOG;
  5437     FUNC_LOG;
  5435     }
  5438     }
  5460 // CFsTreeVisualizerBase::IsFocusShown
  5463 // CFsTreeVisualizerBase::IsFocusShown
  5461 // ---------------------------------------------------------------------------
  5464 // ---------------------------------------------------------------------------
  5462 //
  5465 //
  5463 TBool CFsTreeVisualizerBase::IsFocusShown()
  5466 TBool CFsTreeVisualizerBase::IsFocusShown()
  5464     {
  5467     {
  5465     if( iTouchPressed || iFocusVisible )
  5468     return ( iTouchPressed || iFocusVisible ) && iFlags.IsClear( EListPanning );
  5466         {
       
  5467         return ETrue;
       
  5468         }
       
  5469 
       
  5470     return EFalse;
       
  5471     }
  5469     }
  5472 
  5470 
  5473 
  5471 
  5474 // </cmail>
  5472 // </cmail>