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

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

Issue 2506083002: Continue formatting fwl/core (Closed)
Patch Set: Created 4 years, 1 month 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
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 "xfa/fwl/core/cfwl_event.h" 10 #include "xfa/fwl/core/cfwl_event.h"
11 #include "xfa/fwl/core/cfwl_widgetproperties.h" 11 #include "xfa/fwl/core/cfwl_widgetproperties.h"
12 #include "xfa/fwl/core/ifwl_dataprovider.h" 12 #include "xfa/fwl/core/ifwl_dataprovider.h"
13 #include "xfa/fwl/core/ifwl_datetimeedit.h"
13 #include "xfa/fwl/core/ifwl_monthcalendar.h" 14 #include "xfa/fwl/core/ifwl_monthcalendar.h"
14 #include "xfa/fwl/core/ifwl_widget.h" 15 #include "xfa/fwl/core/ifwl_widget.h"
15 16
16 #define FWL_STYLEEXT_DTP_AllowEdit (1L << 0) 17 #define FWL_STYLEEXT_DTP_AllowEdit (1L << 0)
17 #define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1) 18 #define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1)
18 #define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) 19 #define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1)
19 #define FWL_STYLEEXT_DTP_TimeFormat (2L << 1) 20 #define FWL_STYLEEXT_DTP_TimeFormat (2L << 1)
20 #define FWL_STYLEEXT_DTP_Spin (1L << 3) 21 #define FWL_STYLEEXT_DTP_Spin (1L << 3)
21 #define FWL_STYLEEXT_DTP_EditHNear (0L << 4) 22 #define FWL_STYLEEXT_DTP_EditHNear (0L << 4)
22 #define FWL_STYLEEXT_DTP_EditHCenter (1L << 4) 23 #define FWL_STYLEEXT_DTP_EditHCenter (1L << 4)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 int32_t GetCurYear(IFWL_Widget* pWidget) override; 84 int32_t GetCurYear(IFWL_Widget* pWidget) override;
84 85
85 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); 86 void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
86 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); 87 void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
87 88
88 void SetEditText(const CFX_WideString& wsText); 89 void SetEditText(const CFX_WideString& wsText);
89 void GetEditText(CFX_WideString& wsText, 90 void GetEditText(CFX_WideString& wsText,
90 int32_t nStart = 0, 91 int32_t nStart = 0,
91 int32_t nCount = -1) const; 92 int32_t nCount = -1) const;
92 93
93 int32_t CountSelRanges(); 94 int32_t CountSelRanges() const;
94 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); 95 int32_t GetSelRange(int32_t nIndex, int32_t& nStart) const;
95 96
96 void GetBBox(CFX_RectF& rect); 97 void GetBBox(CFX_RectF& rect) const;
97 void SetEditLimit(int32_t nLimit); 98 void SetEditLimit(int32_t nLimit) { m_pEdit->SetLimit(nLimit); }
98 void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); 99 void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved);
99 100
100 bool IsMonthCalendarVisible(); 101 bool IsMonthCalendarVisible() const;
101 void ShowMonthCalendar(bool bActivate); 102 void ShowMonthCalendar(bool bActivate);
102 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); 103 void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
103 104
104 IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } 105 IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); }
105 106
106 private: 107 private:
107 void DrawDropDownButton(CFX_Graphics* pGraphics, 108 void DrawDropDownButton(CFX_Graphics* pGraphics,
108 IFWL_ThemeProvider* pTheme, 109 IFWL_ThemeProvider* pTheme,
109 const CFX_Matrix* pMatrix); 110 const CFX_Matrix* pMatrix);
110 void FormatDateString(int32_t iYear, 111 void FormatDateString(int32_t iYear,
111 int32_t iMonth, 112 int32_t iMonth,
112 int32_t iDay, 113 int32_t iDay,
113 CFX_WideString& wsText); 114 CFX_WideString& wsText);
114 void ResetEditAlignment(); 115 void ResetEditAlignment();
115 void InitProxyForm(); 116 void InitProxyForm();
116 117
117 bool DisForm_IsMonthCalendarVisible(); 118 bool DisForm_IsMonthCalendarVisible() const;
118 void DisForm_ShowMonthCalendar(bool bActivate); 119 void DisForm_ShowMonthCalendar(bool bActivate);
119 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy); 120 FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) const;
120 bool DisForm_IsNeedShowButton(); 121 bool DisForm_IsNeedShowButton() const;
121 void DisForm_Update(); 122 void DisForm_Update();
122 void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); 123 void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false);
123 void DisForm_GetBBox(CFX_RectF& rect); 124 void DisForm_GetBBox(CFX_RectF& rect) const;
124 void DisForm_DrawWidget(CFX_Graphics* pGraphics, 125 void DisForm_DrawWidget(CFX_Graphics* pGraphics,
125 const CFX_Matrix* pMatrix = nullptr); 126 const CFX_Matrix* pMatrix = nullptr);
126 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet); 127 void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet);
127 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); 128 void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
128 void OnLButtonDown(CFWL_MsgMouse* pMsg); 129 void OnLButtonDown(CFWL_MsgMouse* pMsg);
129 void OnLButtonUp(CFWL_MsgMouse* pMsg); 130 void OnLButtonUp(CFWL_MsgMouse* pMsg);
130 void OnMouseMove(CFWL_MsgMouse* pMsg); 131 void OnMouseMove(CFWL_MsgMouse* pMsg);
131 void OnMouseLeave(CFWL_MsgMouse* pMsg); 132 void OnMouseLeave(CFWL_MsgMouse* pMsg);
132 133
133 CFX_RectF m_rtBtn; 134 CFX_RectF m_rtBtn;
134 CFX_RectF m_rtClient; 135 CFX_RectF m_rtClient;
135 int32_t m_iBtnState; 136 int32_t m_iBtnState;
136 int32_t m_iYear; 137 int32_t m_iYear;
137 int32_t m_iMonth; 138 int32_t m_iMonth;
138 int32_t m_iDay; 139 int32_t m_iDay;
139 int32_t m_iCurYear; 140 int32_t m_iCurYear;
140 int32_t m_iCurMonth; 141 int32_t m_iCurMonth;
141 int32_t m_iCurDay; 142 int32_t m_iCurDay;
142 bool m_bLBtnDown; 143 bool m_bLBtnDown;
143 std::unique_ptr<IFWL_DateTimeEdit> m_pEdit; 144 std::unique_ptr<IFWL_DateTimeEdit> m_pEdit;
144 std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal; 145 std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal;
145 std::unique_ptr<IFWL_FormProxy> m_pForm; 146 std::unique_ptr<IFWL_FormProxy> m_pForm;
146 FX_FLOAT m_fBtn; 147 FX_FLOAT m_fBtn;
147 }; 148 };
148 149
149 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ 150 #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698