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

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

Issue 2488963005: Continue IFWL widget cleanup. (Closed)
Patch Set: Rebase to master 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 side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/ifwl_datetimepicker.h
diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h
index f6742838c450d796eb048de7bf6fdbd0a04177f7..eddb596adc6cf36fb37ffb869c839e38baa2c496 100644
--- a/xfa/fwl/core/ifwl_datetimepicker.h
+++ b/xfa/fwl/core/ifwl_datetimepicker.h
@@ -53,10 +53,10 @@ FWL_EVENT_DEF(CFWL_Event_DtpSelectChanged,
class IFWL_DateTimePickerDP : public IFWL_DataProvider {
public:
- virtual FWL_Error GetToday(IFWL_Widget* pWidget,
- int32_t& iYear,
- int32_t& iMonth,
- int32_t& iDay) = 0;
+ virtual void GetToday(IFWL_Widget* pWidget,
+ int32_t& iYear,
+ int32_t& iMonth,
+ int32_t& iDay) = 0;
};
class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP {
@@ -78,49 +78,36 @@ class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP {
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);
- FWL_Error SetEditText(const CFX_WideString& wsText);
- FWL_Error GetEditText(CFX_WideString& wsText,
- int32_t nStart = 0,
- int32_t nCount = -1) const;
+ // IFWL_DataProvider
+ void 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;
+
+ void GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay);
+ void SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay);
+
+ void SetEditText(const CFX_WideString& wsText);
+ void GetEditText(CFX_WideString& wsText,
+ int32_t nStart = 0,
+ int32_t nCount = -1) const;
+
int32_t CountSelRanges();
int32_t GetSelRange(int32_t nIndex, int32_t& nStart);
- bool CanUndo();
- bool CanRedo();
- bool Undo();
- bool Redo();
- bool CanCopy();
- bool CanCut();
- bool CanSelectAll();
- bool Copy(CFX_WideString& wsCopy);
- bool Cut(CFX_WideString& wsCut);
- bool Paste(const CFX_WideString& wsPaste);
- bool SelectAll();
- bool Delete();
- bool DeSelect();
- FWL_Error GetBBox(CFX_RectF& rect);
- FWL_Error SetEditLimit(int32_t nLimit);
+ void GetBBox(CFX_RectF& rect);
+ void SetEditLimit(int32_t nLimit);
void ModifyEditStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved);
- IFWL_DateTimeEdit* GetDataTimeEdit();
- bool IsMonthCalendarShowed();
+ bool IsMonthCalendarVisible();
void ShowMonthCalendar(bool bActivate);
void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay);
IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); }
- // 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;
-
- protected:
+ private:
void DrawDropDownButton(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix);
@@ -128,45 +115,39 @@ class IFWL_DateTimePicker : public IFWL_Widget, public IFWL_MonthCalendarDP {
int32_t iMonth,
int32_t iDay,
CFX_WideString& wsText);
- void ReSetEditAlignment();
+ void ResetEditAlignment();
void InitProxyForm();
- CFX_RectF m_rtBtn;
- CFX_RectF m_rtClient;
- int32_t m_iBtnState;
- int32_t m_iYear;
- int32_t m_iMonth;
- int32_t m_iDay;
- bool m_bLBtnDown;
- std::unique_ptr<IFWL_DateTimeEdit> m_pEdit;
- std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal;
- std::unique_ptr<IFWL_FormProxy> m_pForm;
- FX_FLOAT m_fBtn;
-
- private:
- FWL_Error DisForm_Initialize();
- void DisForm_InitMonthCalendar();
- void DisForm_InitDateTimeEdit();
- bool DisForm_IsMonthCalendarShowed();
+ bool DisForm_IsMonthCalendarVisible();
void DisForm_ShowMonthCalendar(bool bActivate);
FWL_WidgetHit DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy);
bool DisForm_IsNeedShowButton();
void DisForm_Update();
void DisForm_GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false);
- FWL_Error DisForm_GetBBox(CFX_RectF& rect);
+ void DisForm_GetBBox(CFX_RectF& rect);
void DisForm_DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix = nullptr);
-
+ void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
void OnLButtonDown(CFWL_MsgMouse* pMsg);
void OnLButtonUp(CFWL_MsgMouse* pMsg);
void OnMouseMove(CFWL_MsgMouse* pMsg);
void OnMouseLeave(CFWL_MsgMouse* pMsg);
- void DisForm_OnFocusChanged(CFWL_Message* pMsg, bool bSet);
+ CFX_RectF m_rtBtn;
+ CFX_RectF m_rtClient;
+ int32_t m_iBtnState;
+ int32_t m_iYear;
+ int32_t m_iMonth;
+ int32_t m_iDay;
int32_t m_iCurYear;
int32_t m_iCurMonth;
int32_t m_iCurDay;
+ bool m_bLBtnDown;
+ std::unique_ptr<IFWL_DateTimeEdit> m_pEdit;
+ std::unique_ptr<IFWL_MonthCalendar> m_pMonthCal;
+ std::unique_ptr<IFWL_FormProxy> m_pForm;
+ FX_FLOAT m_fBtn;
};
#endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_

Powered by Google App Engine
This is Rietveld 408576698