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_MONTHCALENDAR_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ |
8 #define XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ | 8 #define XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ |
9 | 9 |
10 #include "xfa/fgas/localization/fgas_datetime.h" | 10 #include "xfa/fgas/localization/fgas_datetime.h" |
11 #include "xfa/fwl/core/cfwl_event.h" | 11 #include "xfa/fwl/core/cfwl_event.h" |
12 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" | 12 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
13 #include "xfa/fwl/core/ifwl_dataprovider.h" | 13 #include "xfa/fwl/core/ifwl_dataprovider.h" |
14 #include "xfa/fwl/core/ifwl_widget.h" | 14 #include "xfa/fwl/core/ifwl_widget.h" |
15 | 15 |
16 #define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) | 16 #define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) |
17 #define FWL_STYLEEXT_MCD_NoToday (1L << 1) | 17 #define FWL_STYLEEXT_MCD_NoToday (1L << 1) |
18 #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) | 18 #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) |
19 #define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) | 19 #define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) |
20 #define FWL_ITEMSTATE_MCD_Nomal (0L << 0) | 20 #define FWL_ITEMSTATE_MCD_Nomal (0L << 0) |
21 #define FWL_ITEMSTATE_MCD_Flag (1L << 0) | 21 #define FWL_ITEMSTATE_MCD_Flag (1L << 0) |
22 #define FWL_ITEMSTATE_MCD_Selected (1L << 1) | 22 #define FWL_ITEMSTATE_MCD_Selected (1L << 1) |
23 #define FWL_ITEMSTATE_MCD_Focused (1L << 2) | 23 #define FWL_ITEMSTATE_MCD_Focused (1L << 2) |
24 | 24 |
25 FWL_EVENT_DEF(CFWL_Event_McdDateSelected, | 25 FWL_EVENT_DEF(CFWL_Event_McdDateSelected, |
26 CFWL_EventType::DataSelected, | 26 CFWL_EventType::DataSelected, |
27 int32_t m_iStartDay; | 27 int32_t m_iStartDay; |
28 int32_t m_iEndDay;) | 28 int32_t m_iEndDay;) |
29 | 29 |
30 FWL_EVENT_DEF(CFWL_EventMcdDateChanged, | 30 FWL_EVENT_DEF(CFWL_EventMcdDateChanged, |
31 CFWL_EventType::DateChanged, | 31 CFWL_EventType::DateChanged, |
32 int32_t m_iOldYear; | 32 int32_t m_iOldYear; |
33 int32_t m_iOldMonth; | 33 int32_t m_iOldMonth; |
34 int32_t m_iStartDay; | 34 int32_t m_iStartDay; |
35 int32_t m_iEndDay;) | 35 int32_t m_iEndDay;) |
36 | 36 |
37 class CFWL_MsgMouse; | 37 class CFWL_MsgMouse; |
38 class CFWL_WidgetImpProperties; | |
39 class IFWL_Widget; | 38 class IFWL_Widget; |
40 | 39 |
41 struct FWL_DATEINFO; | 40 struct FWL_DATEINFO; |
42 | 41 |
43 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); | 42 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); |
44 | 43 |
45 class IFWL_MonthCalendarDP : public IFWL_DataProvider { | 44 class IFWL_MonthCalendarDP : public IFWL_DataProvider { |
46 public: | 45 public: |
47 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; | 46 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; |
48 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; | 47 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; |
49 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; | 48 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; |
50 }; | 49 }; |
51 | 50 |
52 class IFWL_MonthCalendar : public IFWL_Widget { | 51 class IFWL_MonthCalendar : public IFWL_Widget { |
53 public: | 52 public: |
54 IFWL_MonthCalendar(const IFWL_App* app, | 53 IFWL_MonthCalendar(const IFWL_App* app, |
55 const CFWL_WidgetImpProperties& properties, | 54 std::unique_ptr<CFWL_WidgetProperties> properties, |
56 IFWL_Widget* pOuter); | 55 IFWL_Widget* pOuter); |
57 ~IFWL_MonthCalendar() override; | 56 ~IFWL_MonthCalendar() override; |
58 | 57 |
59 // FWL_WidgetImp | 58 // FWL_WidgetImp |
60 FWL_Type GetClassID() const override; | 59 FWL_Type GetClassID() const override; |
61 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 60 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
62 FWL_Error Update() override; | 61 FWL_Error Update() override; |
63 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 62 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
64 const CFX_Matrix* pMatrix = nullptr) override; | 63 const CFX_Matrix* pMatrix = nullptr) override; |
65 void OnProcessMessage(CFWL_Message* pMessage) override; | 64 void OnProcessMessage(CFWL_Message* pMessage) override; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 ~FWL_DATEINFO(); | 256 ~FWL_DATEINFO(); |
258 | 257 |
259 int32_t iDay; | 258 int32_t iDay; |
260 int32_t iDayOfWeek; | 259 int32_t iDayOfWeek; |
261 uint32_t dwStates; | 260 uint32_t dwStates; |
262 CFX_RectF rect; | 261 CFX_RectF rect; |
263 CFX_WideString wsDay; | 262 CFX_WideString wsDay; |
264 }; | 263 }; |
265 | 264 |
266 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ | 265 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ |
OLD | NEW |