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