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