|
1 /* |
|
2 * Copyright (c) 1997-1999 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 |
|
19 #ifndef __LAFSCRLB_H__ |
|
20 #define __LAFSCRLB_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <gulbordr.h> |
|
24 #include <coecntrl.h> |
|
25 #include <lafpublc.h> |
|
26 |
|
27 class MLafEnv; |
|
28 class CWindowGc; |
|
29 |
|
30 /** |
|
31 * @internal |
|
32 * Do not use |
|
33 */ |
|
34 class LafScrollBar |
|
35 { |
|
36 public: |
|
37 inline static TInt MinimumThumbLength(); |
|
38 inline static TInt DefaultFlags(); |
|
39 inline static TInt DefaultBreadth(); |
|
40 inline static TInt BorderWidth(); |
|
41 inline static TInt DefaultButtonPositionFlags(); |
|
42 IMPORT_C static void GetDefaultBorder(TGulBorder& aBorder); |
|
43 IMPORT_C static void GetBorderColors(TGulBorder::TColors& aBorderColors,const MLafEnv& aEnv,const CCoeControl& aMatchedControl); |
|
44 // added to allow differing style of scrollbars |
|
45 IMPORT_C static void DrawShaft(const MLafEnv& aLafEnv,const CCoeControl& aScrollBar,CWindowGc& aGc,const TRect& aRect,TInt aScrollBarDisplayFlags,TBool aHorizontal); |
|
46 IMPORT_C static void DrawShaftAroundThumb(const MLafEnv& aLafEnv,const CCoeControl& aScrollBar,CWindowGc& aGc,const TRect& aShaftRect,TBool aHorizontal,TInt aThumbPos,TInt aThumbLength); |
|
47 IMPORT_C static void RedrawShaft(const MLafEnv& aLafEnv,const CCoeControl& aScrollBar,CWindowGc& aGc, const TRect& aRect,TInt aShaftStart,TInt aShaftEnd,TBool aHorizontal); |
|
48 IMPORT_C static void DrawHighlightedShaftArea(const MLafEnv& aLafEnv, const CCoeControl& aScrollBar, CWindowGc& aGc, TRect& aArea, TBool aIsHighlighted, |
|
49 TInt aThumbPos, TInt aThumbLength, TBool aHorizontal); |
|
50 IMPORT_C static TInt CalculateThumbLength(TInt aShaftLength,TInt aModelScrollSpan, |
|
51 TInt aModelThumbSpan); |
|
52 IMPORT_C static TInt CalcThumbPosInScrollBar(TInt aShaftStart, TInt aShaftEnd, |
|
53 TInt aThumbLength,TInt aModelThumbPos,TInt aModelScrollSpan,TInt aModelThumbSpan ); |
|
54 IMPORT_C static TInt CalcThumbPosInScrollBarModel(TInt aShaftStart, TInt aShaftEnd, |
|
55 TInt aThumbLength,TInt aThumbPos,TInt aModelScrollSpan,TInt aModelThumbSpan ); |
|
56 IMPORT_C static void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList); |
|
57 IMPORT_C static TBool IsPointerOutOfDragRange(const TPoint& aPointerPosition,const TRect& aScrollBarRect,TBool aHorizontal); |
|
58 IMPORT_C static TBool IsBorderOutsideButtons(); |
|
59 IMPORT_C static void AdjustButtonExtentForScrollBarBorder(TPoint& aPosition,TSize& aSize,TInt aButtonType,TInt aScrollBarFlags, TBool aHorizontal, const TMargins& aMargins); |
|
60 IMPORT_C static void AdjustShaftRangeForScrollBarBorder(TInt& aShaftStart,TInt& aShaftEnd,TBool aHorizontal,TInt aScrollBarFlags,const TMargins& aMargins); |
|
61 private: |
|
62 enum TConstantType |
|
63 { |
|
64 EMinimumThumbLen, |
|
65 EDefaultFlags, |
|
66 EDefaultBreadth, |
|
67 EBorderWidth, |
|
68 EDefaultButtonPositionFlags |
|
69 }; |
|
70 private: |
|
71 IMPORT_C static TInt Constant(TConstantType aConstant); |
|
72 }; |
|
73 |
|
74 class LafArrowHeadScrollBar |
|
75 { |
|
76 public: |
|
77 IMPORT_C static void GetDefaultBorder(TGulBorder& aBorder); |
|
78 IMPORT_C static void GetBorderColors(TGulBorder::TColors& aBorderColors,const MLafEnv& aEnv,const CCoeControl& aMatchedControl); |
|
79 }; |
|
80 |
|
81 inline TInt LafScrollBar::MinimumThumbLength() |
|
82 {return Constant(EMinimumThumbLen);} |
|
83 inline TInt LafScrollBar::DefaultFlags() |
|
84 {return Constant(EDefaultFlags);} |
|
85 inline TInt LafScrollBar::DefaultBreadth() |
|
86 {return Constant(EDefaultBreadth);} |
|
87 inline TInt LafScrollBar::BorderWidth() |
|
88 {return Constant(EBorderWidth);} |
|
89 |
|
90 /** |
|
91 * Returns the button position flags which will be used if they have |
|
92 * not already been setup during scroll bar creation. |
|
93 * |
|
94 * @since App-Framework_6.1 |
|
95 */ |
|
96 inline TInt LafScrollBar::DefaultButtonPositionFlags() |
|
97 {return Constant(EDefaultButtonPositionFlags);} |
|
98 |
|
99 #endif |