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_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_widgetimp.h" | 10 #include "xfa/fwl/core/fwl_widgetimp.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 FWL_Error SetTrackPos(FX_FLOAT fTrackPos); | 47 FWL_Error SetTrackPos(FX_FLOAT fTrackPos); |
48 FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f); | 48 FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f); |
49 FWL_Error SetOuter(IFWL_Widget* pOuter); | 49 FWL_Error SetOuter(IFWL_Widget* pOuter); |
50 | 50 |
51 protected: | 51 protected: |
52 friend class CFWL_ScrollBarImpDelegate; | 52 friend class CFWL_ScrollBarImpDelegate; |
53 | 53 |
54 void DrawTrack(CFX_Graphics* pGraphics, | 54 void DrawTrack(CFX_Graphics* pGraphics, |
55 IFWL_ThemeProvider* pTheme, | 55 IFWL_ThemeProvider* pTheme, |
56 FX_BOOL bLower = TRUE, | 56 FX_BOOL bLower = TRUE, |
57 const CFX_Matrix* pMatrix = NULL); | 57 const CFX_Matrix* pMatrix = nullptr); |
58 void DrawArrowBtn(CFX_Graphics* pGraphics, | 58 void DrawArrowBtn(CFX_Graphics* pGraphics, |
59 IFWL_ThemeProvider* pTheme, | 59 IFWL_ThemeProvider* pTheme, |
60 FX_BOOL bMinBtn = TRUE, | 60 FX_BOOL bMinBtn = TRUE, |
61 const CFX_Matrix* pMatrix = NULL); | 61 const CFX_Matrix* pMatrix = nullptr); |
62 void DrawThumb(CFX_Graphics* pGraphics, | 62 void DrawThumb(CFX_Graphics* pGraphics, |
63 IFWL_ThemeProvider* pTheme, | 63 IFWL_ThemeProvider* pTheme, |
64 const CFX_Matrix* pMatrix = NULL); | 64 const CFX_Matrix* pMatrix = nullptr); |
65 void Layout(); | 65 void Layout(); |
66 void CalcButtonLen(); | 66 void CalcButtonLen(); |
67 void CalcMinButtonRect(CFX_RectF& rect); | 67 void CalcMinButtonRect(CFX_RectF& rect); |
68 void CalcMaxButtonRect(CFX_RectF& rect); | 68 void CalcMaxButtonRect(CFX_RectF& rect); |
69 void CalcThumbButtonRect(CFX_RectF& rect); | 69 void CalcThumbButtonRect(CFX_RectF& rect); |
70 void CalcMinTrackRect(CFX_RectF& rect); | 70 void CalcMinTrackRect(CFX_RectF& rect); |
71 void CalcMaxTrackRect(CFX_RectF& rect); | 71 void CalcMaxTrackRect(CFX_RectF& rect); |
72 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); | 72 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); |
73 void GetTrackRect(CFX_RectF& rect, FX_BOOL bLower = TRUE); | 73 void GetTrackRect(CFX_RectF& rect, FX_BOOL bLower = TRUE); |
74 FX_BOOL SendEvent(); | 74 FX_BOOL SendEvent(); |
(...skipping 29 matching lines...) Expand all Loading... |
104 CFX_RectF m_rtMaxTrack; | 104 CFX_RectF m_rtMaxTrack; |
105 FX_BOOL m_bCustomLayout; | 105 FX_BOOL m_bCustomLayout; |
106 FX_FLOAT m_fMinThumb; | 106 FX_FLOAT m_fMinThumb; |
107 }; | 107 }; |
108 | 108 |
109 class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { | 109 class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { |
110 public: | 110 public: |
111 CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner); | 111 CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner); |
112 void OnProcessMessage(CFWL_Message* pMessage) override; | 112 void OnProcessMessage(CFWL_Message* pMessage) override; |
113 void OnDrawWidget(CFX_Graphics* pGraphics, | 113 void OnDrawWidget(CFX_Graphics* pGraphics, |
114 const CFX_Matrix* pMatrix = NULL) override; | 114 const CFX_Matrix* pMatrix = nullptr) override; |
115 | 115 |
116 protected: | 116 protected: |
117 void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 117 void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
118 void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 118 void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
119 void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 119 void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
120 void OnMouseLeave(); | 120 void OnMouseLeave(); |
121 void OnMouseWheel(FX_FLOAT fx, | 121 void OnMouseWheel(FX_FLOAT fx, |
122 FX_FLOAT fy, | 122 FX_FLOAT fy, |
123 uint32_t dwFlags, | 123 uint32_t dwFlags, |
124 FX_FLOAT fDeltaX, | 124 FX_FLOAT fDeltaX, |
(...skipping 13 matching lines...) Expand all Loading... |
138 int32_t& iState, | 138 int32_t& iState, |
139 FX_FLOAT fx, | 139 FX_FLOAT fx, |
140 FX_FLOAT fy); | 140 FX_FLOAT fy); |
141 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 141 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
142 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 142 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
143 | 143 |
144 CFWL_ScrollBarImp* m_pOwner; | 144 CFWL_ScrollBarImp* m_pOwner; |
145 }; | 145 }; |
146 | 146 |
147 #endif // XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ | 147 #endif // XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ |
OLD | NEW |