webengine/wmlengine/src/Scrolling/inc/ScrollThumb.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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 the License "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:  Definition of the Browser On-screen scrollbar thumb
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _SCROLLTHUMB_H
       
    19 #define _SCROLLTHUMB_H
       
    20 
       
    21 //-----------------------------------------------------------------------
       
    22 // INCLUDES
       
    23 //-----------------------------------------------------------------------
       
    24 #include "ScrollBar.h"
       
    25 
       
    26 #include <coecntrl.h>
       
    27 #include <e32std.h>
       
    28 
       
    29 //-----------------------------------------------------------------------
       
    30 // CONSTANTS
       
    31 //-----------------------------------------------------------------------
       
    32 const TInt KShadowThickness = 1; // thickness of the shadow of the thumb
       
    33 
       
    34 //-----------------------------------------------------------------------
       
    35 // CLASS DEFINITION
       
    36 //-----------------------------------------------------------------------
       
    37 //
       
    38 /**
       
    39 *  Browser On-screen scrollbar thumb
       
    40 *
       
    41 *  @since Series60_version 2.5
       
    42 */
       
    43 class CScrollThumb : public CCoeControl
       
    44     {
       
    45     //------------------------------------------------------------------
       
    46     // Constructors and Destructors - Public
       
    47     //------------------------------------------------------------------
       
    48     public:
       
    49         
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CScrollThumb* NewL(CScrollBar::TOrientation aOrientation);
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CScrollThumb();
       
    59         
       
    60         //------------------------------------------------------------------
       
    61         // Member Functions - Public
       
    62         //------------------------------------------------------------------
       
    63     public:
       
    64         
       
    65         void Draw(const TRect& aRect) const;
       
    66         
       
    67         /**
       
    68         * Sets the rect of the thumb and its shadow
       
    69         * @since Series60_version 2.5
       
    70         * @param aRect - rectangle of the thumb
       
    71         * @return none
       
    72         */
       
    73         void SetThumbAndShadow(const TRect& aRect);
       
    74         
       
    75         //------------------------------------------------------------------
       
    76         // Constructors and Destructors - Private
       
    77         //------------------------------------------------------------------
       
    78     private:
       
    79         
       
    80         /**
       
    81         * C++ default constructor.
       
    82         */
       
    83         CScrollThumb(CScrollBar::TOrientation aOrientation);
       
    84         
       
    85         /**
       
    86         * Symbian 2nd phase constructor
       
    87         */
       
    88         void ConstructL();
       
    89         
       
    90         //------------------------------------------------------------------
       
    91         // Inherited Member Functions - Private
       
    92         //------------------------------------------------------------------
       
    93     private:
       
    94         
       
    95         /**
       
    96         *	From CCoeControl, SizeChanged
       
    97         */
       
    98         virtual void SizeChanged();
       
    99         
       
   100         //------------------------------------------------------------------
       
   101         // Member Functions - Private
       
   102         //------------------------------------------------------------------
       
   103     private:
       
   104         
       
   105         /**
       
   106         * Sets the colours of a thumb
       
   107         * @since Series60_version 2.5
       
   108         * @param aThumbColour - the colour of the thumb
       
   109         * @param aThumbShadowColour - the colour of the thumb shadow
       
   110         * @return none
       
   111         */
       
   112         void SetThumbColours(TRgb aThumbColour, TRgb aThumbShadowColour);		
       
   113         
       
   114         //------------------------------------------------------------------
       
   115         // Member Data - Private
       
   116         //------------------------------------------------------------------
       
   117     private:
       
   118         CScrollBar::TOrientation iOrientation;	// Orientation of the thumb
       
   119         
       
   120         TRect iThumbShadow;         // The outline of the thumb
       
   121         TRect iThumbCentre;		    // the rect of the thumb shown inside the thumb shadow
       
   122         
       
   123         TRgb iThumbColour;		    // the colour of the thumb
       
   124         TRgb iThumbShadowColour;	// the colour of the thumb shadow
       
   125     };
       
   126 
       
   127 #endif  // _SCROLLTHUMB_H