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_widgetproperties.h" | 12 #include "xfa/fwl/core/cfwl_widgetproperties.h" |
13 #include "xfa/fwl/core/ifwl_dataprovider.h" | |
14 #include "xfa/fwl/core/ifwl_widget.h" | 13 #include "xfa/fwl/core/ifwl_widget.h" |
15 | 14 |
16 #define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) | 15 #define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) |
17 #define FWL_STYLEEXT_MCD_NoToday (1L << 1) | 16 #define FWL_STYLEEXT_MCD_NoToday (1L << 1) |
18 #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) | 17 #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) |
19 #define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) | 18 #define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) |
20 #define FWL_ITEMSTATE_MCD_Nomal (0L << 0) | 19 #define FWL_ITEMSTATE_MCD_Nomal (0L << 0) |
21 #define FWL_ITEMSTATE_MCD_Flag (1L << 0) | 20 #define FWL_ITEMSTATE_MCD_Flag (1L << 0) |
22 #define FWL_ITEMSTATE_MCD_Selected (1L << 1) | 21 #define FWL_ITEMSTATE_MCD_Selected (1L << 1) |
23 #define FWL_ITEMSTATE_MCD_Focused (1L << 2) | 22 #define FWL_ITEMSTATE_MCD_Focused (1L << 2) |
24 | 23 |
25 class CFWL_MsgMouse; | 24 class CFWL_MsgMouse; |
26 class IFWL_Widget; | 25 class IFWL_Widget; |
27 | 26 |
28 class IFWL_MonthCalendarDP : public IFWL_DataProvider { | |
29 public: | |
30 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; | |
31 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; | |
32 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; | |
33 }; | |
34 | |
35 class IFWL_MonthCalendar : public IFWL_Widget { | 27 class IFWL_MonthCalendar : public IFWL_Widget { |
36 public: | 28 public: |
| 29 class DataProvider : public IFWL_Widget::DataProvider { |
| 30 public: |
| 31 virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; |
| 32 virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; |
| 33 virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; |
| 34 }; |
| 35 |
37 IFWL_MonthCalendar(const IFWL_App* app, | 36 IFWL_MonthCalendar(const IFWL_App* app, |
38 std::unique_ptr<CFWL_WidgetProperties> properties, | 37 std::unique_ptr<CFWL_WidgetProperties> properties, |
39 IFWL_Widget* pOuter); | 38 IFWL_Widget* pOuter); |
40 ~IFWL_MonthCalendar() override; | 39 ~IFWL_MonthCalendar() override; |
41 | 40 |
42 // FWL_WidgetImp | 41 // FWL_WidgetImp |
43 FWL_Type GetClassID() const override; | 42 FWL_Type GetClassID() const override; |
44 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 43 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
45 void Update() override; | 44 void Update() override; |
46 void DrawWidget(CFX_Graphics* pGraphics, | 45 void DrawWidget(CFX_Graphics* pGraphics, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 FX_FLOAT m_fDateCellHei; | 224 FX_FLOAT m_fDateCellHei; |
226 FX_FLOAT m_fTodayWid; | 225 FX_FLOAT m_fTodayWid; |
227 FX_FLOAT m_fTodayHei; | 226 FX_FLOAT m_fTodayHei; |
228 FX_FLOAT m_fTodayFlagWid; | 227 FX_FLOAT m_fTodayFlagWid; |
229 FX_FLOAT m_fMCWid; | 228 FX_FLOAT m_fMCWid; |
230 FX_FLOAT m_fMCHei; | 229 FX_FLOAT m_fMCHei; |
231 bool m_bFlag; | 230 bool m_bFlag; |
232 }; | 231 }; |
233 | 232 |
234 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ | 233 #endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_ |
OLD | NEW |