56
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HGVGSCROLLBAR_H_
|
|
19 |
#define HGVGSCROLLBAR_H_
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <ganes/HgScroller.h>
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <VG/openvg.h>
|
|
25 |
#include <gulcolor.h>
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
|
|
29 |
class MHgScrollbarObserver;
|
|
30 |
class CHgScrollbar;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Helper class for drawing and interacting scrollbars.
|
|
34 |
*/
|
|
35 |
NONSHARABLE_CLASS(CHgVgScrollBar) : CBase
|
|
36 |
{
|
|
37 |
public:
|
|
38 |
|
|
39 |
/**
|
|
40 |
* Creates new CHgVGScrollBar.
|
|
41 |
*
|
|
42 |
* @param aObserver observer for the scrollbar.
|
|
43 |
*/
|
|
44 |
static CHgVgScrollBar* NewL( MHgScrollbarObserver& aObserver,
|
|
45 |
TRect aScrollbarRect,
|
|
46 |
TSize aTotalSize,
|
|
47 |
TSize aViewSize,
|
|
48 |
TBool aLandscapeScrolling,
|
|
49 |
CHgScroller::THgScrollBarType aScrollBarType );
|
|
50 |
|
|
51 |
// Destructor.
|
|
52 |
virtual ~CHgVgScrollBar();
|
|
53 |
|
|
54 |
public: // METHODS
|
|
55 |
|
|
56 |
void SetViewPosition( TPoint aPosition );
|
|
57 |
|
|
58 |
TBool HandlePointerEventL( const TPointerEvent& aEvent );
|
|
59 |
|
|
60 |
void Draw(const TRect& aWindowRect, TReal aAlpha) const;
|
|
61 |
|
|
62 |
TBool IsEnabled() const;
|
|
63 |
|
|
64 |
void SetEnabled(TBool aEnabled);
|
|
65 |
|
|
66 |
void ResizeL(MHgScrollbarObserver& aObserver, TRect aScrollbarRect,
|
|
67 |
TSize aTotalSize,
|
|
68 |
TSize aViewSize,
|
|
69 |
TBool aLandscapeScrolling,
|
|
70 |
CHgScroller::THgScrollBarType aScrollBarType);
|
|
71 |
|
|
72 |
void EnableLandscapeRendering(TBool aEnabled);
|
|
73 |
|
|
74 |
protected: // Constructors
|
|
75 |
CHgVgScrollBar( );
|
|
76 |
|
|
77 |
void ConstructL (MHgScrollbarObserver& aObserver, TRect aScrollbarRect,
|
|
78 |
TSize aTotalSize,
|
|
79 |
TSize aViewSize,
|
|
80 |
TBool aLandscapeScrolling,
|
|
81 |
CHgScroller::THgScrollBarType aScrollBarType);
|
|
82 |
|
|
83 |
protected: // Internal implementation
|
|
84 |
|
|
85 |
void CreateImagesL();
|
|
86 |
|
|
87 |
void DrawImage(const TPoint& aPosition, VGImage aImage,
|
|
88 |
const TSize& aSize, const TRect& aWindowRect, TReal aAlpha) const;
|
|
89 |
|
|
90 |
private:
|
|
91 |
TBool iEnabled;
|
|
92 |
|
|
93 |
CHgScrollbar* iScrollbar;
|
|
94 |
|
|
95 |
VGImage iScrollbarBg;
|
|
96 |
VGImage iScrollbarHandleBg;
|
|
97 |
VGImage iScrollbarHandle;
|
|
98 |
VGImage iScrollbarBgSelected;
|
|
99 |
VGImage iScrollbarHandleSelected;
|
|
100 |
|
|
101 |
TBool iLandscape;
|
|
102 |
|
|
103 |
};
|
|
104 |
|
|
105 |
#endif /* HGVGSCROLLBAR */
|