OLD | NEW |
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_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ | 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ |
8 #define XFA_FWL_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ | 8 #define XFA_FWL_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ |
9 | 9 |
10 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" | 10 #include "xfa/fwl/basewidget/ifwl_datetimepicker.h" |
11 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 11 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
12 | 12 |
13 class CFWL_DateTimePicker : public CFWL_Widget { | 13 class CFWL_DateTimePicker : public CFWL_Widget { |
14 public: | 14 public: |
15 static CFWL_DateTimePicker* Create(); | 15 static CFWL_DateTimePicker* Create(); |
| 16 |
16 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); | 17 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = NULL); |
17 FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); | 18 FWL_Error SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); |
18 FWL_Error GetEditText(CFX_WideString& wsText); | 19 FWL_Error GetEditText(CFX_WideString& wsText); |
19 FWL_Error SetEditText(const CFX_WideString& wsText); | 20 FWL_Error SetEditText(const CFX_WideString& wsText); |
20 int32_t CountSelRanges(); | 21 int32_t CountSelRanges(); |
21 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | 22 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); |
22 FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); | 23 FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); |
23 FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); | 24 FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); |
24 FX_BOOL CanUndo(); | 25 FX_BOOL CanUndo(); |
25 FX_BOOL CanRedo(); | 26 FX_BOOL CanRedo(); |
26 FX_BOOL Undo(); | 27 FX_BOOL Undo(); |
27 FX_BOOL Redo(); | 28 FX_BOOL Redo(); |
28 FX_BOOL CanCopy(); | 29 FX_BOOL CanCopy(); |
29 FX_BOOL CanCut(); | 30 FX_BOOL CanCut(); |
30 FX_BOOL CanSelectAll(); | 31 FX_BOOL CanSelectAll(); |
31 FX_BOOL Copy(CFX_WideString& wsCopy); | 32 FX_BOOL Copy(CFX_WideString& wsCopy); |
32 FX_BOOL Cut(CFX_WideString& wsCut); | 33 FX_BOOL Cut(CFX_WideString& wsCut); |
33 FX_BOOL Paste(const CFX_WideString& wsPaste); | 34 FX_BOOL Paste(const CFX_WideString& wsPaste); |
34 FX_BOOL SelectAll(); | 35 FX_BOOL SelectAll(); |
35 FX_BOOL Delete(); | 36 FX_BOOL Delete(); |
36 FX_BOOL DeSelect(); | 37 FX_BOOL DeSelect(); |
37 FWL_Error GetBBox(CFX_RectF& rect); | 38 FWL_Error GetBBox(CFX_RectF& rect); |
38 FWL_Error SetEditLimit(int32_t nLimit); | 39 FWL_Error SetEditLimit(int32_t nLimit); |
39 FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded, | 40 FWL_Error ModifyEditStylesEx(uint32_t dwStylesExAdded, |
40 uint32_t dwStylesExRemoved); | 41 uint32_t dwStylesExRemoved); |
41 | 42 |
42 protected: | 43 protected: |
43 CFWL_DateTimePicker(); | |
44 virtual ~CFWL_DateTimePicker(); | |
45 class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP { | 44 class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP { |
46 public: | 45 public: |
47 CFWL_DateTimePickerDP(); | 46 CFWL_DateTimePickerDP(); |
48 virtual FWL_Error GetCaption(IFWL_Widget* pWidget, | 47 |
49 CFX_WideString& wsCaption); | 48 // IFWL_DataProvider |
50 virtual FWL_Error GetToday(IFWL_Widget* pWidget, | 49 FWL_Error GetCaption(IFWL_Widget* pWidget, |
51 int32_t& iYear, | 50 CFX_WideString& wsCaption) override; |
52 int32_t& iMonth, | 51 |
53 int32_t& iDay); | 52 // IFWL_DateTimePickerDP |
| 53 FWL_Error GetToday(IFWL_Widget* pWidget, |
| 54 int32_t& iYear, |
| 55 int32_t& iMonth, |
| 56 int32_t& iDay) override; |
54 int32_t m_iYear; | 57 int32_t m_iYear; |
55 int32_t m_iMonth; | 58 int32_t m_iMonth; |
56 int32_t m_iDay; | 59 int32_t m_iDay; |
57 CFX_WideString m_wsData; | 60 CFX_WideString m_wsData; |
58 }; | 61 }; |
| 62 |
| 63 CFWL_DateTimePicker(); |
| 64 ~CFWL_DateTimePicker() override; |
| 65 |
59 CFWL_DateTimePickerDP m_DateTimePickerDP; | 66 CFWL_DateTimePickerDP m_DateTimePickerDP; |
60 }; | 67 }; |
61 | 68 |
62 #endif // XFA_FWL_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ | 69 #endif // XFA_FWL_LIGHTWIDGET_CFWL_DATETIMEPICKER_H_ |
OLD | NEW |