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_Error GetClassName(CFX_WideString& wsClass) const; | 28 |
28 virtual uint32_t GetClassID() const; | 29 // FWL_WidgetImp |
29 virtual FWL_Error Initialize(); | 30 FWL_Error GetClassName(CFX_WideString& wsClass) const override; |
30 virtual FWL_Error Finalize(); | 31 FWL_Type GetClassID() const override; |
31 virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 32 FWL_Error Initialize() override; |
32 virtual FWL_Error Update(); | 33 FWL_Error Finalize() override; |
33 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 34 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
34 const CFX_Matrix* pMatrix = NULL); | 35 FWL_Error Update() override; |
35 virtual int32_t CountSelect(); | 36 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
36 virtual FX_BOOL GetSelect(int32_t& iYear, | 37 const CFX_Matrix* pMatrix = nullptr) override; |
37 int32_t& iMonth, | 38 int32_t CountSelect(); |
38 int32_t& iDay, | 39 FX_BOOL GetSelect(int32_t& iYear, |
39 int32_t nIndex = 0); | 40 int32_t& iMonth, |
40 virtual FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); | 41 int32_t& iDay, |
| 42 int32_t nIndex = 0); |
| 43 FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); |
41 | 44 |
42 protected: | 45 protected: |
43 struct DATE { | 46 struct DATE { |
44 DATE() : iYear(0), iMonth(0), iDay(0) {} | 47 DATE() : iYear(0), iMonth(0), iDay(0) {} |
45 DATE(int32_t year, int32_t month, int32_t day) | 48 DATE(int32_t year, int32_t month, int32_t day) |
46 : iYear(year), iMonth(month), iDay(day) {} | 49 : iYear(year), iMonth(month), iDay(day) {} |
47 FX_BOOL operator<(const DATE& right) { | 50 FX_BOOL operator<(const DATE& right) { |
48 if (iYear < right.iYear) { | 51 if (iYear < right.iYear) { |
49 return TRUE; | 52 return TRUE; |
50 } else if (iYear == right.iYear) { | 53 } else if (iYear == right.iYear) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void OnActivate(CFWL_Message* pMsg); | 240 void OnActivate(CFWL_Message* pMsg); |
238 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 241 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
239 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 242 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
240 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 243 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
241 void OnMouseMove(CFWL_MsgMouse* pMsg); | 244 void OnMouseMove(CFWL_MsgMouse* pMsg); |
242 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 245 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
243 CFWL_MonthCalendarImp* m_pOwner; | 246 CFWL_MonthCalendarImp* m_pOwner; |
244 }; | 247 }; |
245 | 248 |
246 #endif // XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ | 249 #endif // XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_ |
OLD | NEW |