OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ | 7 #ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ |
8 #define XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ | 8 #define XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ |
9 | 9 |
10 class CFWL_WidgetImpProperties; | 10 #include "xfa/src/fwl/src/core/include/fwl_widgetimp.h" |
11 class IFWL_Widget; | 11 |
12 class IFWL_ScrollBarDP; | |
13 class IFWL_ScrollBar; | |
14 #define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR" | 12 #define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR" |
15 #define FWL_CLASSHASH_ScrollBar 2826584844 | 13 #define FWL_CLASSHASH_ScrollBar 2826584844 |
16 #define FWL_STYLEEXT_SCB_Horz (0L << 0) | 14 #define FWL_STYLEEXT_SCB_Horz (0L << 0) |
17 #define FWL_STYLEEXT_SCB_Vert (1L << 0) | 15 #define FWL_STYLEEXT_SCB_Vert (1L << 0) |
18 #define FWL_PART_SCB_Border 1 | 16 #define FWL_PART_SCB_Border 1 |
19 #define FWL_PART_SCB_Edge 2 | 17 #define FWL_PART_SCB_Edge 2 |
20 #define FWL_PART_SCB_Background 3 | 18 #define FWL_PART_SCB_Background 3 |
21 #define FWL_PART_SCB_ForeArrow 4 | 19 #define FWL_PART_SCB_ForeArrow 4 |
22 #define FWL_PART_SCB_BackArrow 5 | 20 #define FWL_PART_SCB_BackArrow 5 |
23 #define FWL_PART_SCB_Thumb 6 | 21 #define FWL_PART_SCB_Thumb 6 |
24 #define FWL_PART_SCB_LowerTrack 7 | 22 #define FWL_PART_SCB_LowerTrack 7 |
25 #define FWL_PART_SCB_UpperTrack 8 | 23 #define FWL_PART_SCB_UpperTrack 8 |
26 #define FWL_PARTSTATE_SCB_Normal (0L << 0) | 24 #define FWL_PARTSTATE_SCB_Normal (0L << 0) |
27 #define FWL_PARTSTATE_SCB_Hovered (1L << 0) | 25 #define FWL_PARTSTATE_SCB_Hovered (1L << 0) |
28 #define FWL_PARTSTATE_SCB_Pressed (2L << 0) | 26 #define FWL_PARTSTATE_SCB_Pressed (2L << 0) |
29 #define FWL_PARTSTATE_SCB_Disabled (3L << 0) | 27 #define FWL_PARTSTATE_SCB_Disabled (3L << 0) |
30 #define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1 | 28 #define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1 |
31 #define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2 | 29 #define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2 |
32 #define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3 | 30 #define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3 |
33 #define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4 | 31 #define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4 |
34 #define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5 | 32 #define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5 |
35 #define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX | 33 #define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX |
| 34 |
36 enum FWL_SCBCODE { | 35 enum FWL_SCBCODE { |
37 FWL_SCBCODE_None = 1, | 36 FWL_SCBCODE_None = 1, |
38 FWL_SCBCODE_Min, | 37 FWL_SCBCODE_Min, |
39 FWL_SCBCODE_Max, | 38 FWL_SCBCODE_Max, |
40 FWL_SCBCODE_PageBackward, | 39 FWL_SCBCODE_PageBackward, |
41 FWL_SCBCODE_PageForward, | 40 FWL_SCBCODE_PageForward, |
42 FWL_SCBCODE_StepBackward, | 41 FWL_SCBCODE_StepBackward, |
43 FWL_SCBCODE_StepForward, | 42 FWL_SCBCODE_StepForward, |
44 FWL_SCBCODE_Pos, | 43 FWL_SCBCODE_Pos, |
45 FWL_SCBCODE_TrackPos, | 44 FWL_SCBCODE_TrackPos, |
46 FWL_SCBCODE_EndScroll, | 45 FWL_SCBCODE_EndScroll, |
47 }; | 46 }; |
| 47 |
48 class IFWL_ScrollBarDP : public IFWL_DataProvider {}; | 48 class IFWL_ScrollBarDP : public IFWL_DataProvider {}; |
| 49 |
49 class IFWL_ScrollBar : public IFWL_Widget { | 50 class IFWL_ScrollBar : public IFWL_Widget { |
50 public: | 51 public: |
51 static IFWL_ScrollBar* Create(const CFWL_WidgetImpProperties& properties, | 52 static IFWL_ScrollBar* Create(const CFWL_WidgetImpProperties& properties, |
52 IFWL_Widget* pOuter); | 53 IFWL_Widget* pOuter); |
53 | 54 |
54 FX_BOOL IsVertical(); | 55 FX_BOOL IsVertical(); |
55 FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); | 56 FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); |
56 FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); | 57 FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); |
57 FX_FLOAT GetPageSize(); | 58 FX_FLOAT GetPageSize(); |
58 FWL_ERR SetPageSize(FX_FLOAT fPageSize); | 59 FWL_ERR SetPageSize(FX_FLOAT fPageSize); |
59 FX_FLOAT GetStepSize(); | 60 FX_FLOAT GetStepSize(); |
60 FWL_ERR SetStepSize(FX_FLOAT fStepSize); | 61 FWL_ERR SetStepSize(FX_FLOAT fStepSize); |
61 FX_FLOAT GetPos(); | 62 FX_FLOAT GetPos(); |
62 FWL_ERR SetPos(FX_FLOAT fPos); | 63 FWL_ERR SetPos(FX_FLOAT fPos); |
63 FX_FLOAT GetTrackPos(); | 64 FX_FLOAT GetTrackPos(); |
64 FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); | 65 FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); |
65 FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); | 66 FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); |
66 | 67 |
67 protected: | 68 protected: |
68 IFWL_ScrollBar(); | 69 IFWL_ScrollBar(); |
69 }; | 70 }; |
70 | 71 |
71 #endif // XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ | 72 #endif // XFA_INCLUDE_FWL_BASEWIDGET_FWL_SCROLLBAR_H_ |
OLD | NEW |