Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1511)

Unified Diff: xfa/fwl/core/ifwl_monthcalendar.h

Issue 2432423002: Merge the CFWL_*Imp classes into the IFWL_* classes. (Closed)
Patch Set: Review feedback Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.cpp ('k') | xfa/fwl/core/ifwl_monthcalendar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_monthcalendar.h
diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.h b/xfa/fwl/core/ifwl_monthcalendar.h
similarity index 81%
rename from xfa/fwl/basewidget/fwl_monthcalendarimp.h
rename to xfa/fwl/core/ifwl_monthcalendar.h
index 2716f59f959d67950b0761e854fc258fd6d81b3e..340acf0bcca9e8a98932a798fb415f9b97279aca 100644
--- a/xfa/fwl/basewidget/fwl_monthcalendarimp.h
+++ b/xfa/fwl/core/ifwl_monthcalendar.h
@@ -4,15 +4,37 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_
-#define XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_
-
-#include <memory>
+#ifndef XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_
+#define XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_
#include "xfa/fgas/localization/fgas_datetime.h"
-#include "xfa/fwl/core/fwl_widgetimp.h"
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
+#include "xfa/fwl/core/ifwl_dataprovider.h"
#include "xfa/fwl/core/ifwl_widget.h"
+#define FWL_CLASS_MonthCalendar L"FWL_MONTHCALENDAR"
+#define FWL_STYLEEXT_MCD_MultiSelect (1L << 0)
+#define FWL_STYLEEXT_MCD_NoToday (1L << 1)
+#define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2)
+#define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3)
+#define FWL_ITEMSTATE_MCD_Nomal (0L << 0)
+#define FWL_ITEMSTATE_MCD_Flag (1L << 0)
+#define FWL_ITEMSTATE_MCD_Selected (1L << 1)
+#define FWL_ITEMSTATE_MCD_Focused (1L << 2)
+
+FWL_EVENT_DEF(CFWL_Event_McdDateSelected,
+ CFWL_EventType::DataSelected,
+ int32_t m_iStartDay;
+ int32_t m_iEndDay;)
+
+FWL_EVENT_DEF(CFWL_EventMcdDateChanged,
+ CFWL_EventType::DateChanged,
+ int32_t m_iOldYear;
+ int32_t m_iOldMonth;
+ int32_t m_iStartDay;
+ int32_t m_iEndDay;)
+
class CFWL_MonthCalendarImpDelegate;
class CFWL_MsgMouse;
class CFWL_WidgetImpProperties;
@@ -22,11 +44,21 @@ struct FWL_DATEINFO;
extern uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
-class CFWL_MonthCalendarImp : public CFWL_WidgetImp {
+class IFWL_MonthCalendarDP : public IFWL_DataProvider {
public:
- CFWL_MonthCalendarImp(const CFWL_WidgetImpProperties& properties,
- IFWL_Widget* pOuter);
- ~CFWL_MonthCalendarImp() override;
+ virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0;
+ virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0;
+ virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0;
+};
+
+class IFWL_MonthCalendar : public IFWL_Widget {
+ public:
+ static IFWL_MonthCalendar* Create(const CFWL_WidgetImpProperties& properties,
+ IFWL_Widget* pOuter);
+
+ IFWL_MonthCalendar(const CFWL_WidgetImpProperties& properties,
+ IFWL_Widget* pOuter);
+ ~IFWL_MonthCalendar() override;
// FWL_WidgetImp
FWL_Error GetClassName(CFX_WideString& wsClass) const override;
@@ -230,7 +262,7 @@ struct FWL_DATEINFO {
class CFWL_MonthCalendarImpDelegate : public CFWL_WidgetImpDelegate {
public:
- CFWL_MonthCalendarImpDelegate(CFWL_MonthCalendarImp* pOwner);
+ CFWL_MonthCalendarImpDelegate(IFWL_MonthCalendar* pOwner);
void OnProcessMessage(CFWL_Message* pMessage) override;
void OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
@@ -242,7 +274,7 @@ class CFWL_MonthCalendarImpDelegate : public CFWL_WidgetImpDelegate {
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
void OnMouseLeave(CFWL_MsgMouse* pMsg);
- CFWL_MonthCalendarImp* m_pOwner;
+ IFWL_MonthCalendar* m_pOwner;
};
-#endif // XFA_FWL_BASEWIDGET_FWL_MONTHCALENDARIMP_H_
+#endif // XFA_FWL_CORE_IFWL_MONTHCALENDAR_H_
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.cpp ('k') | xfa/fwl/core/ifwl_monthcalendar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698