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_CORE_CFWL_DATETIMEPICKER_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_DATETIMEPICKER_H_ |
8 #define XFA_FWL_CORE_CFWL_DATETIMEPICKER_H_ | 8 #define XFA_FWL_CORE_CFWL_DATETIMEPICKER_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; | 48 void DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) override; |
49 void SetThemeProvider(IFWL_ThemeProvider* pTP) override; | 49 void SetThemeProvider(IFWL_ThemeProvider* pTP) override; |
50 void OnProcessMessage(CFWL_Message* pMessage) override; | 50 void OnProcessMessage(CFWL_Message* pMessage) override; |
51 void OnDrawWidget(CFX_Graphics* pGraphics, | 51 void OnDrawWidget(CFX_Graphics* pGraphics, |
52 const CFX_Matrix* pMatrix) override; | 52 const CFX_Matrix* pMatrix) override; |
53 | 53 |
54 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); | 54 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); |
55 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); | 55 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); |
56 | 56 |
57 void SetEditText(const CFX_WideString& wsText); | 57 void SetEditText(const CFX_WideString& wsText); |
58 CFX_WideString GetEditText(int32_t nStart = 0, int32_t nCount = -1) const; | 58 CFX_WideString GetEditText() const; |
59 | 59 |
60 int32_t CountSelRanges() const { return m_pEdit->CountSelRanges(); } | 60 int32_t CountSelRanges() const { return m_pEdit->CountSelRanges(); } |
61 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const { | 61 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const { |
62 return m_pEdit->GetSelRange(nIndex, nStart); | 62 return m_pEdit->GetSelRange(nIndex, nStart); |
63 } | 63 } |
64 | 64 |
65 void GetBBox(CFX_RectF& rect) const; | 65 void GetBBox(CFX_RectF& rect) const; |
66 void SetEditLimit(int32_t nLimit) { m_pEdit->SetLimit(nLimit); } | 66 void SetEditLimit(int32_t nLimit) { m_pEdit->SetLimit(nLimit); } |
67 void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); | 67 void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
68 | 68 |
69 bool IsMonthCalendarVisible() const; | 69 bool IsMonthCalendarVisible() const; |
70 void ShowMonthCalendar(bool bActivate); | 70 void ShowMonthCalendar(bool bActivate); |
71 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); | 71 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); |
72 | 72 |
73 CFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } | 73 CFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } |
74 | 74 |
75 private: | 75 private: |
76 void DrawDropDownButton(CFX_Graphics* pGraphics, | 76 void DrawDropDownButton(CFX_Graphics* pGraphics, |
77 IFWL_ThemeProvider* pTheme, | 77 IFWL_ThemeProvider* pTheme, |
78 const CFX_Matrix* pMatrix); | 78 const CFX_Matrix* pMatrix); |
79 void FormatDateString(int32_t iYear, | 79 void FormatDateString(int32_t iYear, |
80 int32_t iMonth, | 80 int32_t iMonth, |
81 int32_t iDay, | 81 int32_t iDay, |
82 CFX_WideString& wsText); | 82 CFX_WideString& wsText); |
83 void ResetEditAlignment(); | 83 void ResetEditAlignment(); |
84 void InitProxyForm(); | 84 void InitProxyForm(); |
| 85 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
| 86 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 87 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 88 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 89 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
85 | 90 |
86 bool DisForm_IsMonthCalendarVisible() const; | 91 bool DisForm_IsMonthCalendarVisible() const; |
87 void DisForm_ShowMonthCalendar(bool bActivate); | 92 void DisForm_ShowMonthCalendar(bool bActivate); |
88 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) const; | 93 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) const; |
89 bool DisForm_IsNeedShowButton() const; | 94 bool DisForm_IsNeedShowButton() const; |
90 void DisForm_Update(); | 95 void DisForm_Update(); |
91 void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize); | 96 void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize); |
92 void DisForm_GetBBox(CFX_RectF& rect) const; | 97 void DisForm_GetBBox(CFX_RectF& rect) const; |
93 void DisForm_DrawWidget(CFX_Graphics* pGraphics, | 98 void DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix); |
94 const CFX_Matrix* pMatrix = nullptr); | |
95 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); | 99 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
96 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); | |
97 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
98 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
99 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
100 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
101 | 100 |
102 CFX_RectF m_rtBtn; | 101 CFX_RectF m_rtBtn; |
103 CFX_RectF m_rtClient; | 102 CFX_RectF m_rtClient; |
104 int32_t m_iBtnState; | 103 int32_t m_iBtnState; |
105 int32_t m_iYear; | 104 int32_t m_iYear; |
106 int32_t m_iMonth; | 105 int32_t m_iMonth; |
107 int32_t m_iDay; | 106 int32_t m_iDay; |
108 bool m_bLBtnDown; | 107 bool m_bLBtnDown; |
109 std::unique_ptr<CFWL_DateTimeEdit> m_pEdit; | 108 std::unique_ptr<CFWL_DateTimeEdit> m_pEdit; |
110 std::unique_ptr<CFWL_MonthCalendar> m_pMonthCal; | 109 std::unique_ptr<CFWL_MonthCalendar> m_pMonthCal; |
111 std::unique_ptr<CFWL_FormProxy> m_pForm; | 110 std::unique_ptr<CFWL_FormProxy> m_pForm; |
112 FX_FLOAT m_fBtn; | 111 FX_FLOAT m_fBtn; |
113 }; | 112 }; |
114 | 113 |
115 #endif // XFA_FWL_CORE_CFWL_DATETIMEPICKER_H_ | 114 #endif // XFA_FWL_CORE_CFWL_DATETIMEPICKER_H_ |
OLD | NEW |