emailuis/uicomponents/inc/fstreevisualizer.h
changeset 0 8466d47a6819
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:  Freestyle tree list component
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_FSTREEVISUALIZER_H
       
    20 #define M_FSTREEVISUALIZER_H
       
    21 
       
    22 #include "fstreelistconstants.h"
       
    23 
       
    24 //////SYSTEM CLASSES
       
    25 class TRgb;
       
    26 
       
    27 //////TOOLKIT CLASSES
       
    28 class TAlfEvent;
       
    29 
       
    30 //////PROJECT CLASSES
       
    31 class MFsTreeItemData;
       
    32 class MFsTreeNodeVisualizer;
       
    33 
       
    34 /**
       
    35  * MFsTreeVisualizer is an interface for the tree visualizers.
       
    36  *
       
    37  * @code
       
    38  *
       
    39  * @endcode
       
    40  *
       
    41  * @lib 
       
    42  */
       
    43 class MFsTreeVisualizer
       
    44     {
       
    45 public:
       
    46 
       
    47     /** Pre-defined slide effects directions */
       
    48     enum TFsSlideEffect
       
    49         {
       
    50         ESlideNone = 0,
       
    51         ESlideFromTop,
       
    52         ESlideFromBottom,
       
    53         ESlideFromRight,
       
    54         ESlideFromLeft
       
    55         };
       
    56 
       
    57 public:
       
    58     
       
    59     /**
       
    60      * C++ destructor
       
    61      */
       
    62     virtual ~MFsTreeVisualizer() { };
       
    63     
       
    64 public: // visualizer's interface  
       
    65 
       
    66     /**
       
    67      * Handles key event forwarded by the controller.
       
    68      * 
       
    69      * @param aEvent Key event to handle.
       
    70      * 
       
    71      * @return ETrue if the event was handled by the tree visualizer.
       
    72      */
       
    73     virtual TBool HandleKeyEventL(const TAlfEvent& aEvent) = 0;
       
    74 
       
    75     // <cmail> "Base class modifications for using touch"
       
    76     /**
       
    77      * Handles key event forwarded by the controller.
       
    78      * 
       
    79      * @param aEvent Pointer event to investigate. 
       
    80      * @return TBool for indicating if event is used.
       
    81      */
       
    82     virtual TBool HandlePointerEventL( const TAlfEvent& aEvent ) = 0;
       
    83     // </cmail>
       
    84             
       
    85     /**
       
    86      * Sets the specified item as focused.
       
    87      * 
       
    88      * @param aItem indicates item to be focused.
       
    89      * 
       
    90      * @panic EFsListPanicInvalidItemID Item with specified ID is not found.
       
    91      */
       
    92     // <cmail>
       
    93     virtual void SetFocusedItemL( TFsTreeItemId aItem, TBool aCheckFocus = ETrue ) = 0;
       
    94     // </cmail>
       
    95     
       
    96     /**
       
    97      * Returns item id of the currently focused item.
       
    98      * 
       
    99      * @return Id of the focused item.
       
   100      */
       
   101     virtual TFsTreeItemId FocusedItem () const = 0;
       
   102     
       
   103     /**
       
   104      * Checks if the specified item is focused.
       
   105      * 
       
   106      * @param aItem Item to be checked.
       
   107      * 
       
   108      * @return ETrue If item is focused. EFalse if item is not focused or 
       
   109      *         item does not exist in the tree.
       
   110      */
       
   111     virtual TBool IsFocused( const TFsTreeItemId aItem ) const = 0;        
       
   112 
       
   113     /**
       
   114      * Gets a pointer to the root's item data object.
       
   115      * 
       
   116      * @return Pointer to the root's item data object.
       
   117      */
       
   118     virtual MFsTreeItemData* RootItemData() = 0;
       
   119     
       
   120     /**
       
   121      * Gets a pointer to the root's item visualizer object.
       
   122      * 
       
   123      * @return Pointer to the root's item visualizer object.
       
   124      */
       
   125     virtual MFsTreeNodeVisualizer* RootNodeVisualizer() = 0;
       
   126     
       
   127     /**
       
   128      * Displays the list.
       
   129      * 
       
   130      * @param aFadeIn Defines if list visual should or shouldn't fade in to 
       
   131      *                the screen.
       
   132      * @param aSlideIn ETrue if slide in effect should be used, EFalse if not.
       
   133      */
       
   134     virtual void ShowListL( const TBool aFadeIn = EFalse, 
       
   135                             const TBool aSlideIn = EFalse ) = 0;        
       
   136     
       
   137     /**
       
   138      * Hides the list.
       
   139      *
       
   140      * @param aFadeOut Defines if list visual should or shouldn't fade out
       
   141      *                 from the screen.
       
   142      * @param aSlideOut ETrue if slide out effect should be used,EFalse if not
       
   143      */
       
   144     virtual void HideList( const TBool aFadeOut = EFalse,
       
   145                            const TBool aSlideOut = EFalse ) = 0;
       
   146     
       
   147     /**
       
   148      * The function sets duration of the slide-in effect.
       
   149      * 
       
   150      * @param aTimeMiliseconds Slide in time in milliseconds.
       
   151      */
       
   152     virtual void SetSlideInDuration ( TInt aTimeMiliseconds ) = 0;
       
   153     
       
   154     /**
       
   155      * The function returns slide in effect's duration.
       
   156      * 
       
   157      * @return Slide in duration in miliseconds.
       
   158      */
       
   159     virtual TInt SlideInDuration ( ) const = 0;
       
   160     
       
   161     /**
       
   162      * The function sets direction of the slide in effect.
       
   163      * 
       
   164      * @param aDirection A direction of the slide in effect.
       
   165      */
       
   166     virtual void SetSlideInDirection ( TFsSlideEffect aDirection ) = 0;
       
   167 
       
   168     /**
       
   169      * The function returns direction of the slide in effect.
       
   170      * 
       
   171      * @return A direction of the slide in effect.
       
   172      */
       
   173     virtual TFsSlideEffect SlideInDirection ( ) const = 0;
       
   174 
       
   175     /**
       
   176      * The function sets duration of the slide-out effect.
       
   177      * 
       
   178      * @param aTimeMiliseconds Slide out time in milliseconds.
       
   179      */
       
   180     virtual void SetSlideOutDuration ( TInt aTimeMiliseconds ) = 0;
       
   181     
       
   182     /**
       
   183      * The function returns slide out effect's duration.
       
   184      * 
       
   185      * @return Slide out duration in miliseconds.
       
   186      */
       
   187     virtual TInt SlideOutDuration ( ) const = 0;
       
   188     
       
   189     /**
       
   190      * The function sets direction of the slide out effect.
       
   191      * 
       
   192      * @param aDirection A direction of the slide out effect.
       
   193      */
       
   194     virtual void SetSlideOutDirection ( TFsSlideEffect aDirection ) = 0;
       
   195 
       
   196     /**
       
   197      * The function returns direction of the slide out effect.
       
   198      * 
       
   199      * @return A direction of the slide out effect.
       
   200      */
       
   201     virtual TFsSlideEffect SlideOutDirection ( ) const = 0;
       
   202     
       
   203     /**
       
   204      * Returns information about looping type of the list.
       
   205      *
       
   206      * @return Type of list looping. EFsTreeListLoopingDisabled when looping
       
   207      *         is turned off.
       
   208      */
       
   209     virtual TFsTreeListLoopingType LoopingType() const = 0;
       
   210 
       
   211     /**
       
   212      * Sets type of list's looping.
       
   213      *
       
   214      * @param aLoopingType type of list looping.
       
   215      */
       
   216     virtual void SetLoopingType(const TFsTreeListLoopingType aLoopingType) =0;
       
   217 
       
   218     /**
       
   219      * Sets the delay for the item expansion animation.
       
   220      *
       
   221      * @param aDelay Delay in miliseconds.
       
   222      */
       
   223     virtual void SetItemExpansionDelay( const TInt aDelay ) = 0;
       
   224     
       
   225     /**
       
   226      * Gets the delay for the item expansion animation.
       
   227      *
       
   228      * @return Delay in miliseconds.
       
   229      */
       
   230     virtual TInt ItemExpansionDelay( ) const = 0;
       
   231     
       
   232     /**
       
   233      * 
       
   234      */
       
   235     virtual void SetItemSeparatorColor( const TRgb& aColor ) = 0;
       
   236     
       
   237     /**
       
   238      * 
       
   239      */
       
   240     virtual void SetItemSeparatorSize( const TSize aSize ) = 0;
       
   241     
       
   242     /**
       
   243      * 
       
   244      */
       
   245     virtual void CollapseAllL() = 0;
       
   246     
       
   247     /**
       
   248      * 
       
   249      */
       
   250     virtual void ExpandAllL() = 0;
       
   251     
       
   252     /**
       
   253      * Refreshes all visible items in the list.
       
   254      */
       
   255     virtual void UpdateItemL( const TFsTreeItemId aItemId ) = 0;
       
   256     
       
   257     /**
       
   258      * Refreshes all visible items in the list.
       
   259      */
       
   260     virtual void RefreshListViewL() = 0;
       
   261 
       
   262     /**
       
   263      * The functions sets wether all item in the list should be always in
       
   264      * extended state or in normal state.
       
   265      * The list view is refreshed.
       
   266      * 
       
   267      * @param aAlwaysExtended ETrue if items should be always extended. EFalse
       
   268      *                        if items should be in normal state.
       
   269      */
       
   270     virtual void SetItemsAlwaysExtendedL ( TBool aAlwaysExtended ) = 0;
       
   271 
       
   272     /*
       
   273      * The function returns if items are always in extended state or in normal
       
   274      * 
       
   275      * @return ETrue if items are always in extended state, EFalse if items
       
   276      *         are in normal state.
       
   277      */
       
   278     virtual TBool IsItemsAlwaysExtended ( ) = 0;
       
   279     
       
   280     /**
       
   281      * The function sets a text for empty list's view.
       
   282      * 
       
   283      * @param aText Text to be displayed.
       
   284      */
       
   285     virtual void SetEmptyListTextL( const TDesC& aText ) = 0; 
       
   286     
       
   287     /**
       
   288       * Sets the type of text marquee.
       
   289       * 
       
   290       * @param aMarquee Type of marquee.
       
   291       */
       
   292     virtual void SetTextMarqueeType(const TFsTextMarqueeType aMarquee) = 0;
       
   293          
       
   294     /**
       
   295      * Gets the type of text marquee.
       
   296      * 
       
   297      * @return Type of marquee.
       
   298      */
       
   299     virtual TFsTextMarqueeType TextMarqueeType() const = 0;
       
   300  
       
   301     /**
       
   302      * Sets the speed of marquee.
       
   303      * 
       
   304      * @param aPixelsPerSec How many pixels per second.
       
   305      */
       
   306     virtual void SetTextMarqueeSpeed ( const TInt aPixelsPerSec ) = 0;
       
   307     
       
   308     /**
       
   309      * Gets the speed of marquee.
       
   310      * 
       
   311      * @return How many pixels per second.
       
   312      */
       
   313     virtual TInt TextMarqueeSpeed ( ) const = 0;
       
   314      
       
   315     /**
       
   316      * Sets delay for text marquee start.
       
   317      * 
       
   318      * @param aStartDelay Time after which the text marquee starts (in miliseconds).
       
   319      */
       
   320     virtual void SetTextMarqueeStartDelay ( const TInt aStartDelay ) = 0;
       
   321      
       
   322     /**
       
   323      * Gets delay for text marquee.
       
   324      * 
       
   325      * @return Time after which the text marquee starts (in miliseconds).
       
   326      */
       
   327     virtual TInt TextMarqueeStartDelay () const = 0;
       
   328      
       
   329     /**
       
   330      * Sets repetitions number of marquee cycle.
       
   331      * 
       
   332      * @param aRepetitions Number of marquee cycles. Negetive values - infinite loop.
       
   333      */
       
   334     virtual void SetTextMarqueeRepetitions ( const TInt aMarqueeRepetitions ) = 0;
       
   335      
       
   336     /**
       
   337      * Gets repetitions number of marquee cycle.
       
   338      * 
       
   339      * @return Number of marquee cycles. Negetive values - infinite loop.
       
   340      */
       
   341     virtual TInt TextMarqueeRepetitions ( ) const = 0;
       
   342     
       
   343     // <cmail> Change scrollbar to avkon (to support skinning & touch)
       
   344     virtual void NotifyControlVisibilityChange( TBool aIsVisible ) = 0;
       
   345     // </cmail>
       
   346     
       
   347     };
       
   348     
       
   349      
       
   350 #endif // M_FSTREEVISUALIZER_H