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

Side by Side Diff: xfa/fwl/core/ifwl_datetimepicker.h

Issue 2524993002: Remove plumbing for today value (Closed)
Patch Set: Review fixes Created 4 years 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 unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/cfwl_datetimepicker.cpp ('k') | xfa/fwl/core/ifwl_datetimepicker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_DATETIMEPICKER_H_ 7 #ifndef XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_
8 #define XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ 8 #define XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 18 matching lines...) Expand all
29 #define FWL_STYLEEXT_DTP_EditJustified (1L << 8) 29 #define FWL_STYLEEXT_DTP_EditJustified (1L << 8)
30 #define FWL_STYLEEXT_DTP_EditDistributed (2L << 8) 30 #define FWL_STYLEEXT_DTP_EditDistributed (2L << 8)
31 #define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) 31 #define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4)
32 #define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6) 32 #define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6)
33 #define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8) 33 #define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8)
34 34
35 class IFWL_DateTimeEdit; 35 class IFWL_DateTimeEdit;
36 class IFWL_FormProxy; 36 class IFWL_FormProxy;
37 37
38 class IFWL_DateTimePicker : public IFWL_Widget, 38 class IFWL_DateTimePicker : public IFWL_Widget,
39 public IFWL_MonthCalendar::DataProvider { 39 public IFWL_Widget::DataProvider {
40 public: 40 public:
41 class DataProvider : public IFWL_Widget::DataProvider {
42 public:
43 virtual void GetToday(IFWL_Widget* pWidget,
44 int32_t& iYear,
45 int32_t& iMonth,
46 int32_t& iDay) = 0;
47 };
48
49 explicit IFWL_DateTimePicker( 41 explicit IFWL_DateTimePicker(
50 const CFWL_App* app, 42 const CFWL_App* app,
51 std::unique_ptr<CFWL_WidgetProperties> properties); 43 std::unique_ptr<CFWL_WidgetProperties> properties);
52 ~IFWL_DateTimePicker() override; 44 ~IFWL_DateTimePicker() override;
53 45
54 // IFWL_Widget 46 // IFWL_Widget
55 FWL_Type GetClassID() const override; 47 FWL_Type GetClassID() const override;
56 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; 48 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
57 void Update() override; 49 void Update() override;
58 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; 50 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override;
59 void DrawWidget(CFX_Graphics* pGraphics, 51 void DrawWidget(CFX_Graphics* pGraphics,
60 const CFX_Matrix* pMatrix = nullptr) override; 52 const CFX_Matrix* pMatrix = nullptr) override;
61 void SetThemeProvider(IFWL_ThemeProvider* pTP) override; 53 void SetThemeProvider(IFWL_ThemeProvider* pTP) override;
62 void OnProcessMessage(CFWL_Message* pMessage) override; 54 void OnProcessMessage(CFWL_Message* pMessage) override;
63 void OnDrawWidget(CFX_Graphics* pGraphics, 55 void OnDrawWidget(CFX_Graphics* pGraphics,
64 const CFX_Matrix* pMatrix) override; 56 const CFX_Matrix* pMatrix) override;
65 57
66 // IFWL_MonthCalendar::DataProvider
67 int32_t GetCurDay(IFWL_Widget* pWidget) override;
68 int32_t GetCurMonth(IFWL_Widget* pWidget) override;
69 int32_t GetCurYear(IFWL_Widget* pWidget) override;
70
71 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); 58 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
72 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); 59 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
73 60
74 void SetEditText(const CFX_WideString& wsText); 61 void SetEditText(const CFX_WideString& wsText);
75 void GetEditText(CFX_WideString& wsText, 62 void GetEditText(CFX_WideString& wsText,
76 int32_t nStart = 0, 63 int32_t nStart = 0,
77 int32_t nCount = -1) const; 64 int32_t nCount = -1) const;
78 65
79 int32_t CountSelRanges() const { return m_pEdit->CountSelRanges(); } 66 int32_t CountSelRanges() const { return m_pEdit->CountSelRanges(); }
80 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const { 67 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void OnLButtonUp(CFWL_MsgMouse* pMsg); 104 void OnLButtonUp(CFWL_MsgMouse* pMsg);
118 void OnMouseMove(CFWL_MsgMouse* pMsg); 105 void OnMouseMove(CFWL_MsgMouse* pMsg);
119 void OnMouseLeave(CFWL_MsgMouse* pMsg); 106 void OnMouseLeave(CFWL_MsgMouse* pMsg);
120 107
121 CFX_RectF m_rtBtn; 108 CFX_RectF m_rtBtn;
122 CFX_RectF m_rtClient; 109 CFX_RectF m_rtClient;
123 int32_t m_iBtnState; 110 int32_t m_iBtnState;
124 int32_t m_iYear; 111 int32_t m_iYear;
125 int32_t m_iMonth; 112 int32_t m_iMonth;
126 int32_t m_iDay; 113 int32_t m_iDay;
127 int32_t m_iCurYear;
128 int32_t m_iCurMonth;
129 int32_t m_iCurDay;
130 bool m_bLBtnDown; 114 bool m_bLBtnDown;
131 std::unique_ptr<IFWL_DateTimeEdit> m_pEdit; 115 std::unique_ptr<IFWL_DateTimeEdit> m_pEdit;
132 std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal; 116 std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal;
133 std::unique_ptr<IFWL_FormProxy> m_pForm; 117 std::unique_ptr<IFWL_FormProxy> m_pForm;
134 FX_FLOAT m_fBtn; 118 FX_FLOAT m_fBtn;
135 }; 119 };
136 120
137 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ 121 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_datetimepicker.cpp ('k') | xfa/fwl/core/ifwl_datetimepicker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698