emailuis/uicomponents/inc/tuicscrollbarmodel.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: tuicscrollbarmodel.h
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef T_UICSCROLLBARMODEL_H
       
    19 #define T_UICSCROLLBARMODEL_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 /**
       
    24  * TUiCScrollBarModel
       
    25  * 
       
    26  */
       
    27 class TUiCScrollBarModel
       
    28     {
       
    29 
       
    30 public:
       
    31     
       
    32     /**
       
    33      * Constructor
       
    34      */
       
    35     TUiCScrollBarModel();
       
    36 
       
    37 public: // model
       
    38 
       
    39     /**
       
    40      * Set total height
       
    41      */
       
    42     void SetHeight( TInt aHeight );
       
    43     
       
    44     /**
       
    45      * Total height
       
    46      */
       
    47     TInt Height() const;
       
    48     
       
    49     /**
       
    50      * Set window height
       
    51      */
       
    52     void SetWindowHeight( TInt aHeight );
       
    53     
       
    54     /**
       
    55      * Window height
       
    56      */
       
    57     TInt WindowHeight() const;
       
    58     
       
    59     /**
       
    60      * Sets top position of the window
       
    61      */
       
    62     void SetWindowPosition( TInt aPosition );
       
    63 
       
    64     /**
       
    65      * Top position of the window
       
    66      */
       
    67     TInt WindowPosition() const;
       
    68 
       
    69     /**
       
    70      * Height of the thumb
       
    71      */
       
    72     TInt ThumbHeight() const;
       
    73     
       
    74     /**
       
    75      * Position of thumb inside the window
       
    76      */
       
    77     TInt ThumbPosition() const;
       
    78     
       
    79     /**
       
    80      * Returns ETrue if total height is greater than window height
       
    81      */
       
    82     TBool ScrollBarNeeded() const;
       
    83 
       
    84 private:
       
    85     
       
    86     /**
       
    87      * Returns minimum thumb height (from layout data)
       
    88      */
       
    89     TInt MinimumThumbHeight() const;
       
    90     
       
    91     /**
       
    92      * Returns calculated thumb height. Thumb height is calculated,
       
    93      * unless this result is smaller than MinimumThumbHeight().
       
    94      */
       
    95     TInt CalculatedThumbHeight() const;
       
    96 
       
    97 private:
       
    98 
       
    99     TInt iHeight;
       
   100     TInt iWindowHeight;
       
   101     TInt iWindowPosition;
       
   102 
       
   103     };
       
   104 
       
   105 #endif /* T_UICSCROLLBARMODEL_H */