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_MONTHCALENDARIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ |
9 | 9 |
10 #include "xfa/fgas/localization/fgas_datetime.h" | 10 #include "xfa/fgas/localization/fgas_datetime.h" |
11 #include "xfa/fwl/core/fwl_widgetimp.h" | 11 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 12 #include "xfa/fwl/core/ifwl_widget.h" |
12 | 13 |
13 class CFWL_MonthCalendarImpDelegate; | 14 class CFWL_MonthCalendarImpDelegate; |
14 class CFWL_MsgMouse; | 15 class CFWL_MsgMouse; |
15 class CFWL_WidgetImpProperties; | 16 class CFWL_WidgetImpProperties; |
16 class IFWL_Widget; | 17 class IFWL_Widget; |
17 | 18 |
18 struct FWL_DATEINFO; | 19 struct FWL_DATEINFO; |
19 | 20 |
20 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); | 21 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); |
21 | 22 |
22 class CFWL_MonthCalendarImp : public CFWL_WidgetImp { | 23 class CFWL_MonthCalendarImp : public CFWL_WidgetImp { |
23 public: | 24 public: |
24 CFWL_MonthCalendarImp(const CFWL_WidgetImpProperties& properties, | 25 CFWL_MonthCalendarImp(const CFWL_WidgetImpProperties& properties, |
25 IFWL_Widget* pOuter); | 26 IFWL_Widget* pOuter); |
26 ~CFWL_MonthCalendarImp(); | 27 ~CFWL_MonthCalendarImp() override; |
27 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 28 |
28 virtual uint32_t GetClassID() const; | 29 FWL_ERR GetClassName(CFX_WideString& wsClass) const override; |
29 virtual FWL_ERR Initialize(); | 30 FWL_Type GetClassID() const override { return FWL_Type::MonthCalendar; } |
30 virtual FWL_ERR Finalize(); | 31 FWL_ERR Initialize() override; |
31 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 32 FWL_ERR Finalize() override; |
32 virtual FWL_ERR Update(); | 33 FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
33 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 34 FWL_ERR Update() override; |
34 const CFX_Matrix* pMatrix = NULL); | 35 FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
35 virtual int32_t CountSelect(); | 36 const CFX_Matrix* pMatrix = nullptr) override; |
36 virtual FX_BOOL GetSelect(int32_t& iYear, | 37 int32_t CountSelect(); |
37 int32_t& iMonth, | 38 FX_BOOL GetSelect(int32_t& iYear, |
38 int32_t& iDay, | 39 int32_t& iMonth, |
39 int32_t nIndex = 0); | 40 int32_t& iDay, |
40 virtual FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); | 41 int32_t nIndex = 0); |
| 42 FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); |
41 | 43 |
42 protected: | 44 protected: |
43 struct DATE { | 45 struct DATE { |
44 DATE() : iYear(0), iMonth(0), iDay(0) {} | 46 DATE() : iYear(0), iMonth(0), iDay(0) {} |
45 DATE(int32_t year, int32_t month, int32_t day) | 47 DATE(int32_t year, int32_t month, int32_t day) |
46 : iYear(year), iMonth(month), iDay(day) {} | 48 : iYear(year), iMonth(month), iDay(day) {} |
47 FX_BOOL operator<(const DATE& right) { | 49 FX_BOOL operator<(const DATE& right) { |
48 if (iYear < right.iYear) { | 50 if (iYear < right.iYear) { |
49 return TRUE; | 51 return TRUE; |
50 } else if (iYear == right.iYear) { | 52 } else if (iYear == right.iYear) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void OnActivate(CFWL_Message* pMsg); | 239 void OnActivate(CFWL_Message* pMsg); |
238 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 240 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
239 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 241 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
240 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 242 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
241 void OnMouseMove(CFWL_MsgMouse* pMsg); | 243 void OnMouseMove(CFWL_MsgMouse* pMsg); |
242 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 244 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
243 CFWL_MonthCalendarImp* m_pOwner; | 245 CFWL_MonthCalendarImp* m_pOwner; |
244 }; | 246 }; |
245 | 247 |
246 #endif // XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ | 248 #endif // XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ |
OLD | NEW |