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_IFWL_DATETIMEPICKER_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ |
8 #define XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ | 8 #define XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ |
9 | 9 |
10 #include "xfa/fwl/core/cfwl_event.h" | 10 #include "xfa/fwl/core/cfwl_event.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP { | 63 class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP { |
64 public: | 64 public: |
65 explicit IFWL_DateTimePicker( | 65 explicit IFWL_DateTimePicker( |
66 const IFWL_App* app, | 66 const IFWL_App* app, |
67 std::unique_ptr<CFWL_WidgetProperties> properties); | 67 std::unique_ptr<CFWL_WidgetProperties> properties); |
68 ~IFWL_DateTimePicker() override; | 68 ~IFWL_DateTimePicker() override; |
69 | 69 |
70 // IFWL_Widget | 70 // IFWL_Widget |
71 FWL_Type GetClassID() const override; | 71 FWL_Type GetClassID() const override; |
72 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 72 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
73 FWL_Error Update() override; | 73 void Update() override; |
74 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 74 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
75 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 75 void DrawWidget(CFX_Graphics* pGraphics, |
76 const CFX_Matrix* pMatrix = nullptr) override; | 76 const CFX_Matrix* pMatrix = nullptr) override; |
77 FWL_Error SetThemeProvider(IFWL_ThemeProvider* pTP) override; | 77 void SetThemeProvider(IFWL_ThemeProvider* pTP) override; |
78 void OnProcessMessage(CFWL_Message* pMessage) override; | 78 void OnProcessMessage(CFWL_Message* pMessage) override; |
79 void OnDrawWidget(CFX_Graphics* pGraphics, | 79 void OnDrawWidget(CFX_Graphics* pGraphics, |
80 const CFX_Matrix* pMatrix) override; | 80 const CFX_Matrix* pMatrix) override; |
81 | 81 |
82 FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); | 82 FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); |
83 FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); | 83 FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); |
84 FWL_Error SetEditText(const CFX_WideString& wsText); | 84 FWL_Error SetEditText(const CFX_WideString& wsText); |
85 FWL_Error GetEditText(CFX_WideString& wsText, | 85 FWL_Error GetEditText(CFX_WideString& wsText, |
86 int32_t nStart = 0, | 86 int32_t nStart = 0, |
87 int32_t nCount = -1) const; | 87 int32_t nCount = -1) const; |
88 int32_t CountSelRanges(); | 88 int32_t CountSelRanges(); |
89 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | 89 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); |
90 | 90 |
91 bool CanUndo(); | 91 bool CanUndo(); |
92 bool CanRedo(); | 92 bool CanRedo(); |
93 bool Undo(); | 93 bool Undo(); |
94 bool Redo(); | 94 bool Redo(); |
95 bool CanCopy(); | 95 bool CanCopy(); |
96 bool CanCut(); | 96 bool CanCut(); |
97 bool CanSelectAll(); | 97 bool CanSelectAll(); |
98 bool Copy(CFX_WideString& wsCopy); | 98 bool Copy(CFX_WideString& wsCopy); |
99 bool Cut(CFX_WideString& wsCut); | 99 bool Cut(CFX_WideString& wsCut); |
100 bool Paste(const CFX_WideString& wsPaste); | 100 bool Paste(const CFX_WideString& wsPaste); |
101 bool SelectAll(); | 101 bool SelectAll(); |
102 bool Delete(); | 102 bool Delete(); |
103 bool DeSelect(); | 103 bool DeSelect(); |
104 FWL_Error GetBBox(CFX_RectF& rect); | 104 FWL_Error GetBBox(CFX_RectF& rect); |
105 FWL_Error SetEditLimit(int32_t nLimit); | 105 FWL_Error SetEditLimit(int32_t nLimit); |
106 FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded, | 106 void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); |
107 uint32_t dwStylesExRemoved); | |
108 IFWL_DateTimeEdit* GetDataTimeEdit(); | 107 IFWL_DateTimeEdit* GetDataTimeEdit(); |
109 | 108 |
110 bool IsMonthCalendarShowed(); | 109 bool IsMonthCalendarShowed(); |
111 void ShowMonthCalendar(bool bActivate); | 110 void ShowMonthCalendar(bool bActivate); |
112 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); | 111 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); |
113 | 112 |
114 IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } | 113 IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } |
115 | 114 |
116 // IFWL_DataProvider | 115 // IFWL_DataProvider |
117 FWL_Error GetCaption(IFWL_Widget* pWidget, | 116 FWL_Error GetCaption(IFWL_Widget* pWidget, |
(...skipping 28 matching lines...) Expand all Loading... |
146 FX_FLOAT m_fBtn; | 145 FX_FLOAT m_fBtn; |
147 | 146 |
148 private: | 147 private: |
149 FWL_Error DisForm_Initialize(); | 148 FWL_Error DisForm_Initialize(); |
150 void DisForm_InitDateTimeCalendar(); | 149 void DisForm_InitDateTimeCalendar(); |
151 void DisForm_InitDateTimeEdit(); | 150 void DisForm_InitDateTimeEdit(); |
152 bool DisForm_IsMonthCalendarShowed(); | 151 bool DisForm_IsMonthCalendarShowed(); |
153 void DisForm_ShowMonthCalendar(bool bActivate); | 152 void DisForm_ShowMonthCalendar(bool bActivate); |
154 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); | 153 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); |
155 bool DisForm_IsNeedShowButton(); | 154 bool DisForm_IsNeedShowButton(); |
156 FWL_Error DisForm_Update(); | 155 void DisForm_Update(); |
157 FWL_Error DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); | 156 void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); |
158 FWL_Error DisForm_GetBBox(CFX_RectF& rect); | 157 FWL_Error DisForm_GetBBox(CFX_RectF& rect); |
159 FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics, | 158 void DisForm_DrawWidget(CFX_Graphics* pGraphics, |
160 const CFX_Matrix* pMatrix = nullptr); | 159 const CFX_Matrix* pMatrix = nullptr); |
161 | 160 |
162 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); | 161 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
163 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 162 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
164 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 163 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
165 void OnMouseMove(CFWL_MsgMouse* pMsg); | 164 void OnMouseMove(CFWL_MsgMouse* pMsg); |
166 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 165 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
167 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); | 166 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
168 | 167 |
169 int32_t m_iCurYear; | 168 int32_t m_iCurYear; |
170 int32_t m_iCurMonth; | 169 int32_t m_iCurMonth; |
171 int32_t m_iCurDay; | 170 int32_t m_iCurDay; |
172 }; | 171 }; |
173 | 172 |
174 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ | 173 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ |
OLD | NEW |