emailuis/uicomponents/src/fstreevisualizerbase.cpp
branchRCL_3
changeset 8 e1b6206813b4
parent 4 e7aa27f58ae1
child 10 f5907b1a1053
equal deleted inserted replaced
4:e7aa27f58ae1 8:e1b6206813b4
  1701             }
  1701             }
  1702         }
  1702         }
  1703     }
  1703     }
  1704 
  1704 
  1705 // ---------------------------------------------------------------------------
  1705 // ---------------------------------------------------------------------------
       
  1706 // Gets item vertical position in the list 
       
  1707 // ---------------------------------------------------------------------------
       
  1708 //
       
  1709 TInt CFsTreeVisualizerBase::GetItemWorldPosition( const TInt aIdx )
       
  1710     {
       
  1711     TRect rect;
       
  1712     iWorld.GetItemRectByIndex( aIdx, rect);
       
  1713     return rect.iTl.iY;
       
  1714     }
       
  1715 
       
  1716 // ---------------------------------------------------------------------------
  1706 // Checks if the specified item is focused.
  1717 // Checks if the specified item is focused.
  1707 // ---------------------------------------------------------------------------
  1718 // ---------------------------------------------------------------------------
  1708 //
  1719 //
  1709 TFsTreeItemId CFsTreeVisualizerBase::FocusedItem() const
  1720 TFsTreeItemId CFsTreeVisualizerBase::FocusedItem() const
  1710     {
  1721     {
  2522             {
  2533             {
  2523             MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId));
  2534             MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId));
  2524             iWorld.AppendL(itemId, itemviz->Size());
  2535             iWorld.AppendL(itemId, itemviz->Size());
  2525             }
  2536             }
  2526         }
  2537         }
  2527     iViewPort.SetPositionL(TPoint(), EFalse);
  2538         // Below line commetned out. ViewPort is now not moved to the top of mail list
       
  2539         //iViewPort.SetPositionL(TPoint(), EFalse);
  2528     iViewPort.ClearCache();
  2540     iViewPort.ClearCache();
  2529     if (!isUpdating)
  2541     if (!isUpdating)
  2530         {
  2542         {
  2531         iWorld.EndUpdateL();
  2543         iWorld.EndUpdateL();
  2532         }
  2544         }
  5018         iPhysics->InitPhysicsL(worldSize, viewSize, EFalse);
  5030         iPhysics->InitPhysicsL(worldSize, viewSize, EFalse);
  5019         }
  5031         }
  5020     }
  5032     }
  5021 
  5033 
  5022 // ---------------------------------------------------------------------------
  5034 // ---------------------------------------------------------------------------
       
  5035 // Returns viewPort top-left position
       
  5036 // ---------------------------------------------------------------------------
       
  5037 //
       
  5038 TPoint CFsTreeVisualizerBase::ViewPortTopPosition() const
       
  5039 {
       
  5040     FUNC_LOG;
       
  5041     return iViewPort.Position();
       
  5042 }
       
  5043 
       
  5044 // ---------------------------------------------------------------------------
  5023 // Physic updated view position
  5045 // Physic updated view position
  5024 // ---------------------------------------------------------------------------
  5046 // ---------------------------------------------------------------------------
  5025 //
  5047 //
  5026 void CFsTreeVisualizerBase::ViewPositionChanged(const TPoint& aNewPosition,
  5048 void CFsTreeVisualizerBase::ViewPositionChanged(const TPoint& aNewPosition,
  5027         TBool /*aDrawNow*/, TUint /*aFlags*/)
  5049         TBool /*aDrawNow*/, TUint aFlags )
  5028     {
  5050     {
  5029     FUNC_LOG;
  5051     FUNC_LOG;
  5030     TInt error(KErrNone);
  5052     TInt error(KErrNone);
  5031     TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue, EUpdatedByPhisic) );
  5053     TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue,
       
  5054                 aFlags == 0 ? EUpdatedByPhisic : ENotUpdatedByPhisic ) );
  5032     ERROR_1( error, "iViewPort.SetCenterPositionL failed with error: %d", error );
  5055     ERROR_1( error, "iViewPort.SetCenterPositionL failed with error: %d", error );
  5033     }
  5056     }
  5034 
  5057 
  5035 // ---------------------------------------------------------------------------
  5058 // ---------------------------------------------------------------------------
  5036 // Physic emulation has finished
  5059 // Physic emulation has finished