diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-03-23 15:51:01 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-03-23 15:51:01 -0400 |
commit | 398a43d83174d75366da57726ff81f199f04e24c (patch) | |
tree | cf03a75139da7eb059af19f346549441932b67c9 /xfa/fwl/basewidget/ifwl_datetimepicker.h | |
parent | a8a28e0702a1874d29d3c9f2b155bce1557eb4fd (diff) | |
download | pdfium-398a43d83174d75366da57726ff81f199f04e24c.tar.xz |
Move xfa/include/fwl/{core,basewidget} to xfa/fwl/{core,basewidget}.
This CL moves and splits the FWL files from the core and basewidget directories
into the non-include folders.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1827923002 .
Diffstat (limited to 'xfa/fwl/basewidget/ifwl_datetimepicker.h')
-rw-r--r-- | xfa/fwl/basewidget/ifwl_datetimepicker.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/xfa/fwl/basewidget/ifwl_datetimepicker.h b/xfa/fwl/basewidget/ifwl_datetimepicker.h new file mode 100644 index 0000000000..25c69682a9 --- /dev/null +++ b/xfa/fwl/basewidget/ifwl_datetimepicker.h @@ -0,0 +1,115 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_ +#define XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_ + +#include "xfa/fwl/core/ifwl_widget.h" +#include "xfa/fwl/core/ifwl_dataprovider.h" +#include "xfa/fwl/core/cfwl_event.h" +#include "xfa/fwl/core/cfwl_widgetimpproperties.h" + +#define FWL_CLASS_DateTimePicker L"FWL_DATETIMEPICKER" +#define FWL_CLASSHASH_DateTimePicker 3851176257 +#define FWL_STYLEEXT_DTP_AllowEdit (1L << 0) +#define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1) +#define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) +#define FWL_STYLEEXT_DTP_TimeFormat (2L << 1) +#define FWL_STYLEEXT_DTP_Spin (1L << 3) +#define FWL_STYLEEXT_DTP_EditHNear (0L << 4) +#define FWL_STYLEEXT_DTP_EditHCenter (1L << 4) +#define FWL_STYLEEXT_DTP_EditHFar (2L << 4) +#define FWL_STYLEEXT_DTP_EditVNear (0L << 6) +#define FWL_STYLEEXT_DTP_EditVCenter (1L << 6) +#define FWL_STYLEEXT_DTP_EditVFar (2L << 6) +#define FWL_STYLEEXT_DTP_EditJustified (1L << 8) +#define FWL_STYLEEXT_DTP_EditDistributed (2L << 8) +#define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) +#define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6) +#define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8) +#define FWL_PART_DTP_Border 1 +#define FWL_PART_DTP_Edge 2 +#define FWL_PART_DTP_Background 3 +#define FWL_PART_DTP_DropDownButton 4 +#define FWL_PARTSTATE_DTP_Normal (0L << 0) +#define FWL_PARTSTATE_DTP_Hovered (1L << 0) +#define FWL_PARTSTATE_DTP_Pressed (2L << 0) +#define FWL_PARTSTATE_DTP_Disabled (3L << 0) +#define FWL_EVT_DTP_DropDown L"FWL_EVENT_DTP_DropDown" +#define FWL_EVTHASH_DTP_DropDown 264728733 +#define FWL_EVT_DTP_CloseUp L"FWL_EVENT_DTP_CloseUp" +#define FWL_EVTHASH_DTP_CloseUp 4280973803 +#define FWL_EVT_DTP_EditChanged L"FWL_EVENT_DTP_EditChanged" +#define FWL_EVTHASH_DTP_EditChanged 4009610944 +#define FWL_EVT_DTP_HoverChanged L"FWL_EVENT_DTP_HoverChanged" +#define FWL_EVTHASH_DTP_HoverChanged 686674750 +#define FWL_EVT_DTP_SelectChanged L"FWL_EVENT_DTP_SelectChanged" +#define FWL_EVTHASH_DTP_SelectChanged 1589616858 + +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpDropDown, FWL_EVTHASH_DTP_DropDown) +END_FWL_EVENT_DEF + +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpCloseUp, FWL_EVTHASH_DTP_CloseUp) +END_FWL_EVENT_DEF + +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpEditChanged, FWL_EVTHASH_DTP_EditChanged) +CFX_WideString m_wsText; +END_FWL_EVENT_DEF + +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpHoverChanged, FWL_EVTHASH_DTP_HoverChanged) +int32_t hoverday; +END_FWL_EVENT_DEF + +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpSelectChanged, FWL_EVTHASH_DTP_SelectChanged) +int32_t iYear; +int32_t iMonth; +int32_t iDay; +END_FWL_EVENT_DEF + +class IFWL_DateTimePickerDP : public IFWL_DataProvider { + public: + virtual FWL_ERR GetToday(IFWL_Widget* pWidget, + int32_t& iYear, + int32_t& iMonth, + int32_t& iDay) = 0; +}; + +class IFWL_DateTimePicker : public IFWL_Widget { + public: + static IFWL_DateTimePicker* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); + FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); + FWL_ERR SetEditText(const CFX_WideString& wsText); + FWL_ERR 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); + FX_BOOL CanUndo(); + FX_BOOL CanRedo(); + FX_BOOL Undo(); + FX_BOOL Redo(); + FX_BOOL CanCopy(); + FX_BOOL CanCut(); + FX_BOOL CanSelectAll(); + FX_BOOL Copy(CFX_WideString& wsCopy); + FX_BOOL Cut(CFX_WideString& wsCut); + FX_BOOL Paste(const CFX_WideString& wsPaste); + FX_BOOL SelectAll(); + FX_BOOL Delete(); + FX_BOOL DeSelect(); + FWL_ERR GetBBox(CFX_RectF& rect); + FWL_ERR SetEditLimit(int32_t nLimit); + FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, + FX_DWORD dwStylesExRemoved); + + protected: + IFWL_DateTimePicker(); +}; + +#endif // XFA_FWL_BASEWIDGET_IFWL_DATETIMEPICKER_H_ |