emailuis/uicomponents/inc/muicscrollbar.h
branchRCL_3
changeset 12 4ce476e64c59
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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: muicscrollbar.h
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef M_UICSCROLLBAR_H
       
    19 #define M_UICSCROLLBAR_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "tuicscrollbarmodel.h"
       
    23 
       
    24 /**
       
    25  * MUiCScrollBar
       
    26  *
       
    27  */
       
    28 class MUiCScrollBar
       
    29     {
       
    30 
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Scroll events
       
    35      */
       
    36     enum TEvent
       
    37         {
       
    38         EScrollHome,
       
    39         EScrollEnd,
       
    40         EScrollPosition
       
    41         };
       
    42 
       
    43     /**
       
    44      * Layouting hints
       
    45      */
       
    46     enum TLayoutHint
       
    47         {
       
    48         // Scroll bar is shown on top of the list, not on side
       
    49         ELayoutOnTopOfList = (1 << 0),
       
    50                 
       
    51         // Coordinates must be given relative to the list, not screen
       
    52         ELayoutRelativeToList = (1 << 1),
       
    53                 
       
    54         // Scroll bar will do automatic mirroring
       
    55         ELayoutAutomaticMirroring = (1 << 2)      
       
    56         };
       
    57     
       
    58 public:
       
    59 
       
    60     /**
       
    61      * Scrollbar observer
       
    62      */
       
    63     class MObserver
       
    64         {
       
    65     public:
       
    66         virtual void HandleScrollEventL( const MUiCScrollBar& aScrollBar,
       
    67             TEvent aEvent ) = 0;
       
    68         };
       
    69 
       
    70 public:
       
    71 
       
    72     /**
       
    73      * Destroys instance and frees resources
       
    74      */
       
    75     virtual void Destroy() = 0;
       
    76     
       
    77     /**
       
    78      * Shows scrollbar
       
    79      */
       
    80     virtual void Show( const TBool aShow ) = 0;
       
    81     
       
    82     /**
       
    83      * Updates scrollbar model
       
    84      */
       
    85     virtual void UpdateModelL( const TUiCScrollBarModel& aModel ) = 0;
       
    86     
       
    87     /**
       
    88      * Returns thumb position
       
    89      */
       
    90     virtual TInt ThumbPosition() const = 0;
       
    91     
       
    92     /**
       
    93      * Sets scrollbar rect
       
    94      */
       
    95     virtual void SetRect( const TRect& aRect ) = 0;
       
    96 
       
    97     /**
       
    98      * Force scrollbar redraw
       
    99      */
       
   100     virtual void Redraw() = 0;
       
   101 
       
   102     /**
       
   103      * Called when theme is changed
       
   104      */
       
   105     virtual void NotifyThemeChanged() = 0;
       
   106 
       
   107     /**
       
   108      * Returns layouting hints for the scrollbar
       
   109      */
       
   110     virtual TInt LayoutHints() const = 0;
       
   111 
       
   112     };
       
   113 
       
   114 #endif /* M_UICSCROLLBAR_H */