From eb3f68cc7f25a1e28464eb251161b8f08fcd04bc Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 7 Nov 2016 10:28:47 -0800 Subject: Fold DataProviders into parent classes This CL removes the data provider classes and folds the code into the parent classes. Review-Url: https://codereview.chromium.org/2480233003 --- xfa/fwl/core/ifwl_datetimepicker.h | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'xfa/fwl/core/ifwl_datetimepicker.h') diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h index 8ebe54ad25..5e4ca5eeb7 100644 --- a/xfa/fwl/core/ifwl_datetimepicker.h +++ b/xfa/fwl/core/ifwl_datetimepicker.h @@ -60,7 +60,7 @@ class IFWL_DateTimePickerDP : public IFWL_DataProvider { int32_t& iDay) = 0; }; -class IFWL_DateTimePicker : public IFWL_Widget { +class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP { public: explicit IFWL_DateTimePicker( const IFWL_App* app, @@ -113,25 +113,16 @@ class IFWL_DateTimePicker : public IFWL_Widget { IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } - protected: - class CFWL_MonthCalendarImpDP : public IFWL_MonthCalendarDP { - public: - CFWL_MonthCalendarImpDP(); - - // IFWL_DataProvider - FWL_Error GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption) override; - - // IFWL_MonthCalendarDP - int32_t GetCurDay(IFWL_Widget* pWidget) override; - int32_t GetCurMonth(IFWL_Widget* pWidget) override; - int32_t GetCurYear(IFWL_Widget* pWidget) override; + // IFWL_DataProvider + FWL_Error GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) override; - int32_t m_iCurDay; - int32_t m_iCurYear; - int32_t m_iCurMonth; - }; + // IFWL_MonthCalendarDP + int32_t GetCurDay(IFWL_Widget* pWidget) override; + int32_t GetCurMonth(IFWL_Widget* pWidget) override; + int32_t GetCurYear(IFWL_Widget* pWidget) override; + protected: void DrawDropDownButton(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix); @@ -153,7 +144,6 @@ class IFWL_DateTimePicker : public IFWL_Widget { std::unique_ptr m_pMonthCal; std::unique_ptr m_pForm; FX_FLOAT m_fBtn; - CFWL_MonthCalendarImpDP m_MonthCalendarDP; private: FWL_Error DisForm_Initialize(); @@ -175,6 +165,10 @@ class IFWL_DateTimePicker : public IFWL_Widget { void OnMouseMove(CFWL_MsgMouse* pMsg); void OnMouseLeave(CFWL_MsgMouse* pMsg); void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); + + int32_t m_iCurYear; + int32_t m_iCurMonth; + int32_t m_iCurDay; }; #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ -- cgit v1.2.3