summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_datetimepicker.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-02 14:51:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 14:51:25 -0700
commit3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 (patch)
tree365d9ee7f8eec1103fb9fce0986e23d9f548ecae /xfa/fwl/core/ifwl_datetimepicker.h
parent4cf551577856f89103e162edc761def44ffb96fc (diff)
downloadpdfium-3b3ce1a242f8445848d3f23d6c35ba01d7c645f4.tar.xz
Merge delegates into IFWL_* classes.
This Cl removes ownership of the delgates from IFWL_Widget and puts it in the hand of the creating classes. In doing so, merge the delegates back into the IFWL_* classes to simplify logic. Review-Url: https://codereview.chromium.org/2467993003
Diffstat (limited to 'xfa/fwl/core/ifwl_datetimepicker.h')
-rw-r--r--xfa/fwl/core/ifwl_datetimepicker.h36
1 files changed, 11 insertions, 25 deletions
diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h
index 5b360d3603..04d2869c54 100644
--- a/xfa/fwl/core/ifwl_datetimepicker.h
+++ b/xfa/fwl/core/ifwl_datetimepicker.h
@@ -74,6 +74,9 @@ class IFWL_DateTimePicker : public IFWL_Widget {
FWL_Error DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr) override;
FWL_Error SetThemeProvider(IFWL_ThemeProvider* pTP) override;
+ void OnProcessMessage(CFWL_Message* pMessage) override;
+ void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) override;
FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
@@ -103,12 +106,13 @@ class IFWL_DateTimePicker : public IFWL_Widget {
uint32_t dwStylesExRemoved);
IFWL_DateTimeEdit* GetDataTimeEdit();
- protected:
- friend class CFWL_DateTimeEditImpDelegate;
- friend class IFWL_DateTimeCalendar;
- friend class CFWL_DateTimeCalendarImpDelegate;
- friend class CFWL_DateTimePickerImpDelegate;
+ FX_BOOL IsMonthCalendarShowed();
+ void ShowMonthCalendar(FX_BOOL bActivate);
+ void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
+ IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); }
+
+ protected:
class CFWL_MonthCalendarImpDP : public IFWL_MonthCalendarDP {
public:
CFWL_MonthCalendarImpDP();
@@ -134,11 +138,8 @@ class IFWL_DateTimePicker : public IFWL_Widget {
int32_t iMonth,
int32_t iDay,
CFX_WideString& wsText);
- void ShowMonthCalendar(FX_BOOL bActivate);
- FX_BOOL IsMonthCalendarShowed();
void ReSetEditAlignment();
void InitProxyForm();
- void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
CFX_RectF m_rtBtn;
CFX_RectF m_rtClient;
@@ -166,28 +167,13 @@ class IFWL_DateTimePicker : public IFWL_Widget {
FWL_Error DisForm_GetBBox(CFX_RectF& rect);
FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr);
-};
-
-class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate {
- public:
- CFWL_DateTimePickerImpDelegate(IFWL_DateTimePicker* pOwner);
-
- // CFWL_WidgetImpDelegate
- void OnProcessMessage(CFWL_Message* pMessage) override;
- void OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = nullptr) override;
- protected:
- void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
+ void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
void OnMouseLeave(CFWL_MsgMouse* pMsg);
-
- IFWL_DateTimePicker* m_pOwner;
-
- private:
- void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
+ void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet);
};
#endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_