Chromium Code Reviews| 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; | 38 class CFWL_WidgetProperties; |
|
Tom Sepez
2016/11/03 18:22:44
nit: do we need this given the include at 12
dsinclair
2016/11/03 19:10:18
Done.
| |
| 39 class IFWL_Widget; | 39 class IFWL_Widget; |
| 40 | 40 |
| 41 struct FWL_DATEINFO; | 41 struct FWL_DATEINFO; |
| 42 | 42 |
| 43 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); | 43 extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth); |
| 44 | 44 |
| 45 class IFWL_MonthCalendarDP : public IFWL_DataProvider { | 45 class IFWL_MonthCalendarDP : public IFWL_DataProvider { |
| 46 public: | 46 public: |
| 47 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; | 47 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; |
| 48 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; | 48 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; |
| 49 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; | 49 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class IFWL_MonthCalendar : public IFWL_Widget { | 52 class IFWL_MonthCalendar : public IFWL_Widget { |
| 53 public: | 53 public: |
| 54 IFWL_MonthCalendar(const IFWL_App* app, | 54 IFWL_MonthCalendar(const IFWL_App* app, |
| 55 const CFWL_WidgetImpProperties& properties, | 55 std::unique_ptr<CFWL_WidgetProperties> properties, |
| 56 IFWL_Widget* pOuter); | 56 IFWL_Widget* pOuter); |
| 57 ~IFWL_MonthCalendar() override; | 57 ~IFWL_MonthCalendar() override; |
| 58 | 58 |
| 59 // FWL_WidgetImp | 59 // FWL_WidgetImp |
| 60 FWL_Type GetClassID() const override; | 60 FWL_Type GetClassID() const override; |
| 61 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 61 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
| 62 FWL_Error Update() override; | 62 FWL_Error Update() override; |
| 63 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 63 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 64 const CFX_Matrix* pMatrix = nullptr) override; | 64 const CFX_Matrix* pMatrix = nullptr) override; |
| 65 void OnProcessMessage(CFWL_Message* pMessage) override; | 65 void OnProcessMessage(CFWL_Message* pMessage) override; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 ~FWL_DATEINFO(); | 257 ~FWL_DATEINFO(); |
| 258 | 258 |
| 259 int32_t iDay; | 259 int32_t iDay; |
| 260 int32_t iDayOfWeek; | 260 int32_t iDayOfWeek; |
| 261 uint32_t dwStates; | 261 uint32_t dwStates; |
| 262 CFX_RectF rect; | 262 CFX_RectF rect; |
| 263 CFX_WideString wsDay; | 263 CFX_WideString wsDay; |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ | 266 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ |
| OLD | NEW |