emailuis/uicomponents/inc/fstreevisualizerbase.h
branchRCL_3
changeset 64 3533d4323edc
child 73 c8382f7b54ef
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     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:  Visualizer class for the hierarchical tree list.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSTREEVISUALIZER_H
       
    20 #define C_FSTREEVISUALIZER_H
       
    21 
       
    22 
       
    23 //////SYSTEM INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <babitflags.h>
       
    26 
       
    27 //////TOOLKIT INCLUDES
       
    28 #include <alf/alfenv.h> //MAlfActionObserver
       
    29 
       
    30 //////PROJECT INCLUDES
       
    31 #include <aknphysicsobserveriface.h>
       
    32 
       
    33 #include "fstreevisualizer.h"
       
    34 #include "fstreeobserver.h"
       
    35 #include "fsfadeeffectobserver.h"
       
    36 #include "fsslideeffectobserver.h"
       
    37 #include "fsscrollbarset.h"
       
    38 #include "muicscrollbar.h"
       
    39 
       
    40 //////TOOLKIT CLASSES
       
    41 class CAlfLayout;
       
    42 class CAlfTexture;
       
    43 class CAlfBrush;
       
    44 class TAlfEvent;
       
    45 class CAlfGridLayout;
       
    46 class CAlfDeckLayout;
       
    47 class CAlfFlowLayout;
       
    48 class CAlfImageVisual;
       
    49 class CAlfImageBrush;
       
    50 
       
    51 //////PROJECT CLASSES
       
    52 class MFsTreeItemData;
       
    53 class MFsTreeNodeVisualizer;
       
    54 class MFsTreeVisualizerObserver;
       
    55 class CFsTree;
       
    56 class CFsTreeListLayoutData;
       
    57 class CFsFadeEffect;
       
    58 class CFsSlideEffect;
       
    59 class CFsTreePlainOneLineItemData;
       
    60 class CFsWatermark;
       
    61 class MFsTreeItemVisualizer;
       
    62 class CFsInteractionInterval;
       
    63 class CFsAlfTextStyleManager;
       
    64 class CAknPhysics;
       
    65 class CAlfAnchorLayout;
       
    66 
       
    67 /**
       
    68  * Contains the visual structure of the list.
       
    69  *
       
    70  */
       
    71 
       
    72 enum TUpdatedByPhysic{
       
    73 	ENotUpdatedByPhisic = 0,
       
    74 	EUpdatedByPhisic,
       
    75 	EUpdatedByPhisicEnd
       
    76 	};
       
    77 
       
    78 NONSHARABLE_CLASS( TWorld )
       
    79     {
       
    80 
       
    81 public:
       
    82 
       
    83     /**
       
    84      * World observer interface
       
    85      */
       
    86     class MObserver
       
    87         {
       
    88     public:
       
    89 
       
    90         /**
       
    91          * This method is called when world is changed.
       
    92          */
       
    93         virtual void WorldUpdatedL( const TWorld& aWorld ) = 0;
       
    94 
       
    95         };
       
    96 
       
    97 public:
       
    98 
       
    99     /**
       
   100      * Constructor
       
   101      */
       
   102     TWorld();
       
   103 
       
   104     /**
       
   105      * Destructor
       
   106      */
       
   107     ~TWorld();
       
   108 
       
   109     /**
       
   110      * Add new observer to the world
       
   111      */
       
   112     void AddObserverL( MObserver& aObserver );
       
   113 
       
   114     /**
       
   115      * Remove observer from the world, if the observer is not found, does nothing.
       
   116      */
       
   117     void RemoveObserver( MObserver& aObserver );
       
   118 
       
   119     /**
       
   120      * Append new item to the bottom of world.
       
   121      */
       
   122     void AppendL( const TFsTreeItemId aId, const TSize& aSize );
       
   123 
       
   124     /**
       
   125      * Insert new item to the world. Items after inserted item will be shifted down.
       
   126      */
       
   127     void InsertL( const TFsTreeItemId aId, const TSize& aSize, const TInt aSlot );
       
   128 
       
   129     /**
       
   130      * Remove item from the world. Items after removed item will be shifted up.
       
   131      */
       
   132     void RemoveL( const TFsTreeItemId aId );
       
   133 
       
   134     /**
       
   135      * Clear the world.
       
   136      */
       
   137     void RemoveAllL();
       
   138 
       
   139     /**
       
   140      * Get items in range aY to aY + aHeight. Also returns offset by which the listlayout
       
   141      * needs to be scrolled (e.g. the first item in list might be only partly visible)
       
   142      */
       
   143     void GetItemsL( RArray<TFsTreeItemId>& aItems, TInt aY, TInt aHeight, TInt& aOffset,
       
   144             TInt& aBeginIndex );
       
   145 
       
   146     /**
       
   147      * Returns full height of the world (in pixels).
       
   148      */
       
   149     TInt Height() const;
       
   150 
       
   151     /**
       
   152      * Begin batch update. When batch update is going on, single modifications to the world
       
   153      * will not be signalled to the observers.
       
   154      */
       
   155     void BeginUpdate();
       
   156 
       
   157     /**
       
   158      * End batch update. Observers will be signalled.
       
   159      */
       
   160     void EndUpdateL();
       
   161 
       
   162     /**
       
   163      * Returns item's rect.
       
   164      */
       
   165     TInt GetItemRect( const TFsTreeItemId, TRect& aRect ) const;
       
   166 
       
   167     /**
       
   168      * Returns item's rect, scan starts from aStartIndex.
       
   169      */
       
   170     TInt GetItemRect( const TFsTreeItemId, TRect& aRect, const TInt aStartIndex ) const;
       
   171 
       
   172     /**
       
   173      * Returns item's rect by index in world.
       
   174      */
       
   175     TInt GetItemRectByIndex(const TInt aIndex, TRect& aRect) const;
       
   176 
       
   177     /**
       
   178      * Returns ETrue if batch update is going on.
       
   179      */
       
   180     TBool IsUpdating() const;
       
   181 
       
   182     /**
       
   183      * Reconstructs the whole world from given tree.
       
   184      */
       
   185     void Recalculate( const CFsTree& aTree );
       
   186 
       
   187     // for debug print
       
   188 
       
   189     /**
       
   190      * Checks world's integrity (e.g. there cannot be any overlapping items in the world)
       
   191      */
       
   192     TBool CheckIntegrity() const;
       
   193 
       
   194     /**
       
   195      * Returns number of items in the world.
       
   196      */
       
   197     TInt ItemCount() const;
       
   198 
       
   199     /**
       
   200      * Returns item id for the item at index aIndex.
       
   201      */
       
   202     TFsTreeItemId Item( TInt aIndex ) const;
       
   203 
       
   204     /**
       
   205      * Returns index of item with id aItem.
       
   206      */
       
   207     TInt IndexOfItem( TFsTreeItemId aItem ) const;
       
   208 
       
   209 private:
       
   210 
       
   211     /**
       
   212      * Move items from aSlot onwards down by aDelta amount.
       
   213      */
       
   214     void MoveBy( const TInt aSlot, const TInt aDelta);
       
   215 
       
   216     /**
       
   217      * Called when world has been updated.
       
   218      */
       
   219     void UpdatedL();
       
   220 
       
   221 private:
       
   222 
       
   223     /**
       
   224      * World item. Contains tree Id and visual rect.
       
   225      */
       
   226     class TItem
       
   227         {
       
   228 
       
   229     public:
       
   230 
       
   231         /**
       
   232          * Constructor
       
   233          */
       
   234         TItem( const TFsTreeItemId aId, const TRect& aRect );
       
   235 
       
   236         /**
       
   237          * Item rect
       
   238          */
       
   239         TRect Rect() const;
       
   240 
       
   241         /**
       
   242          * Sets item's rect
       
   243          */
       
   244         void SetRect( const TRect& aRect );
       
   245 
       
   246         /**
       
   247          * Move item by given amount.
       
   248          */
       
   249         void Move( TInt aDy );
       
   250 
       
   251         /**
       
   252          * Item's top Y coordinate
       
   253          */
       
   254         TInt Top() const;
       
   255 
       
   256         /**
       
   257          * Item's top left coordinate
       
   258          */
       
   259         TPoint TopLeft() const;
       
   260 
       
   261         /**
       
   262          * Item's height
       
   263          */
       
   264         TInt Height() const;
       
   265 
       
   266         /**
       
   267          * Item's bottom Y coordinate
       
   268          */
       
   269         TInt Bottom() const;
       
   270 
       
   271         /**
       
   272          * Item's bottom right coordinate
       
   273          */
       
   274         TPoint BottomRight() const;
       
   275 
       
   276     public:
       
   277 
       
   278         // Tree item id
       
   279         TFsTreeItemId iId;
       
   280 
       
   281     private:
       
   282 
       
   283         // Top left Y coordinate of the item
       
   284         TInt iY;
       
   285 
       
   286         // Height of the item
       
   287         TInt iHeight;
       
   288 
       
   289         };
       
   290 
       
   291 private:
       
   292 
       
   293     // World observers
       
   294     RPointerArray<MObserver> iObservers;
       
   295 
       
   296     // World items
       
   297     RArray<TItem> iItems;
       
   298 
       
   299     // Total height of the world
       
   300     TInt iHeight;
       
   301 
       
   302     // True if batch update is going on
       
   303     TBool iBatchUpdateOngoing;
       
   304 
       
   305     };
       
   306 
       
   307 /**
       
   308  * ViewPort to the list World. Is used to access the visible set of
       
   309  * the list.
       
   310  *
       
   311  */
       
   312 NONSHARABLE_CLASS( TViewPort ) : public TWorld::MObserver
       
   313     {
       
   314 
       
   315 public:
       
   316 
       
   317     /**
       
   318      * Hints for item repositioning inside the viewport.
       
   319      */
       
   320     enum TPositionHint
       
   321         {
       
   322         /** Keep the item position exactly same. */
       
   323         EPositionExact,
       
   324 
       
   325         /** Allow repositioning method to modify original position,
       
   326          * because item was expanded
       
   327          */
       
   328         EPositionAfterExpand
       
   329         };
       
   330 
       
   331 public:
       
   332 
       
   333     /**
       
   334      * Viewport observer interface.
       
   335      */
       
   336     class MObserver
       
   337         {
       
   338 
       
   339     public:
       
   340 
       
   341         /**
       
   342          * This method is called when the viewport changes.
       
   343          */
       
   344         virtual void ViewPortUpdatedL( TViewPort& aViewPort, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic ) = 0;
       
   345 
       
   346         };
       
   347 
       
   348 public:
       
   349 
       
   350     /**
       
   351      * Constructor
       
   352      */
       
   353     TViewPort( MObserver& aObserver, TWorld& aWorld );
       
   354 
       
   355     /**
       
   356      * Set viewport position to aPosition. If aInformUpdate is set to ETrue, observer
       
   357      * will be signalled.
       
   358      */
       
   359     void SetPositionL( const TPoint& aPosition, TBool aInformUpdate = ETrue );
       
   360 
       
   361     /**
       
   362      * Center viewport around position aPosition. If aInformUpdate is set to ETrue, observer
       
   363      * will be signalled.
       
   364      */
       
   365     void SetCenterPositionL( const TPoint& aPosition, TBool aInformUpdate = ETrue, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic );
       
   366 
       
   367     /**
       
   368      * Returns viewport position (i.e. topleft corner).
       
   369      */
       
   370     const TPoint& Position() const;
       
   371 
       
   372     /**
       
   373      * Returns viewport center position.
       
   374      */
       
   375     TPoint CenterPosition() const;
       
   376 
       
   377     /**
       
   378      * Sets viewport size.
       
   379      */
       
   380     void SetSizeL( const TSize& aSize );
       
   381 
       
   382     /**
       
   383      * Returns viewport's size.
       
   384      */
       
   385     const TSize& Size() const;
       
   386 
       
   387     /**
       
   388      * Get items visible in viewport's area.
       
   389      */
       
   390     void GetVisibleItemsL( RArray<TFsTreeItemId>& aItemsToBeRemoved, RArray<TFsTreeItemId>& aItemsToBeAdded, TInt& aOffset, TBool& aFullUpdate  );
       
   391 
       
   392     /**
       
   393       * Get items visible in viewport's area.
       
   394       */
       
   395     void GetVisibleItemsL(RArray<TFsTreeItemId>& aVisible, TInt& aOffset);
       
   396 
       
   397     /**
       
   398      * Returns ETrue if the world is higher than viewport.
       
   399      */
       
   400     TBool IsScrollBarNeeded() const;
       
   401 
       
   402     /**
       
   403      * Scroll viewport to item aItemId. If aInformUpdate is set to ETrue, observer
       
   404      * will be signalled.
       
   405      */
       
   406     void ScrollToItemL( const TFsTreeItemId aItemId, TBool aInformUpdate = ETrue );
       
   407 
       
   408     /**
       
   409      * Center viewport to item aItemId. If aInformUpdate is set to ETrue, observer
       
   410      * will be signalled.
       
   411      */
       
   412     void CenterToItemL( const TFsTreeItemId aItemId, TBool aInformUpdate = ETrue );
       
   413 
       
   414     /**
       
   415      * Scroll viewport so that aItemId becomes visible. If aInformUpdate is set to
       
   416      * ETrue, observer will be signalled.
       
   417      */
       
   418     void ScrollItemToViewL( const TFsTreeItemId aItemId, TBool aInformUpdate = ETrue );
       
   419 
       
   420     /**
       
   421      * Scroll viewport so that whole view is fully occupied by the list (if possible).
       
   422      */
       
   423     void MakeViewFullyOccupiedL( TBool aInformUpdate = ETrue );
       
   424 
       
   425     /**
       
   426      * Scoll viewport so that given item is shown in given position in view.
       
   427      * If aInformUpdate is set to ETrue, observer will be signalled.
       
   428      */
       
   429     void ItemToPositionL( const TFsTreeItemId aItemId, const TPoint& aPosition,
       
   430             TBool aInformUpdate = ETrue,
       
   431             const TPositionHint aHint = EPositionExact );
       
   432 
       
   433     /**
       
   434      * Returns viewport top item.
       
   435      */
       
   436     TFsTreeItemId TopItem() const;
       
   437 
       
   438     /**
       
   439      * Returns viewport bottom item.
       
   440      */
       
   441     TFsTreeItemId BottomItem() const;
       
   442 
       
   443     /**
       
   444      * Clears cache to do full list update.
       
   445      */
       
   446     void ClearCache();
       
   447 
       
   448     /**
       
   449      * Fetches item rect in viewport. If TRect::Height() is non zero, then item
       
   450      * is visible in viewport and TRect contains item coordinates.
       
   451      */
       
   452     TRect ItemRect( const TFsTreeItemId aItemId ) const;
       
   453 
       
   454     /**
       
   455      * Returns ETrue if the item is fully visible in viewport.
       
   456      */
       
   457     TBool ItemFullyVisible( const TFsTreeItemId aItemId ) const;
       
   458 
       
   459 private:
       
   460 
       
   461     /**
       
   462      * Limits given top value so that whole list is correctly layouted.
       
   463      */
       
   464     void LimitTop( TInt& aTop ) const;
       
   465 
       
   466 private:
       
   467 
       
   468     /**
       
   469      * Called when viewport is updated.
       
   470      */
       
   471     void UpdatedL(TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic);
       
   472 
       
   473 
       
   474 
       
   475 private: // from TWorld::MObserver
       
   476 
       
   477     /**
       
   478      * @see TWorld::MObserver::WorldUpdatedL
       
   479      */
       
   480     virtual void WorldUpdatedL( const TWorld& aWorld );
       
   481 
       
   482 private:
       
   483 
       
   484     /**
       
   485      * Viewport cache class. Contains items from previous visible item query. On following
       
   486      * queries only changed items will be returned. For performance reasons array will contain
       
   487      * NULL items in slots that have not changed.
       
   488      */
       
   489     NONSHARABLE_CLASS( TCache )
       
   490         {
       
   491 
       
   492     public:
       
   493 
       
   494         /**
       
   495          * Constructor
       
   496          */
       
   497         TCache();
       
   498 
       
   499         /**
       
   500          * Destructor
       
   501          */
       
   502         ~TCache();
       
   503 
       
   504         /**
       
   505          * Clears cache
       
   506          */
       
   507         void Clear();
       
   508 
       
   509         /**
       
   510          * Check if the cache is clear.
       
   511          */
       
   512         TBool IsClear() const;
       
   513 
       
   514         /**
       
   515          * Check if the given item is in cache.
       
   516          */
       
   517         TBool ContainsItem( const TFsTreeItemId aItemId ) const;
       
   518 
       
   519         /**
       
   520          * Updates cache.
       
   521          */
       
   522         void UpdateL( const RArray<TFsTreeItemId>& aItems, RArray<TFsTreeItemId>& aItemsToBeRemoved, RArray<TFsTreeItemId>& aItemsToBeAdded, TBool& aFullUpdate );
       
   523 
       
   524         /**
       
   525          * Returns top most item from the cache.
       
   526          */
       
   527         TFsTreeItemId TopItem() const;
       
   528 
       
   529         /**
       
   530          * Returns bottom most item from the cache.
       
   531          */
       
   532         TFsTreeItemId BottomItem() const;
       
   533 
       
   534     private:
       
   535 
       
   536         // Cached items
       
   537         RArray<TFsTreeItemId> iCachedItems;
       
   538 
       
   539         // True if the cache is clear
       
   540         TBool iClear;
       
   541         };
       
   542 
       
   543 private:
       
   544 
       
   545     // Viewport observer
       
   546     MObserver& iObserver;
       
   547 
       
   548     // World to which this viewport is related to
       
   549     TWorld& iWorld;
       
   550 
       
   551     // Viewport position (topleft corner)
       
   552     TPoint iPosition;
       
   553 
       
   554     // Size of the viewport
       
   555     TSize iSize;
       
   556 
       
   557     // Viewport cache
       
   558     TCache iCache;
       
   559 
       
   560     // Wold index of the first item in Cache
       
   561     TInt iWorldIndex;
       
   562 
       
   563     };
       
   564 
       
   565 /**
       
   566  * Visualizer class for the hierarchical tree list.
       
   567  *
       
   568  * The tree visualizer is responsible for visualizing tree structure in a
       
   569  * hierarchical list form. It is responsible for updating the list view based
       
   570  * on events that come from the tree structure (through MFsTreeObserver
       
   571  * interface). For example refreshing the list view after an item was added to
       
   572  * the tree.
       
   573  *
       
   574  *  @code
       
   575  *
       
   576  *  @endcode
       
   577  *
       
   578  *  @lib
       
   579  */
       
   580 NONSHARABLE_CLASS( CFsTreeVisualizerBase ) : public CBase,
       
   581                                              public MFsTreeVisualizer,
       
   582                                              public MFsTreeObserver,
       
   583                                              public MFsFadeEffectObserver,
       
   584                                              public MFsSlideEffectObserver,
       
   585                                              public MAlfActionObserver,
       
   586                                              public MUiCScrollBar::MObserver,
       
   587                                              public TWorld::MObserver,
       
   588                                              public TViewPort::MObserver,
       
   589                                              public MAknPhysicsObserver
       
   590     {
       
   591 
       
   592 private:
       
   593 
       
   594     /**
       
   595      * Event types
       
   596      */
       
   597     enum TPointerEventType
       
   598         {
       
   599         EPointerDown = 0,
       
   600         ELongTap,
       
   601         EPointerUp
       
   602         };
       
   603 
       
   604 private:
       
   605 
       
   606     /**
       
   607      * Drag handler class for handling pointer event and drag.
       
   608      */
       
   609     NONSHARABLE_CLASS( CDragHandler ) : public CBase
       
   610         {
       
   611     private:
       
   612 
       
   613         /**
       
   614          * Drag handler's internal flags
       
   615          */
       
   616         enum TFlag {
       
   617 
       
   618             /**
       
   619              * Flicking mode on
       
   620              */
       
   621             EFlicking,
       
   622 
       
   623             /**
       
   624              * Pointer repeat was received
       
   625              */
       
   626             EWasRepeat,
       
   627 
       
   628             /**
       
   629              * Pointer down was received
       
   630              */
       
   631             EPointerDownReceived,
       
   632 
       
   633         };
       
   634 
       
   635         /**
       
   636          * Drag direction enumeration
       
   637          */
       
   638         enum TDragDirection {
       
   639             EDraggingNone,
       
   640 
       
   641             /**
       
   642              * Drag direction up
       
   643              */
       
   644             EDraggingUp,
       
   645 
       
   646             /**
       
   647              * Drag direction down
       
   648              */
       
   649             EDraggingDown
       
   650         };
       
   651 
       
   652     public:
       
   653         /**
       
   654          * Leave-safe constructor
       
   655          */
       
   656         static CDragHandler* NewL(CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout,
       
   657                 const TBitFlags& aFlags );
       
   658 
       
   659         /**
       
   660          * Destructor
       
   661          */
       
   662         ~CDragHandler();
       
   663 
       
   664         /**
       
   665          * Pointer down event handling
       
   666          */
       
   667         void PointerDown(const TPointerEvent& aEvent, const TFsTreeItemId aItemId);
       
   668 
       
   669         /**
       
   670          * Pointer repeat event handling
       
   671          */
       
   672         void PointerRepeat(const TPointerEvent& aEvent);
       
   673 
       
   674         /**
       
   675          * Pointer up event handling
       
   676          */
       
   677         void PointerUp(const TPointerEvent& aEvent, const TFsTreeItemId aItemId);
       
   678 
       
   679         /**
       
   680          * Pointer drag event handling
       
   681          */
       
   682         TPoint PointerDrag(const TPointerEvent& aEvent, const TFsTreeItemId aItemId);
       
   683 
       
   684         /**
       
   685          * Returns currect drag delta
       
   686          */
       
   687         TInt DragDelta(const TPointerEvent& aEvent) const;
       
   688 
       
   689         /**
       
   690          * Set flicking mode on
       
   691          */
       
   692         void EnableFlicking();
       
   693 
       
   694         /**
       
   695          * Test if flicking
       
   696          */
       
   697         TBool IsFlicking() const;
       
   698 
       
   699         /**
       
   700          * Reset state
       
   701          */
       
   702         void Reset();
       
   703 
       
   704         /**
       
   705          * Calculate drag direction from given arguments
       
   706          */
       
   707         TDragDirection DragDirection( const TPoint& aCurrent, const TPoint aPrevious ) const;
       
   708 
       
   709     private:
       
   710 
       
   711         /**
       
   712          * Private constructor
       
   713          */
       
   714         CDragHandler(CFsTreeVisualizerBase& aTree, const TInt aHighlightTimeout, const TBitFlags& aFlags);
       
   715 
       
   716         /**
       
   717          * Leave safe construct.
       
   718          */
       
   719         void ConstructL();
       
   720 
       
   721         /**
       
   722          * Timer callback.
       
   723          */
       
   724         static TInt HighlightTimerCallback(TAny* aPtr);
       
   725 
       
   726     private:
       
   727 
       
   728         CFsTreeVisualizerBase& iTree;
       
   729         TBitFlags iFlags;
       
   730         TTimeIntervalMicroSeconds32 iHighlightTimeout;
       
   731         CPeriodic* iHighlightTimer;
       
   732         TTime iStartTime;
       
   733         TPoint iPosition;
       
   734         TPoint iLastPointerPosition;
       
   735         TPoint iDrag;
       
   736         TFsTreeItemId iItemId;
       
   737         const TBitFlags& iTreeVisualizerFlags;
       
   738         TDragDirection iDragDirection;
       
   739         };
       
   740 
       
   741 
       
   742 public:
       
   743 
       
   744     enum TFsTreeVisualizerMove
       
   745         {
       
   746         EFsTreeVisualizerMoveLineUp,
       
   747         EFsTreeVisualizerMoveLineDown,
       
   748         EFsTreeVisualizerMovePageUp,
       
   749         EFsTreeVisualizerMovePageDown
       
   750         };
       
   751 
       
   752     enum TFsSelectorMovement
       
   753         {
       
   754         /**
       
   755          * The selector moves immediately between list's items.
       
   756          */
       
   757         EFsSelectorMoveImmediately,
       
   758 
       
   759         /**
       
   760          * The selector moves smoothly between list's items.
       
   761          */
       
   762         EFsSelectorMoveSmoothly
       
   763         };
       
   764 
       
   765 public: // Construction
       
   766 
       
   767     /**
       
   768      * Two-phased constructor
       
   769      *
       
   770      * @param aOwnerControl Owner control.
       
   771      * @param aParent Parent layout for all the new layouts constructed by
       
   772      *                this class.
       
   773      *
       
   774      * @return Pointer to the newly constructed object.
       
   775      */
       
   776     IMPORT_C static CFsTreeVisualizerBase* NewL( CAlfControl* aOwnerControl,
       
   777             CAlfLayout& aParent, const TBool aPopUpMode = EFalse );
       
   778 
       
   779     /**
       
   780      * C++ destructor
       
   781      */
       
   782     virtual ~CFsTreeVisualizerBase();
       
   783 
       
   784 public:
       
   785 
       
   786     /**
       
   787      * Sets data model for the visualizer.
       
   788      *
       
   789      * @param aTreeData Data model visualized by the tree visualizer.
       
   790      */
       
   791     void SetTreeData( CFsTree& aTreeData );
       
   792 
       
   793     /**
       
   794      * Adds custom key which triggers page-up event.
       
   795      *
       
   796      * @param aKey Key code.
       
   797      */
       
   798     virtual void AddCustomPageUpKey(TInt aKeyCode);
       
   799 
       
   800     /**
       
   801      * Removes given key code from custom page-up event key codes.
       
   802      *
       
   803      * @param aKey Key code.
       
   804      *
       
   805      * @return ETrue if the key code was removed.
       
   806      */
       
   807     virtual TBool RemoveCustomPageUpKey(TInt aKeyCode);
       
   808 
       
   809     /**
       
   810      * Checks whether given key is a custom key for page-up event.
       
   811      *
       
   812      * @param aKey Key code.
       
   813      *
       
   814      * @return ETrue if the given key code triggers page-up event.
       
   815      */
       
   816     virtual TBool IsCustomPageUpKey(TInt aKeyCode);
       
   817 
       
   818     /**
       
   819      * Adds custom key which triggers page-down event.
       
   820      *
       
   821      * @param aKey Key code.
       
   822      */
       
   823     virtual void AddCustomPageDownKey(TInt aKeyCode);
       
   824 
       
   825     /**
       
   826      * Removes given key code from custom page-down event key codes.
       
   827      *
       
   828      * @param aKey Key code.
       
   829      *
       
   830      * @return ETrue if the key code was removed.
       
   831      */
       
   832     virtual TBool RemoveCustomPageDownKey(TInt aKeyCode);
       
   833 
       
   834     /**
       
   835      * Checks whether given key is a custom key for page-down event.
       
   836      *
       
   837      * @param aKey Key code.
       
   838      *
       
   839      * @return ETrue if the given key code triggers page-down event.
       
   840      */
       
   841     virtual TBool IsCustomPageDownKey(TInt aKeyCode);
       
   842 
       
   843     /**
       
   844      * Sets icon for a mark sign.
       
   845      *
       
   846      * @param aMarkIcon Icon to mark items.
       
   847      */
       
   848     virtual void SetMarkIcon( CAlfTexture& aMarkIcon );
       
   849 
       
   850     /**
       
   851      * Returns icon used to mark items.
       
   852      */
       
   853     virtual CAlfTexture* MarkIcon( );
       
   854 
       
   855     /**
       
   856      * Checks if item is marked and return status
       
   857      * @param aItemId item id to be checked
       
   858      */
       
   859     virtual TBool IsMarked( const TFsTreeItemId aItemId ) const;
       
   860 
       
   861     /**
       
   862      * Sets status of the item to be marked/unmarked
       
   863      * @param aItemId item id which of the mark/unmark status will be set
       
   864      * @param aMarked Marked/Unmarked status
       
   865      */
       
   866     virtual void MarkItemL( const TFsTreeItemId aItemId, TBool aMarked );
       
   867 
       
   868     /**
       
   869      * Returns list of marked items
       
   870      * @param aMarkedItems list to which the id's of marked items will be
       
   871      *                     added
       
   872      */
       
   873     virtual void GetMarkedItemsL( RFsTreeItemIdList& aMarkedItems ) const;
       
   874 
       
   875     /**
       
   876      * Function marks/unmarks all items in the list.
       
   877      *
       
   878      * @param aMarkAll ETrue to mark all items, EFalse to unmark.
       
   879      */
       
   880     virtual void MarkAllItemsL( TBool aMarkAll );
       
   881 
       
   882     /**
       
   883      * Sets item indentation per hierarchy level.
       
   884      *
       
   885      * @param aIndentation Indentation in pixels
       
   886      */
       
   887     virtual void SetIndentationL( TInt aIndentation );
       
   888 
       
   889     /**
       
   890      * Returns indentation per hierarchy level in pixels.
       
   891      *
       
   892      * @return Indentation per hierarchy level in pixels.
       
   893      */
       
   894     virtual TInt Indentation() const;
       
   895 
       
   896     /**
       
   897      * Sets icon for a menu sign.
       
   898      *
       
   899      * @param aMenuIcon Menu icon.
       
   900      */
       
   901     virtual void SetMenuIcon( CAlfTexture& aMenuIcon );
       
   902 
       
   903     /**
       
   904      * Returns menu icon.
       
   905      */
       
   906     virtual CAlfTexture* MenuIcon( ) const;
       
   907 
       
   908     /**
       
   909      * Update flip state
       
   910      * @param aOpen ETrue if flip is open
       
   911      */
       
   912     virtual void SetFlipState( TBool aOpen );
       
   913 
       
   914     /**
       
   915      * Update focus visibility state
       
   916      * @param aShow ETrue if the focus should be shown
       
   917      */
       
   918     virtual void SetFocusVisibility( TBool aShow );
       
   919 
       
   920     /**
       
   921      * Used internally by the list. To make the list focused/not focused use
       
   922      * CFsTreeList::SetFocusedL() instead.
       
   923      */
       
   924     void SetFocusedL( const TBool aFocused );
       
   925 
       
   926     /**
       
   927      *
       
   928      * @param aTexture A custom texture for the selector.
       
   929      *                 The texture is used to create an image brush.
       
   930      *                 Ownership is not transferred.
       
   931      *                 If the parameter is NULL, the selector is taken from
       
   932      *                 the s60 skin.
       
   933      *
       
   934      * @param aMovementType Defines the way the selector moves between items.
       
   935      *                      Currently only EFsSelectorMoveImmediately is
       
   936      *                      supported.
       
   937      * @param aLeftBorderWidth Left border value.
       
   938      *                         Positive values extend the image border and
       
   939      *                         negative values decrease the visual area.
       
   940      *                         Zero values - draw without border.
       
   941      * @param aRightBorderWidth Right border value.
       
   942      *                          Positive values extend the image border and
       
   943      *                          negative values decrease the visual area.
       
   944      *                          Zero values - draw without border.
       
   945      * @param aTopBorderHeight Top border value.
       
   946      *                         Positive values extend the image border and
       
   947      *                         negative values decrease the visual area.
       
   948      *                         Zero values - draw without border.
       
   949      * @param aBottomBorderHeight Bottom border value.
       
   950      *                            Positive values extend the image border and
       
   951      *                            negative values decrease the visual area.
       
   952      *                            Zero values - draw without border.
       
   953      */
       
   954     virtual void SetSelectorPropertiesL ( CAlfTexture* aTexture = NULL,
       
   955                                           TFsSelectorMovement aMovementType =
       
   956                                                   EFsSelectorMoveImmediately,
       
   957                                           TInt aLeftBorderWidth = 0,
       
   958                                           TInt aRightBorderWidth = 0,
       
   959                                           TInt aTopBorderHeight = 0,
       
   960                                           TInt aBottomBorderHeight = 0 );
       
   961 
       
   962     /**
       
   963      * Set some of the selector's properties.
       
   964      *
       
   965      * @param aSelectorBrush A custom brush for selector's visual.
       
   966      *                       Ownership is not transferred.
       
   967      *                       If the parameter is NULL, the selector is taken
       
   968      *                       from the s60 skin.
       
   969      *
       
   970      * @param aMovementType Defines the way the selector moves between items.
       
   971      *                      Currently only EFsSelectorMoveImmediately is
       
   972      *                      supported.
       
   973      *
       
   974      * @param aOpacity Opacity for the selector visual.
       
   975      *
       
   976      */
       
   977     virtual void SetSelectorPropertiesL ( CAlfBrush* aSelectorBrush,
       
   978                 TReal32 aOpacity = 1.0,
       
   979                 TFsSelectorMovement aMovementType = EFsSelectorMoveImmediately );
       
   980 
       
   981 
       
   982     /**
       
   983      * The function returns selector's properties.
       
   984      */
       
   985     virtual void GetSelectorProperties ( CAlfTexture*& aTexture,
       
   986                                          TFsSelectorMovement& aMovementType,
       
   987                                          TInt& aLeftBorderWidth,
       
   988                                          TInt& aRightBorderWidth,
       
   989                                          TInt& aTopBorderHeight,
       
   990                                          TInt& aBottomBorderHeight );
       
   991 
       
   992     // from base class MFsTreeVisualizer
       
   993 
       
   994     /**
       
   995      * @see MFsTreeVisualizer::HandleKeyEventL
       
   996      */
       
   997     virtual TBool HandleKeyEventL(const TAlfEvent& aEvent);
       
   998 
       
   999     /**
       
  1000      * @see MFsTreeVisualizer::HandlePointerEventL
       
  1001      */
       
  1002     virtual TBool  HandlePointerEventL( const TAlfEvent& aEvent );
       
  1003 
       
  1004 
       
  1005     /**
       
  1006      * Sets the specified item as focused.
       
  1007      *
       
  1008      * @param aItem indicates item to be focused.
       
  1009      *
       
  1010      * @panic EFsListPanicInvalidItemID Item with specified ID is not found.
       
  1011      */
       
  1012     // <cmail>
       
  1013     virtual void SetFocusedItemL( const TFsTreeItemId aItem, TBool aCheckFocus = ETrue );
       
  1014     // </cmail>
       
  1015 
       
  1016     /**
       
  1017     * Gets item vertical position in the list
       
  1018     *
       
  1019     * @param aIdx indicates item index
       
  1020     */
       
  1021     virtual TInt GetItemWorldPosition( const TInt aIdx );
       
  1022 
       
  1023     /**
       
  1024      * Returns item id of the currently focused item.
       
  1025      *
       
  1026      * @return Id of the focused item.
       
  1027      */
       
  1028     virtual TFsTreeItemId FocusedItem() const;
       
  1029 
       
  1030     /**
       
  1031      * Checks if the specified item is focused.
       
  1032      *
       
  1033      * @param aItem Item to be checked.
       
  1034      *
       
  1035      * @return ETrue If item is focused. EFalse if item is not focused or
       
  1036      *         item does not exist in the tree.
       
  1037      */
       
  1038     virtual TBool IsFocused( const TFsTreeItemId aItemId ) const;
       
  1039 
       
  1040     /**
       
  1041      * Sets an item as first visible one in the list.
       
  1042      *
       
  1043      * @param aItemId Id of an item that will be displayed as first.
       
  1044      */
       
  1045     // <cmail>
       
  1046     virtual void SetFirstVisibleItemL( const TFsTreeItemId aItemId );
       
  1047     // </cmail>
       
  1048 
       
  1049     /**
       
  1050      * Get an id of the first visible item.
       
  1051      *
       
  1052      * @return Id of the first visible item.
       
  1053      */
       
  1054     virtual TFsTreeItemId FirstVisibleItem();
       
  1055 
       
  1056     /**
       
  1057      * Gets a pointer to the root's item data object.
       
  1058      *
       
  1059      * @return Pointer to the root's item data object.
       
  1060      */
       
  1061     MFsTreeItemData* RootItemData();
       
  1062 
       
  1063     /**
       
  1064      * Gets a pointer to the root's item visualizer object.
       
  1065      *
       
  1066      * @return Pointer to the root's item visualizer object.
       
  1067      */
       
  1068     MFsTreeNodeVisualizer* RootNodeVisualizer();
       
  1069 
       
  1070     /**
       
  1071      * Displays the list.
       
  1072      *
       
  1073      * @param aFadeIn Defines if list visual should or shouldn't fade in to
       
  1074      *                the screen.
       
  1075      * @param aSlideIn ETrue if slide in effect should be used, EFalse if not.
       
  1076      */
       
  1077     virtual void ShowListL( const TBool aFadeIn = EFalse,
       
  1078                             const TBool aSlideIn = EFalse );
       
  1079 
       
  1080     /**
       
  1081      * Hides the list.
       
  1082      *
       
  1083      * @param aFadeOut Defines if list visual should or shouldn't fade out
       
  1084      *                 from the screen.
       
  1085      * @param aSlideOut ETrue if slide out effect should be used,EFalse if not
       
  1086      */
       
  1087     virtual void HideList( const TBool aFadeOut = EFalse,
       
  1088                            const TBool aSlideOut = EFalse );
       
  1089 
       
  1090     /**
       
  1091      * The function sets duration of the slide-in effect.
       
  1092      *
       
  1093      * @param aTimeMiliseconds Slide in time in milliseconds.
       
  1094      */
       
  1095     virtual void SetSlideInDuration ( TInt aTimeMiliseconds );
       
  1096 
       
  1097     /**
       
  1098      * The function returns slide in effect's duration.
       
  1099      *
       
  1100      * @return Slide in duration in miliseconds.
       
  1101      */
       
  1102     virtual TInt SlideInDuration ( ) const;
       
  1103 
       
  1104     /**
       
  1105      * The function sets direction of the slide in effect.
       
  1106      *
       
  1107      * @param aDirection A direction of the slide in effect.
       
  1108      */
       
  1109     virtual void SetSlideInDirection ( TFsSlideEffect aDirection );
       
  1110 
       
  1111     /**
       
  1112      * The function returns direction of the slide in effect.
       
  1113      *
       
  1114      * @return A direction of the slide in effect.
       
  1115      */
       
  1116     virtual MFsTreeVisualizer::TFsSlideEffect SlideInDirection ( ) const;
       
  1117 
       
  1118     /**
       
  1119      * The function sets duration of the slide-out effect.
       
  1120      *
       
  1121      * @param aTimeMiliseconds Slide out time in milliseconds.
       
  1122      */
       
  1123     virtual void SetSlideOutDuration ( TInt aTimeMiliseconds );
       
  1124 
       
  1125     /**
       
  1126      * The function returns slide out effect's duration.
       
  1127      *
       
  1128      * @return Slide out duration in miliseconds.
       
  1129      */
       
  1130     virtual TInt SlideOutDuration ( ) const;
       
  1131 
       
  1132     /**
       
  1133      * The function sets direction of the slide out effect.
       
  1134      *
       
  1135      * @param aDirection A direction of the slide out effect.
       
  1136      */
       
  1137     virtual void SetSlideOutDirection ( TFsSlideEffect aDirection );
       
  1138 
       
  1139     /**
       
  1140      * The function returns direction of the slide out effect.
       
  1141      *
       
  1142      * @return A direction of the slide out effect.
       
  1143      */
       
  1144     virtual MFsTreeVisualizer::TFsSlideEffect SlideOutDirection ( ) const;
       
  1145 
       
  1146     /**
       
  1147      * Returns information about looping type of the list.
       
  1148      *
       
  1149      * @return Type of list looping. EFsTreeListLoopingDisabled when looping
       
  1150      *         is turned off.
       
  1151      */
       
  1152     virtual TFsTreeListLoopingType LoopingType() const;
       
  1153 
       
  1154     /**
       
  1155      * Sets type of list's looping.
       
  1156      *
       
  1157      * @param aLoopingType type of list looping.
       
  1158      */
       
  1159     virtual void SetLoopingType( const TFsTreeListLoopingType aLoopingType );
       
  1160 
       
  1161     /**
       
  1162      * Sets the delay for the item expansion animation.
       
  1163      *
       
  1164      * @param aDelay Delay in miliseconds.
       
  1165      */
       
  1166     virtual void SetItemExpansionDelay( const TInt aDelay );
       
  1167 
       
  1168     /**
       
  1169      *
       
  1170      */
       
  1171     virtual void SetItemSeparatorColor( const TRgb& aColor );
       
  1172 
       
  1173     /**
       
  1174      * The functions sets fade-in's effect duration.
       
  1175      * @param aFadeTime A time in miliseconds for fade in effect.
       
  1176      */
       
  1177     virtual void SetFadeInEffectTime( TInt aFadeTime );
       
  1178 
       
  1179     /**
       
  1180      * Get the current parent layout of tree visualizer.
       
  1181      *
       
  1182      * @return Tree visualizer's current parent layout.
       
  1183      */
       
  1184     CAlfLayout& ParentLayout() const;
       
  1185 
       
  1186     /**
       
  1187      * The functions sets fade's effect duration.
       
  1188      *
       
  1189      * @param aFadeTime A time in miliseconds for fade in/out effect.
       
  1190      */
       
  1191     virtual TInt FadeInEffectTime( );
       
  1192 
       
  1193     /**
       
  1194      * The functions sets fade-out's effect duration.
       
  1195      * @param aFadeTime A time in miliseconds for fade-out effect.
       
  1196      */
       
  1197     virtual void SetFadeOutEffectTime( TInt aFadeTime );
       
  1198 
       
  1199     /**
       
  1200      * The functions returns fade's effect duration.
       
  1201      *
       
  1202      * @return A time in miliseconds for fade in/out effect.
       
  1203      */
       
  1204     virtual TInt FadeOutEffectTime( );
       
  1205 
       
  1206     /**
       
  1207      * Set the item separator size (item border).
       
  1208      *
       
  1209      * @param aSize
       
  1210      */
       
  1211     virtual void SetItemSeparatorSize( const TSize aSize );
       
  1212 
       
  1213     /**
       
  1214      * Sets item border's thickness. To have one pixel border between items in
       
  1215      * the list pass TAlfTimedPoint(0.0f, 0.5f) as a parameter.
       
  1216      *
       
  1217      * @param aThickness Thickness of the border.
       
  1218      */
       
  1219     virtual void SetItemSeparatorSize( const TAlfTimedPoint& aThickness );
       
  1220 
       
  1221     /**
       
  1222      * Function sets the time of list scroll per item and the scroll
       
  1223      * acceleration rate.
       
  1224      *
       
  1225      * @param aScrollTime Time (in miliseconds) at which the list items are
       
  1226      *                    scrolled.
       
  1227      * @param aScrollAcceleration Rate of scroll acceleration when the up/down
       
  1228      *                            key is pressed for a long time. This is
       
  1229      *                            multiplied by the number of up/down key
       
  1230      *                            repeats. Acceleration rate should be in
       
  1231      *                            0.0-1.0 range.
       
  1232      */
       
  1233     virtual void SetScrollTime ( TInt aScrollTime,
       
  1234                                  TReal aScrollAcceleration = 0.0 );
       
  1235 
       
  1236     /**
       
  1237      * Gets the delay for the item expansion animation.
       
  1238      *
       
  1239      * @return Delay in miliseconds.
       
  1240      */
       
  1241     virtual TInt ItemExpansionDelay( ) const;
       
  1242 
       
  1243     /**
       
  1244      * Function gets the values of scroll speed and its acceleration rate.
       
  1245      *
       
  1246      * @param aScrollTime Time (in miliseconds) at which the list items are
       
  1247      *                    scrolled.
       
  1248      *
       
  1249      * @param aScrollAcceleration Rate of scroll acceleration when the up/down
       
  1250      *                            key is pressed for a long time.
       
  1251      */
       
  1252     virtual void GetScrollTime(TInt& aScrollTime, TReal& aScrollAcceleration);
       
  1253 
       
  1254     /**
       
  1255      * Expands node, causes list refresh.
       
  1256      *
       
  1257      * @param aNodeId Id of the node to be expanded.
       
  1258      */
       
  1259     virtual void ExpandNodeL( const TFsTreeItemId aNodeId );
       
  1260 
       
  1261     /**
       
  1262      * Collapses node, causes list refresh.
       
  1263      *
       
  1264      * @param aNodeId Id of the node to be collapseded.
       
  1265      */
       
  1266     virtual void CollapseNodeL( const TFsTreeItemId aNodeId );
       
  1267 
       
  1268     /**
       
  1269      * Expands all nodes in the list, causes list refresh.
       
  1270      */
       
  1271     virtual void ExpandAllL( );
       
  1272 
       
  1273     /**
       
  1274      * Collapses all nodes in the list, causes list refresh.
       
  1275      */
       
  1276     virtual void CollapseAllL( );
       
  1277 
       
  1278     /**
       
  1279      * Updates item, if visible.
       
  1280      *
       
  1281      * @param aItemId Id of the item to be refreshed.
       
  1282      */
       
  1283     virtual void UpdateItemL( const TFsTreeItemId aItemId );
       
  1284 
       
  1285     /**
       
  1286      * The functions sets wether all item in the list should be always in
       
  1287      * extended state or in normal state.
       
  1288      * The function refreshes the list view.
       
  1289      *
       
  1290      * @param aAlwaysExtended ETrue if items should be always extended. EFalse
       
  1291      *                        if items should be in normal state.
       
  1292      */
       
  1293     virtual void SetItemsAlwaysExtendedL ( TBool aAlwaysExtended );
       
  1294 
       
  1295     /*
       
  1296      * The function returns if items are always in extended state or in normal
       
  1297      *
       
  1298      * @return ETrue if items are always in extended state, EFalse if items
       
  1299      *         are in normal state.
       
  1300      */
       
  1301     virtual TBool IsItemsAlwaysExtended ( );
       
  1302 
       
  1303     /**
       
  1304      * The function sets a text for empty list's view.
       
  1305      * The function does not refresh the view automatically.
       
  1306      *
       
  1307      * @param aText Text to be displayed.
       
  1308      */
       
  1309     virtual void SetEmptyListTextL( const TDesC& aText );
       
  1310 
       
  1311     /**
       
  1312      * The function returns a text for empty list's view.
       
  1313      *
       
  1314      * @return Text displayed when a list is empty.
       
  1315      */
       
  1316     virtual TDesC& GetEmptyListText( ) const;
       
  1317 
       
  1318     /**
       
  1319      * Sets the background texture, clears the background color.
       
  1320      *
       
  1321      * @param aBgTexture Texture to be set as list background.
       
  1322      */
       
  1323     IMPORT_C void SetBackgroundTextureL( CAlfTexture& aBgTexture );
       
  1324 
       
  1325     /**
       
  1326      * Sets the background color, clears the background texture.
       
  1327      *
       
  1328      * @param aBgTexture Texture to be set as list background.
       
  1329      */
       
  1330     IMPORT_C void SetBackgroundColorL( TRgb aColor );
       
  1331 
       
  1332 
       
  1333     /**
       
  1334      * Sets a given brush as a list background.
       
  1335      *
       
  1336      * @param aBrush Brush to be used as background.
       
  1337      */
       
  1338     IMPORT_C void SetBackgroundBrushL( CAlfBrush* aBrush );
       
  1339 
       
  1340     /**
       
  1341      * The function clears list's background.
       
  1342      */
       
  1343     IMPORT_C void ClearBackground();
       
  1344 
       
  1345     /**
       
  1346      * Sets watermark position.
       
  1347      *
       
  1348      * @param aPosition New position for the watermark.
       
  1349      */
       
  1350     IMPORT_C void SetWatermarkPos( const TPoint& aPosition );
       
  1351 
       
  1352     /**
       
  1353      * Sets watermark size.
       
  1354      *
       
  1355      * @param aSize New size for the watermark.
       
  1356      */
       
  1357     IMPORT_C void SetWatermarkSize( const TSize& aSize );
       
  1358 
       
  1359     /**
       
  1360      * Sets watermark opacity.
       
  1361      * If new opacity is equal to 0 then watermark is fully transparent,
       
  1362      * if it is equal to 1 then watermark is not transparent at all.
       
  1363      *
       
  1364      * @param aOpacity New opacity for the watermark.
       
  1365      */
       
  1366     IMPORT_C void SetWatermarkOpacity( const float aOpacity );
       
  1367 
       
  1368     /**
       
  1369      * Sets watermark texture.
       
  1370      * Pass NULL as a parameter to disable watermark.
       
  1371      *
       
  1372      * @param aTexture New texture for the watermark.
       
  1373      */
       
  1374     IMPORT_C void SetWatermarkL( CAlfTexture* aTexture );
       
  1375 
       
  1376     // from base class MFsTreeObserver
       
  1377 
       
  1378     /**
       
  1379      *
       
  1380      */
       
  1381     virtual void TreeEventL( const TFsTreeEvent aEvent,
       
  1382             const MFsTreeObserver::TFsTreeEventParams& aParams );
       
  1383 
       
  1384     /**
       
  1385      * Sets vertical scrollbar visibility status.
       
  1386      *
       
  1387      * @param aSetOn Visibility status for the scrollbar
       
  1388      */
       
  1389     virtual void SetScrollBarVisibilityL(const TFsScrollbarVisibility aVisibility);
       
  1390 
       
  1391     /**
       
  1392      * Gets vertical scrollbar visibility status.
       
  1393      *
       
  1394      * @return Visibility status for the scrollbar
       
  1395      */
       
  1396     virtual TFsScrollbarVisibility ScrollbarVisibility() const;
       
  1397 
       
  1398     /**
       
  1399      * Old API to be removed. Sets vertical scrollbar visibility status.
       
  1400      *
       
  1401      * @param aSetOn Visibility status for the scrollbar
       
  1402      */
       
  1403     virtual void SetVScrollBarL( const TBool aSetOn );
       
  1404 
       
  1405 
       
  1406     /**
       
  1407      * Sets border status.
       
  1408      *
       
  1409      * @param aVisible Visibility status of border
       
  1410      * @param aBorderTexture pointer to texture to be set for border
       
  1411      */
       
  1412     virtual void SetBorderL( const TBool aVisible,
       
  1413         CAlfTexture* aBorderTexture = 0 );
       
  1414 
       
  1415     /**
       
  1416      * Sets shadow status.
       
  1417      *
       
  1418      * @param aVisible Visibility status of shadow
       
  1419      */
       
  1420     virtual void SetShadowL( const TBool aVisible );
       
  1421 
       
  1422     /**
       
  1423      * Sets visualizer observer.
       
  1424      *
       
  1425      * @param aObserver Sets new tree visualizer observer.
       
  1426      */
       
  1427     void SetVisualizerObserver( MFsTreeVisualizerObserver* aObserver );
       
  1428 
       
  1429     /**
       
  1430      * Function which refreshes list display.
       
  1431      */
       
  1432     virtual void RefreshListViewL();
       
  1433 
       
  1434     /**
       
  1435      * Hide item.
       
  1436      *
       
  1437      * @param aItemId Id of the item to be hidden.
       
  1438      */
       
  1439     virtual void HideItemL(const TFsTreeItemId aItemId);
       
  1440 
       
  1441     /**
       
  1442      * Unhide item.
       
  1443      *
       
  1444      * @param aItemId Id of the item to be shown.
       
  1445      */
       
  1446     virtual void UnhideItemL(const TFsTreeItemId aItemId);
       
  1447 
       
  1448     /**
       
  1449      *
       
  1450      */
       
  1451     virtual void SetPadding( const TAlfBoxMetric& aPadding );
       
  1452 
       
  1453     /**
       
  1454      * List pane's padding taken from Layout Manager or switched off.
       
  1455      */
       
  1456     void EnableListPanePadding( TBool aEnable );
       
  1457 
       
  1458     /**
       
  1459      * Sets the type of text marquee.
       
  1460      *
       
  1461      * @param aMarquee Type of marquee.
       
  1462      */
       
  1463     virtual void SetTextMarqueeType(const TFsTextMarqueeType aMarquee);
       
  1464 
       
  1465     /**
       
  1466      * Returns the type of text marquee.
       
  1467      *
       
  1468      * @return Type of marquee.
       
  1469      */
       
  1470     virtual TFsTextMarqueeType TextMarqueeType() const;
       
  1471 
       
  1472     /**
       
  1473      * Sets the speed of marquee.
       
  1474      *
       
  1475      * @param aPixelsPerSec How many pixels per second.
       
  1476      */
       
  1477     virtual void SetTextMarqueeSpeed ( const TInt aPixelsPerSec );
       
  1478 
       
  1479     /**
       
  1480      * Returns the speed of marquee.
       
  1481      *
       
  1482      * @return How many pixels per second.
       
  1483      */
       
  1484     virtual TInt TextMarqueeSpeed ( ) const;
       
  1485 
       
  1486     /**
       
  1487      * Sets delay for text marquee start.
       
  1488      *
       
  1489      * @param aStartDelay Time after which the text marquee starts (in miliseconds).
       
  1490      */
       
  1491     virtual void SetTextMarqueeStartDelay ( const TInt aStartDelay );
       
  1492 
       
  1493     /**
       
  1494      * Returns delay for text marquee.
       
  1495      *
       
  1496      * @return Time after which the text marquee starts (in miliseconds).
       
  1497      */
       
  1498     virtual TInt TextMarqueeStartDelay () const;
       
  1499 
       
  1500     /**
       
  1501      * Sets a delay for each cycle start.
       
  1502      *
       
  1503      * @param aCycleStartDelay Time after which the text marquee cycle starts (in miliseconds).
       
  1504      */
       
  1505     void SetTextMarqueeCycleStartDelay ( const TInt aCycleStartDelay );
       
  1506 
       
  1507     /**
       
  1508      * Returns a delay for each cycle start.
       
  1509      *
       
  1510      * @return Time after which the text marquee cycle starts (in miliseconds).
       
  1511      */
       
  1512     TInt TextMarqueeCycleStartDelay () const;
       
  1513 
       
  1514     /**
       
  1515      * Sets number of marquee cycles.
       
  1516      *
       
  1517      * @param aRepetitions Number of marquee cycles. Negetive values - infinite loop.
       
  1518      */
       
  1519     virtual void SetTextMarqueeRepetitions ( const TInt aMarqueeRepetitions );
       
  1520 
       
  1521     /**
       
  1522      * Returns number of marquee cycles.
       
  1523      *
       
  1524      * @return Number of marquee cycles. Negetive values - infinite loop.
       
  1525      */
       
  1526     virtual TInt TextMarqueeRepetitions ( ) const;
       
  1527 
       
  1528     /**
       
  1529       * Returns the items's target bounding rectangle in display coordinates if the item is visible.
       
  1530       * Display coordinates are defined relative to the display's visible area.
       
  1531       *
       
  1532       * @param aItemId Item's ID.
       
  1533       * @param aRect Out parameter. If successfull, contains item's rectangle.
       
  1534       * @return KErrNone if successfull,
       
  1535       *         KErrNotFound 1. the list does not contain item with given ID.
       
  1536       *                      2. item is not visible
       
  1537       */
       
  1538      virtual TInt GetItemDisplayRectTarget ( const TFsTreeItemId aItemId, TAlfRealRect& aRect );
       
  1539 
       
  1540      /**
       
  1541       * Internall to TreeList. Do not use directly.
       
  1542       *
       
  1543       * Used to block update during addition of many items/nodes. Currently only
       
  1544       * scrollbar is blocked from beign updated.
       
  1545       * @param aDoRefresh ETrue
       
  1546       */
       
  1547      virtual void SetAutoRefreshAtInsert(  TBool aAllowRefresh );
       
  1548 
       
  1549      /**
       
  1550        * Internall to TreeList. Do not use directly.
       
  1551        *
       
  1552        * Used to block update during addition of many items/nodes. Currently only
       
  1553        * scrollbar is blocked from beign updated.
       
  1554        * @return Auto update of scrollbar On/off
       
  1555        */
       
  1556      virtual TBool IsAutoRefreshAtInsert();
       
  1557 
       
  1558      /**
       
  1559        * Internall to TreeList. Do not use directly.
       
  1560        *
       
  1561        * Used to enable direct touch mode for the list.
       
  1562        */
       
  1563      void SetDirectTouchMode( const TBool aDirectTouchMode );
       
  1564 
       
  1565     /**
       
  1566      * Sets whether a long tap on a node should invoke expand/collapse all
       
  1567      * functionality.
       
  1568      *
       
  1569      * @param aExpandCollapse ETrue if long tap should expand/collapse all,
       
  1570      *                        EFalse if no action should be taken.
       
  1571      */
       
  1572     virtual void SetExpandCollapseAllOnLongTap ( TBool aExpandCollapse );
       
  1573 
       
  1574     /*
       
  1575      * The function returns if long tapping on a node results in
       
  1576      * expand/collapse all.
       
  1577      *
       
  1578      * @return ETrue if items are always in extended state, EFalse if items
       
  1579      *         are in normal state.
       
  1580      */
       
  1581     virtual TBool IsExpandCollapseAllOnLongTap ( );
       
  1582 
       
  1583     /**
       
  1584      * Function shows selector or hides it.
       
  1585      *
       
  1586      * @param aVisible ETrue to make selector visible, EFalse to hide
       
  1587      *                 selector.
       
  1588      */
       
  1589     IMPORT_C void MakeSelectorVisibleL( TBool aVisible );
       
  1590 
       
  1591     /**
       
  1592      * Function shows selector or hides it.
       
  1593      *
       
  1594      * @aDelay for changing the opacity
       
  1595      * @param aVisible ETrue to make selector visible, EFalse to hide
       
  1596      *                 selector.
       
  1597      */
       
  1598     void MakeSelectorVisibleL( TBool aVisible, TInt aDelay );
       
  1599 
       
  1600 public: //From MFsFadeEffectObserver
       
  1601 
       
  1602     /**
       
  1603      * From MFsFadeEffectObserver
       
  1604      * Function which will receive notifications about fade effect state changes.
       
  1605      */
       
  1606     virtual void FadeEffectEvent(MFsFadeEffectObserver::TFadeEffectState aState);
       
  1607 
       
  1608 public: //From MFsSlideEffectObserver
       
  1609 
       
  1610     /**
       
  1611      * From MFsSlideEffectObserver
       
  1612      * Function which will receive notifications about slide effect state changes.
       
  1613      * @param aState Current state of slide affect
       
  1614      */
       
  1615     virtual void SlideEffectEvent(MFsSlideEffectObserver::TSlideEffectState aState);
       
  1616 
       
  1617 public: //From MAlfActionObserver
       
  1618 
       
  1619     /**
       
  1620      * Called by the server when an action command is executed.
       
  1621      *
       
  1622      * @param aActionCommand  The command that is being executed.
       
  1623      */
       
  1624     virtual void HandleActionL(const TAlfActionCommand& aActionCommand);
       
  1625 
       
  1626 public:
       
  1627 
       
  1628     /**
       
  1629      * @see MUiCScrollBar::MObserver::HandleScrollEventL
       
  1630      */
       
  1631     void HandleScrollEventL( const MUiCScrollBar& aScrollBar,
       
  1632             MUiCScrollBar::TEvent aEvent );
       
  1633 
       
  1634     /**
       
  1635       *
       
  1636       */
       
  1637     void NotifyControlVisibilityChange( TBool aIsVisible );
       
  1638 
       
  1639     /**
       
  1640      * Disables kinetic scrolling (Drag events will not scroll the list).
       
  1641      *
       
  1642      * @param aDisable ETrue if kinetic scrolling should be disabled.
       
  1643      */
       
  1644     void DisableKineticScrolling( TBool aDisable );
       
  1645 
       
  1646     /**
       
  1647      * Returns status of kinetic scrolling.
       
  1648      *
       
  1649      * @return ETrue if kinetic scrolling is disabled.
       
  1650      */
       
  1651     TBool IsKineticScrollingDisabled() const;
       
  1652 
       
  1653     /**
       
  1654     * Returns viewPort top-left position
       
  1655     */
       
  1656     virtual TPoint ViewPortTopPosition() const;
       
  1657 
       
  1658 public: // from MAknPhysicsObserver
       
  1659 
       
  1660    /**
       
  1661     * @see MAknPhysicsObserver::ViewPositionChanged
       
  1662     */
       
  1663    virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow = ETrue, TUint aFlags = 0 );
       
  1664 
       
  1665    /**
       
  1666     * @see MAknPhysicsObserver::PhysicEmulationEnded
       
  1667     */
       
  1668    virtual void PhysicEmulationEnded();
       
  1669 
       
  1670    /**
       
  1671     * @see MAknPhysicsObserver::ViewPosition
       
  1672     */
       
  1673    virtual TPoint ViewPosition() const;
       
  1674 
       
  1675 private:
       
  1676 
       
  1677     /**
       
  1678      * Hides off-screen list items, or clears the whole list.
       
  1679      *
       
  1680      * @param aRemoveAll ETrue if destroy all item visualizers, EFalse if
       
  1681      *          destroy only off-screen visualizers
       
  1682      */
       
  1683     void ClearVisibleItemsListL( TBool aRemoveAll = ETrue,
       
  1684             TBool aScrollList = ETrue );
       
  1685 
       
  1686     /**
       
  1687      * Returns id of tree item if pointer event has hit the area.
       
  1688      * If item cannot be located KErrNotFound will be returned.
       
  1689      *
       
  1690      * @param aEvent Pointer event to investigate.
       
  1691      * @return TFsTreeItemId of item.
       
  1692      */
       
  1693     TFsTreeItemId EventItemId( const TAlfEvent& aEvent ) const;
       
  1694 
       
  1695     TFsTreeItemId VisualItemId( const CAlfVisual* aVisual ) const;
       
  1696 
       
  1697     const CAlfVisual* FindVisualUnderDrag( const TPoint& aPosition ) const;
       
  1698 
       
  1699     /**
       
  1700      * Moves focus visual from one item to another.
       
  1701      *
       
  1702      * @param aPrevious Id of the previously focused item.
       
  1703      */
       
  1704     void ChangeFocusL( const TFsTreeItemId aPrevious = KFsTreeNoneID );
       
  1705 
       
  1706     /**
       
  1707      * Move focus in the list.
       
  1708      *
       
  1709      * @param aMoveType Type of a move, down, up, page down, page up.
       
  1710      */
       
  1711     void MoveSelectionL(const TFsTreeVisualizerMove aMoveType);
       
  1712 
       
  1713     /**
       
  1714      * Moves focus by one item in the upper direction.
       
  1715      *
       
  1716      * @param aChangeFocus tells whether the selector should be updated or not
       
  1717      *
       
  1718      * @return Height of items that were traversed
       
  1719      */
       
  1720     TInt MoveSelectionByLineUpL(const TBool aChangeFocus = ETrue);
       
  1721 
       
  1722     /**
       
  1723      * Moves focus by one item in the lower direction.
       
  1724      *
       
  1725      * @param aChangeFocus tells whether the selector should be updated or not
       
  1726      *
       
  1727      * @return Height of items that were traversed
       
  1728      */
       
  1729     TInt MoveSelectionByLineDownL(const TBool aChangeFocus = ETrue);
       
  1730 
       
  1731     /**
       
  1732      * Scrolls list layout.
       
  1733      *
       
  1734      * @param aPrevious
       
  1735      * @param aAlignTop
       
  1736      */
       
  1737     void Scroll( const TFsTreeItemId aPrevious = KFsTreeNoneID,
       
  1738                 TBool aAlignTop=ETrue );
       
  1739 
       
  1740     /**
       
  1741      * Returns the height of all visible items.
       
  1742      *
       
  1743      * @param aPrevious
       
  1744      *
       
  1745      * @return Height of all visible items in pixels.
       
  1746      */
       
  1747     TInt VisibleItemsHeight( const TFsTreeItemId aPrevious );
       
  1748 
       
  1749     /**
       
  1750      * Check if item is in expanded node.
       
  1751      *
       
  1752      * @param aItemId
       
  1753      *
       
  1754      * @return Etrue if item is in expanded node, EFalse otherwise
       
  1755      */
       
  1756      TBool IsInExpanded( TFsTreeItemId aItemId );
       
  1757 
       
  1758      void UpdateViewPortL();
       
  1759 
       
  1760     /**
       
  1761      * Update scrollbar and list layout respectively.
       
  1762      *
       
  1763      * @param aTimeout Timeout needed for the update.
       
  1764      */
       
  1765      void UpdateScrollBarL( const TInt aTimeout = 0 );
       
  1766      TInt UpdateScrollBar( const TInt aTimeout = 0 );
       
  1767      void UpdateScrollBarIfNeededL();
       
  1768      void SetScrollBarModelValues();
       
  1769      
       
  1770      /**
       
  1771       * Finds next focusable item.
       
  1772       *
       
  1773       * @param aItemId Focusable item for whom next focusable should be
       
  1774       * found.
       
  1775       *
       
  1776       * @return Focusable item id.
       
  1777       */
       
  1778      TFsTreeItemId NextFocusableItem( const TFsTreeItemId aItemId );
       
  1779 
       
  1780      /**
       
  1781       * Finds previous focusable item.
       
  1782       *
       
  1783       * @param aItemId Focusable item for whom previous focusable should be
       
  1784       * found.
       
  1785       *
       
  1786       * @return Focusable item id.
       
  1787       */
       
  1788      TFsTreeItemId PrevFocusableItem( const TFsTreeItemId aItemId );
       
  1789 
       
  1790      /**
       
  1791       * Function sets current scroll speed based on the up/down key repeats.
       
  1792       *
       
  1793       * @param aKeyRepeats Number of up/down key repeats.
       
  1794       */
       
  1795      void SetCurrentScrollSpeed( TInt aKeyRepeats );
       
  1796 
       
  1797      /**
       
  1798       * Gets default settings from Central Repository.
       
  1799       */
       
  1800      void ReadDefaultValuesFromCenRep();
       
  1801 
       
  1802      /**
       
  1803       * Sets values to an item which are default for the whole list (e.g. if
       
  1804       * items are always extended.
       
  1805       *
       
  1806       * @param aItemVis Item's visualizer.
       
  1807       */
       
  1808      void ApplyListSpecificValuesToItem (MFsTreeItemVisualizer *aItemVis);
       
  1809 
       
  1810 
       
  1811      /**
       
  1812       * The function calculates tree height up to the specified item.
       
  1813       *
       
  1814       * @param aItemId Id on an item up to which the tree height should be
       
  1815       *                calculated.
       
  1816       * @param aHeight Calculated height.
       
  1817       *
       
  1818       * @return KErrNone if successful. KErrNotFound if item id was invalid or
       
  1819       *         item is in collapsed node.
       
  1820       */
       
  1821      TInt CalculateTreeHeightUpToItem( const TFsTreeItemId aItemId,
       
  1822                                        TInt& aHeight ) const;
       
  1823 
       
  1824      /**
       
  1825       * Update list's visual content by appending items into empty gap in list
       
  1826       *
       
  1827       * @param aHeight Height of the empty gap to be filled.
       
  1828       */
       
  1829      void FillGapWithItemsL( const TInt aHeight );
       
  1830 
       
  1831      /**
       
  1832       */
       
  1833      void UpdateListItemSizes( );
       
  1834 
       
  1835      /**
       
  1836       */
       
  1837      void UpdateListItemSize( TInt aIndex );
       
  1838 
       
  1839      /**
       
  1840       * The function scrolls list layouts to the given offset in a given time.
       
  1841       */
       
  1842      void ScrollListLayoutsL( TInt aScrollOffset, TInt aScrollTime );
       
  1843      TInt ScrollListLayouts( TInt aScrollOffset, TInt aScrollTime );
       
  1844 
       
  1845      void AdjustVisibleItemsL();
       
  1846 
       
  1847      /*
       
  1848       * Appends item to the top of the list layout.
       
  1849       */
       
  1850      void InsertItemL( TFsTreeItemId aItemId, const TInt aSlot = 0);
       
  1851 
       
  1852      /**
       
  1853       * The function deletes selector visual.
       
  1854       */
       
  1855      void DestroySelectorVisualL( );
       
  1856 
       
  1857      /**
       
  1858       * The function creates selector visual.
       
  1859       */
       
  1860      void CreateSelectorVisualL( );
       
  1861 
       
  1862      /**
       
  1863       */
       
  1864      void UpdateSelectorVisualL(TInt aTime = 0);
       
  1865 
       
  1866      /**
       
  1867      The function implements tree observer's reaction to removing a list item
       
  1868      from the model. If the item was visible then it's removed from the visible
       
  1869      area. If the focused item was removed then the focus is moved to the next
       
  1870      item in the tree hierarchy (if the next item is not present, then the focus
       
  1871      is moved to the previous one).
       
  1872       */
       
  1873      void RemoveItemL( TFsTreeItemId aItemId );
       
  1874 
       
  1875      /**
       
  1876       The function checks whether the focused item is not outside the visible
       
  1877       area and if needed scrolls the list so that selected item is fully visible.
       
  1878       */
       
  1879      void MakeFocusedItemFullyVisible();
       
  1880 
       
  1881      /**
       
  1882       * The function assures that the list view is correct.
       
  1883       * It sets focused item as fully visible.Neighbouring items are also made, if possible,
       
  1884       * fully visible to fullfil the scrolling rules.
       
  1885       */
       
  1886      void ValidateListLayoutL( TInt aTime = 0 );
       
  1887 
       
  1888      /**
       
  1889       * The function checks if the given item id matches the focused one.
       
  1890       *
       
  1891       * @param aItemId Item id to be checked.
       
  1892       *
       
  1893       * @return ETrue if the id matches the focused id && list has focus &&
       
  1894       *               there is a defined focused item.
       
  1895       */
       
  1896      TBool IsItemFocused( TFsTreeItemId aItemId ) const;
       
  1897 
       
  1898 private:
       
  1899     /**
       
  1900      * Tree visualization state
       
  1901      */
       
  1902     enum TFsTreeVisualState
       
  1903         {
       
  1904         /**
       
  1905          *
       
  1906          */
       
  1907         EFsTreeVisible,
       
  1908         EFsTreeHidden,
       
  1909         EFsTreeFadingIn,
       
  1910         EFsTreeFadingOut,
       
  1911         EFsTreeSlidingIn,
       
  1912         EFsTreeSlidingOut,
       
  1913         EFsTreeFadingInSlidingIn,
       
  1914         EFsTreeFadingOutSlidingOut
       
  1915         };
       
  1916     /**
       
  1917      * C++ constructor
       
  1918      *
       
  1919      * @param aOwnerControl Owner control.
       
  1920      * @param aParent Parent layout for all the new layouts constructed by
       
  1921      *                this class.
       
  1922      */
       
  1923     CFsTreeVisualizerBase( CAlfControl* aOwnerControl,
       
  1924         CAlfLayout& aParent, const TBool aPopUpMode );
       
  1925 
       
  1926     /**
       
  1927      * Second phase constructor
       
  1928      *
       
  1929      */
       
  1930     void ConstructL( );
       
  1931 
       
  1932 
       
  1933 // TREE OPTIMIZATIONS
       
  1934 
       
  1935     TInt TreeHeight() const;
       
  1936 
       
  1937     //void SetTreeHeightL( const TInt aValue );
       
  1938 
       
  1939     TBool AllNodesCollapsed() const;
       
  1940     TBool AllNodesExpanded() const;
       
  1941 
       
  1942 private: // from TWorld::MObserver
       
  1943 
       
  1944     virtual void WorldUpdatedL( const TWorld& aWorld );
       
  1945 
       
  1946 
       
  1947 private: // from TViewPort::MObserver
       
  1948 
       
  1949     virtual void ViewPortUpdatedL( TViewPort& aViewPort, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic);
       
  1950 
       
  1951 // TREE OPTIMIZATIONS
       
  1952 
       
  1953     /**
       
  1954      * Updates world size and view position.
       
  1955      */
       
  1956     void UpdatePhysicsL();
       
  1957 
       
  1958     /**
       
  1959      *
       
  1960      */
       
  1961     void SetPanningPosition(const TPoint& aDelta);
       
  1962 
       
  1963     /**
       
  1964      *
       
  1965      */
       
  1966     void StartPhysics(TPoint& aDrag, const TTime& aStartTime);
       
  1967 
       
  1968     /**
       
  1969      * Sets focused item and send event of touch focusing.
       
  1970      */
       
  1971     void SetFocusedItemAndSendEventL( const TFsTreeItemId aItem,
       
  1972         TPointerEventType aEventType, const TPoint& aPoint );
       
  1973 
       
  1974     /**
       
  1975      * Just a wrapper for SetFocusedItemAndSendEventL which returns the
       
  1976      * error code instead of leaving.
       
  1977      */
       
  1978     TInt SetFocusedItemAndSendEvent( const TFsTreeItemId aItem,
       
  1979         TPointerEventType aEventType, const TPoint& aPoint );
       
  1980 
       
  1981 private: // from MAknPhysicsObserver
       
  1982 
       
  1983    virtual TBool IsFocusShown();
       
  1984 
       
  1985 private: //Data members
       
  1986     /*
       
  1987     * Visualization state
       
  1988     */
       
  1989     TFsTreeVisualState iVisualizationState;
       
  1990 
       
  1991     /*
       
  1992      * A parent control for the tree visualizer.
       
  1993      */
       
  1994     CAlfControl* iOwnerControl;
       
  1995 
       
  1996     /*
       
  1997      * A parent layout for the tree visualizer.
       
  1998      */
       
  1999     CAlfLayout& iParentLayout;
       
  2000 
       
  2001     /**
       
  2002      * Data model.
       
  2003      * Not owned.
       
  2004      */
       
  2005     CFsTree* iTreeData;
       
  2006 
       
  2007     /**
       
  2008      *  Id of the currently selected item..
       
  2009      */
       
  2010     TFsTreeItemId iFocusedItem;
       
  2011 
       
  2012     /**
       
  2013      * Visualizer for the empty list component. Visualizes the list when only
       
  2014      * root "is visible".
       
  2015      * Own.
       
  2016      */
       
  2017     MFsTreeNodeVisualizer* iRootVisualizer;
       
  2018 
       
  2019     /**
       
  2020      * Data for the root visualizer. Used for example to store "empty" text.
       
  2021      * Own.
       
  2022      */
       
  2023     CFsTreePlainOneLineItemData* iRootData;
       
  2024 
       
  2025     /**
       
  2026      * Main layout of the component.
       
  2027      */
       
  2028     CAlfGridLayout* iComponentLayout;
       
  2029 
       
  2030     /**
       
  2031      *
       
  2032      */
       
  2033     CAlfDeckLayout* iListDeck;
       
  2034 
       
  2035     /**
       
  2036      *
       
  2037      */
       
  2038     CAlfFlowLayout* iListItemBackgroundLayout;
       
  2039 
       
  2040     /**
       
  2041      *
       
  2042      */
       
  2043     CAlfDeckLayout* iSelectorLayout;
       
  2044 
       
  2045     /**
       
  2046      * Layout in which items are placed.
       
  2047      */
       
  2048     CAlfFlowLayout* iListLayout;
       
  2049 
       
  2050     /**
       
  2051      * Layout in which scroll bar is shown (on top of others)
       
  2052      */
       
  2053     CAlfAnchorLayout* iScrollBarLayout;
       
  2054 
       
  2055     /**
       
  2056      * Layout in which watermark is placed.
       
  2057      */
       
  2058     CAlfDeckLayout* iWatermarkLayout;
       
  2059 
       
  2060     /**
       
  2061      * A list of currently visible items.
       
  2062      */
       
  2063     RArray<TFsTreeItemId> iVisibleItems;
       
  2064 
       
  2065     /**
       
  2066      *
       
  2067      */
       
  2068     RArray<CAlfDeckLayout*> iVisibleItemsBackground;
       
  2069 
       
  2070     /**
       
  2071      * Type of List's looping.
       
  2072      */
       
  2073     TFsTreeListLoopingType iLooping;
       
  2074 
       
  2075     /**
       
  2076      * A brush holding item separator color.
       
  2077      */
       
  2078     CAlfBrush* iBorderBrush;
       
  2079 
       
  2080     /**
       
  2081      * A table of keys which trigger page-up event.
       
  2082      */
       
  2083     RArray<TInt> iCustomPageUpKeys;
       
  2084 
       
  2085     /**
       
  2086      * A table of keys which trigger page-down event.
       
  2087      */
       
  2088     RArray<TInt> iCustomPageDownKeys;
       
  2089 
       
  2090     /**
       
  2091      * Scrollbar
       
  2092      */
       
  2093     CAlfImageVisual* iDummyScrollbar;
       
  2094     MUiCScrollBar* iScrollBar;
       
  2095     TUiCScrollBarModel iScrollBarModel;
       
  2096     TFsScrollbarVisibility iScrollbarVisibility;
       
  2097 
       
  2098     /**
       
  2099      * Image visual for the selector.
       
  2100      * Own.
       
  2101      */
       
  2102     CAlfImageVisual* iSelectorVisual;
       
  2103 
       
  2104     /**
       
  2105      * Texture for the selector.
       
  2106      * Not own.
       
  2107      */
       
  2108     CAlfTexture* iSelectorTexture;
       
  2109 
       
  2110     /**
       
  2111      * Selector's brush.
       
  2112      * Not own.
       
  2113      */
       
  2114     CAlfBrush* iSelectorBrush;
       
  2115 
       
  2116     /**
       
  2117      Selector's opacity.
       
  2118      */
       
  2119     TReal32 iSelectorOpacity;
       
  2120 
       
  2121     /**
       
  2122      * Selector's left border width.
       
  2123      */
       
  2124     TInt iLeftSelectorBorderWidth;
       
  2125 
       
  2126     /**
       
  2127      * Selector's right border width.
       
  2128      */
       
  2129     TInt iRightSelectorBorderWidth;
       
  2130 
       
  2131     /**
       
  2132      * Selector's top border height.
       
  2133      */
       
  2134     TInt iTopSelectorBorderHeight;
       
  2135 
       
  2136     /**
       
  2137      * Selector's bottom border height.
       
  2138      */
       
  2139     TInt iBottomSelectorBorderHeight;
       
  2140 
       
  2141     /**
       
  2142      * Type of the selector's  movement.
       
  2143      */
       
  2144     TFsSelectorMovement iSelectorMovementType;
       
  2145 
       
  2146     /**
       
  2147      * Class for controlling the fade effects
       
  2148      */
       
  2149     CFsFadeEffect* iFadeEffect;
       
  2150 
       
  2151     /**
       
  2152      * Class for controlling the slide effects
       
  2153      */
       
  2154     CFsSlideEffect* iSlideEffect;
       
  2155 
       
  2156     /**
       
  2157      * Root layout - for shadow
       
  2158      */
       
  2159     CAlfDeckLayout* iRootLayout;
       
  2160 
       
  2161     /**
       
  2162      * Shadow layout, holds shadow brush when shadow is enabled.
       
  2163      */
       
  2164     CAlfDeckLayout* iShadowLayout;
       
  2165 
       
  2166     /**
       
  2167      * Border layout, holds border brush if it is enabled..
       
  2168      */
       
  2169     CAlfDeckLayout* iBorderLayout;
       
  2170 
       
  2171     /**
       
  2172      * Icon used to mark items.
       
  2173      */
       
  2174     CAlfTexture* iMarkIcon;
       
  2175 
       
  2176     /**
       
  2177      * Icon indicating that item has menu.
       
  2178      */
       
  2179     CAlfTexture* iMenuIcon;
       
  2180 
       
  2181     /**
       
  2182      * Item text marquee speed. In pixels per second.
       
  2183      * Own.
       
  2184      */
       
  2185     TUint iMarqueeSpeed;
       
  2186 
       
  2187     /**
       
  2188      * Visualizer observer
       
  2189      * Not own.
       
  2190      */
       
  2191     MFsTreeVisualizerObserver* iVisualizerObserver;
       
  2192 
       
  2193     /**
       
  2194      * Speed of scrolling.
       
  2195      */
       
  2196     TInt iScrollSpeed;
       
  2197 
       
  2198     /**
       
  2199      * Current speed of scrolling. Can vary from iScrollSpeed by rate of
       
  2200      * scroll acceleration.
       
  2201      */
       
  2202     TInt iCurrentScrollSpeed;
       
  2203 
       
  2204     /**
       
  2205      * The rate at which scroll speed accelerates when up/down key is pressed
       
  2206      * for a long time.
       
  2207      */
       
  2208     TReal iScrollAccelerationRate;
       
  2209 
       
  2210     /**
       
  2211      * Duration of fade-in effect.
       
  2212      */
       
  2213     TInt iFadeInEffectTime;
       
  2214 
       
  2215     /**
       
  2216      * Duration of fade-out effect.
       
  2217      */
       
  2218     TInt iFadeOutEffectTime;
       
  2219 
       
  2220     /**
       
  2221      * Watermark used by the list.
       
  2222      */
       
  2223     CFsWatermark* iWatermark;
       
  2224 
       
  2225     /**
       
  2226      * Hierarchy level indentation in pixel.
       
  2227      */
       
  2228     TInt iLevelIndentation;
       
  2229 
       
  2230     /**
       
  2231      * Duration of a slide in effect.
       
  2232      */
       
  2233     TInt iSlideInDuration;
       
  2234 
       
  2235     /**
       
  2236      * Direction of a slide in effect.
       
  2237      */
       
  2238     MFsTreeVisualizer::TFsSlideEffect iSlideInDirection;
       
  2239 
       
  2240     /**
       
  2241      * Duration of a slide out effect.
       
  2242      */
       
  2243     TInt iSlideOutDuration;
       
  2244 
       
  2245     /**
       
  2246      * Direction of a slide out effect.
       
  2247      */
       
  2248     MFsTreeVisualizer::TFsSlideEffect iSlideOutDirection;
       
  2249 
       
  2250     /**
       
  2251      * Instance of text style manager.
       
  2252      * Own.
       
  2253      */
       
  2254     CFsAlfTextStyleManager* iTextStyleManager;
       
  2255 
       
  2256     /**
       
  2257      * List layout scroll offset.
       
  2258      */
       
  2259     TInt iScrollOffset;
       
  2260 
       
  2261     /**
       
  2262      * Time interval.
       
  2263      * Own.
       
  2264      */
       
  2265     CFsInteractionInterval* iIntx;
       
  2266 
       
  2267     /**
       
  2268      * List item text marquee setting.
       
  2269      */
       
  2270     TFsTextMarqueeType iMarqueeType;
       
  2271 
       
  2272     /**
       
  2273      * Marquee start delay in miliseconds.
       
  2274      */
       
  2275     TInt iMarqueStartDelay;
       
  2276 
       
  2277     /**
       
  2278      * Marquee cycle start delay in miliseconds.
       
  2279      */
       
  2280     TInt iMarqueCycleStartDelay;
       
  2281 
       
  2282     /**
       
  2283      * Number of marquee cycles.
       
  2284      * Negative value - infinite loop.
       
  2285      */
       
  2286     TInt iMarqueeRepetitions;
       
  2287 
       
  2288     /**
       
  2289      * Pointer drag handler instance (owned)
       
  2290      */
       
  2291     CDragHandler* iDragHandler;
       
  2292 
       
  2293     /**
       
  2294      * AknPhysics instance (owned)
       
  2295      */
       
  2296     CAknPhysics* iPhysics;
       
  2297 
       
  2298     /**
       
  2299      * Visual structure of the whole list.
       
  2300      */
       
  2301     TWorld iWorld;
       
  2302 
       
  2303     /*
       
  2304      * List viewport.
       
  2305      */
       
  2306     TViewPort iViewPort;
       
  2307 
       
  2308     /**
       
  2309      * Boolean flags
       
  2310      */
       
  2311     enum TFlag {
       
  2312         /**
       
  2313          * Set if the physics action is going on
       
  2314          */
       
  2315         EPhysicsOn,
       
  2316 
       
  2317         /**
       
  2318          * Do auto refresh during addition of items.
       
  2319          * Currently scrollbar refresh can be blocked.
       
  2320          */
       
  2321         EAutoRefresh,
       
  2322 
       
  2323         /**
       
  2324          * Holds information wether items are always extended.
       
  2325          */
       
  2326         EItemsAlwaysExtended,
       
  2327 
       
  2328         /**
       
  2329          * Page down event is being handled.
       
  2330          */
       
  2331         EIsPageUpDownActive,
       
  2332 
       
  2333         /**
       
  2334          * If this flag is set, tree will work in direct touch mode
       
  2335          */
       
  2336         EDirectTouchMode,
       
  2337 
       
  2338         /**
       
  2339          * The list is focused or not.
       
  2340          */
       
  2341         EListFocused,
       
  2342 
       
  2343         /**
       
  2344          * Long tap on node invokes expand/collapse all.
       
  2345          */
       
  2346         EExpandCollapseOnLongTap,
       
  2347 
       
  2348         /**
       
  2349          * Do physics update when simulation has finished.
       
  2350          */
       
  2351         EUpdatePhysicsAfterSimulationFinished,
       
  2352 
       
  2353 		/**
       
  2354 		 * Ignore next pointer up event.
       
  2355 		 */
       
  2356         EIgnorePointerUpAction,
       
  2357 
       
  2358 		/**
       
  2359 		 * List is shown in popup mode.
       
  2360 		 */
       
  2361         EPopupMode,
       
  2362         
       
  2363         /**
       
  2364          * Informs tactile feedback that item was added i.e. does not 
       
  2365          * play feedback.
       
  2366          */
       
  2367         EListModelUpdate,
       
  2368 
       
  2369         /**
       
  2370          * This flag is checked when trying to focus item. Focus is ignored 
       
  2371          * if list is being panned. 
       
  2372          */        
       
  2373         EListPanning
       
  2374     };
       
  2375 
       
  2376     // Flags
       
  2377     TBitFlags iFlags;
       
  2378 
       
  2379     // ETrue when the stylus/finger is currently pressed down
       
  2380     TBool iTouchPressed;
       
  2381 
       
  2382     // Keyboard flip state
       
  2383     TBool iFlipOpen;
       
  2384 
       
  2385     // Focus visibility state (e.g. will be hidden after a delay)
       
  2386     TBool iFocusVisible;
       
  2387 
       
  2388     /**
       
  2389      * States status of kinetic scrolling.
       
  2390      */
       
  2391     TBool iKineticScrollingDisabled;
       
  2392     };
       
  2393 
       
  2394 #endif  // C_FSTREEVISUALIZER_H
       
  2395