| 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" |
| 11 #include "xfa/fwl/core/ifwl_timer.h" | 11 #include "xfa/fwl/core/ifwl_timer.h" |
| 12 | 12 |
| 13 class CFWL_WidgetImpProperties; | 13 class CFWL_WidgetImpProperties; |
| 14 class IFWL_Widget; | 14 class IFWL_Widget; |
| 15 class CFWL_ScrollBarImpDelegate; | 15 class CFWL_ScrollBarImpDelegate; |
| 16 | 16 |
| 17 class CFWL_ScrollBarImp : public CFWL_WidgetImp, public IFWL_Timer { | 17 class CFWL_ScrollBarImp : public CFWL_WidgetImp, public IFWL_Timer { |
| 18 public: | 18 public: |
| 19 CFWL_ScrollBarImp(const CFWL_WidgetImpProperties& properties, | 19 CFWL_ScrollBarImp(const CFWL_WidgetImpProperties& properties, |
| 20 IFWL_Widget* pOuter); | 20 IFWL_Widget* pOuter); |
| 21 ~CFWL_ScrollBarImp(); | 21 ~CFWL_ScrollBarImp(); |
| 22 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 22 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; |
| 23 virtual FX_DWORD GetClassID() const; | 23 virtual uint32_t GetClassID() const; |
| 24 virtual FWL_ERR Initialize(); | 24 virtual FWL_ERR Initialize(); |
| 25 virtual FWL_ERR Finalize(); | 25 virtual FWL_ERR Finalize(); |
| 26 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 26 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
| 27 virtual FWL_ERR Update(); | 27 virtual FWL_ERR Update(); |
| 28 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 28 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
| 29 const CFX_Matrix* pMatrix = NULL); | 29 const CFX_Matrix* pMatrix = NULL); |
| 30 virtual FX_BOOL IsVertical(); | 30 virtual FX_BOOL IsVertical(); |
| 31 virtual FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); | 31 virtual FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); |
| 32 virtual FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); | 32 virtual FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); |
| 33 virtual FX_FLOAT GetPageSize(); | 33 virtual FX_FLOAT GetPageSize(); |
| 34 virtual FWL_ERR SetPageSize(FX_FLOAT fPageSize); | 34 virtual FWL_ERR SetPageSize(FX_FLOAT fPageSize); |
| 35 virtual FX_FLOAT GetStepSize(); | 35 virtual FX_FLOAT GetStepSize(); |
| 36 virtual FWL_ERR SetStepSize(FX_FLOAT fStepSize); | 36 virtual FWL_ERR SetStepSize(FX_FLOAT fStepSize); |
| 37 virtual FX_FLOAT GetPos(); | 37 virtual FX_FLOAT GetPos(); |
| 38 virtual FWL_ERR SetPos(FX_FLOAT fPos); | 38 virtual FWL_ERR SetPos(FX_FLOAT fPos); |
| 39 virtual FX_FLOAT GetTrackPos(); | 39 virtual FX_FLOAT GetTrackPos(); |
| 40 virtual FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); | 40 virtual FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); |
| 41 virtual FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); | 41 virtual FX_BOOL DoScroll(uint32_t dwCode, FX_FLOAT fPos = 0.0f); |
| 42 virtual FWL_ERR SetOuter(IFWL_Widget* pOuter); | 42 virtual FWL_ERR SetOuter(IFWL_Widget* pOuter); |
| 43 virtual int32_t Run(FWL_HTIMER hTimer); | 43 virtual int32_t Run(FWL_HTIMER hTimer); |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 void DrawTrack(CFX_Graphics* pGraphics, | 46 void DrawTrack(CFX_Graphics* pGraphics, |
| 47 IFWL_ThemeProvider* pTheme, | 47 IFWL_ThemeProvider* pTheme, |
| 48 FX_BOOL bLower = TRUE, | 48 FX_BOOL bLower = TRUE, |
| 49 const CFX_Matrix* pMatrix = NULL); | 49 const CFX_Matrix* pMatrix = NULL); |
| 50 void DrawArrowBtn(CFX_Graphics* pGraphics, | 50 void DrawArrowBtn(CFX_Graphics* pGraphics, |
| 51 IFWL_ThemeProvider* pTheme, | 51 IFWL_ThemeProvider* pTheme, |
| 52 FX_BOOL bMinBtn = TRUE, | 52 FX_BOOL bMinBtn = TRUE, |
| 53 const CFX_Matrix* pMatrix = NULL); | 53 const CFX_Matrix* pMatrix = NULL); |
| 54 void DrawThumb(CFX_Graphics* pGraphics, | 54 void DrawThumb(CFX_Graphics* pGraphics, |
| 55 IFWL_ThemeProvider* pTheme, | 55 IFWL_ThemeProvider* pTheme, |
| 56 const CFX_Matrix* pMatrix = NULL); | 56 const CFX_Matrix* pMatrix = NULL); |
| 57 void Layout(); | 57 void Layout(); |
| 58 void CalcButtonLen(); | 58 void CalcButtonLen(); |
| 59 void CalcMinButtonRect(CFX_RectF& rect); | 59 void CalcMinButtonRect(CFX_RectF& rect); |
| 60 void CalcMaxButtonRect(CFX_RectF& rect); | 60 void CalcMaxButtonRect(CFX_RectF& rect); |
| 61 void CalcThumbButtonRect(CFX_RectF& rect); | 61 void CalcThumbButtonRect(CFX_RectF& rect); |
| 62 void CalcMinTrackRect(CFX_RectF& rect); | 62 void CalcMinTrackRect(CFX_RectF& rect); |
| 63 void CalcMaxTrackRect(CFX_RectF& rect); | 63 void CalcMaxTrackRect(CFX_RectF& rect); |
| 64 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); | 64 FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy); |
| 65 void GetTrackRect(CFX_RectF& rect, FX_BOOL bLower = TRUE); | 65 void GetTrackRect(CFX_RectF& rect, FX_BOOL bLower = TRUE); |
| 66 FX_BOOL SendEvent(); | 66 FX_BOOL SendEvent(); |
| 67 FX_BOOL OnScroll(FX_DWORD dwCode, FX_FLOAT fPos); | 67 FX_BOOL OnScroll(uint32_t dwCode, FX_FLOAT fPos); |
| 68 | 68 |
| 69 FWL_HTIMER m_hTimer; | 69 FWL_HTIMER m_hTimer; |
| 70 FX_FLOAT m_fRangeMin; | 70 FX_FLOAT m_fRangeMin; |
| 71 FX_FLOAT m_fRangeMax; | 71 FX_FLOAT m_fRangeMax; |
| 72 FX_FLOAT m_fPageSize; | 72 FX_FLOAT m_fPageSize; |
| 73 FX_FLOAT m_fStepSize; | 73 FX_FLOAT m_fStepSize; |
| 74 FX_FLOAT m_fPos; | 74 FX_FLOAT m_fPos; |
| 75 FX_FLOAT m_fTrackPos; | 75 FX_FLOAT m_fTrackPos; |
| 76 int32_t m_iMinButtonState; | 76 int32_t m_iMinButtonState; |
| 77 int32_t m_iMaxButtonState; | 77 int32_t m_iMaxButtonState; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 99 friend class CFWL_ScrollBarImpDelegate; | 99 friend class CFWL_ScrollBarImpDelegate; |
| 100 }; | 100 }; |
| 101 class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { | 101 class CFWL_ScrollBarImpDelegate : public CFWL_WidgetImpDelegate { |
| 102 public: | 102 public: |
| 103 CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner); | 103 CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner); |
| 104 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 104 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
| 105 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 105 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
| 106 const CFX_Matrix* pMatrix = NULL) override; | 106 const CFX_Matrix* pMatrix = NULL) override; |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 void OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 109 void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 110 void OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 110 void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 111 void OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy); | 111 void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); |
| 112 void OnMouseLeave(); | 112 void OnMouseLeave(); |
| 113 void OnMouseWheel(FX_FLOAT fx, | 113 void OnMouseWheel(FX_FLOAT fx, |
| 114 FX_FLOAT fy, | 114 FX_FLOAT fy, |
| 115 FX_DWORD dwFlags, | 115 uint32_t dwFlags, |
| 116 FX_FLOAT fDeltaX, | 116 FX_FLOAT fDeltaX, |
| 117 FX_FLOAT fDeltaY); | 117 FX_FLOAT fDeltaY); |
| 118 void DoMouseDown(int32_t iItem, | 118 void DoMouseDown(int32_t iItem, |
| 119 const CFX_RectF& rtItem, | 119 const CFX_RectF& rtItem, |
| 120 int32_t& iState, | 120 int32_t& iState, |
| 121 FX_FLOAT fx, | 121 FX_FLOAT fx, |
| 122 FX_FLOAT fy); | 122 FX_FLOAT fy); |
| 123 void DoMouseUp(int32_t iItem, | 123 void DoMouseUp(int32_t iItem, |
| 124 const CFX_RectF& rtItem, | 124 const CFX_RectF& rtItem, |
| 125 int32_t& iState, | 125 int32_t& iState, |
| 126 FX_FLOAT fx, | 126 FX_FLOAT fx, |
| 127 FX_FLOAT fy); | 127 FX_FLOAT fy); |
| 128 void DoMouseMove(int32_t iItem, | 128 void DoMouseMove(int32_t iItem, |
| 129 const CFX_RectF& rtItem, | 129 const CFX_RectF& rtItem, |
| 130 int32_t& iState, | 130 int32_t& iState, |
| 131 FX_FLOAT fx, | 131 FX_FLOAT fx, |
| 132 FX_FLOAT fy); | 132 FX_FLOAT fy); |
| 133 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 133 void DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
| 134 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); | 134 void DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState); |
| 135 | 135 |
| 136 CFWL_ScrollBarImp* m_pOwner; | 136 CFWL_ScrollBarImp* m_pOwner; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 #endif // XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ | 139 #endif // XFA_FWL_BASEWIDGET_FWL_SCROLLBARIMP_H_ |
| OLD | NEW |