• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
8 #define XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 #include "xfa/fxfa/cxfa_fftextedit.h"
12 
13 namespace pdfium {
14 class CFWL_DateTimePicker;
15 class CFWL_Widget;
16 }  // namespace pdfium
17 
18 class CXFA_FFDateTimeEdit final : public CXFA_FFTextEdit {
19  public:
20   explicit CXFA_FFDateTimeEdit(CXFA_Node* pNode);
21   ~CXFA_FFDateTimeEdit() override;
22 
23   // CXFA_FFTextEdit
24   CFX_RectF GetBBox(FocusOption focus) override;
25   bool LoadWidget() override;
26   void UpdateWidgetProperty() override;
27   void OnProcessEvent(pdfium::CFWL_Event* pEvent) override;
28 
29   void OnSelectChanged(pdfium::CFWL_Widget* pWidget,
30                        int32_t iYear,
31                        int32_t iMonth,
32                        int32_t iDay);
33 
34   // CXFA_FFWidget
35   bool CanUndo() override;
36   bool CanRedo() override;
37   bool CanCopy() override;
38   bool CanCut() override;
39   bool CanPaste() override;
40   bool CanSelectAll() override;
41   bool Undo() override;
42   bool Redo() override;
43   std::optional<WideString> Copy() override;
44   std::optional<WideString> Cut() override;
45   bool Paste(const WideString& wsPaste) override;
46   void SelectAll() override;
47   void Delete() override;
48   void DeSelect() override;
49   WideString GetText() override;
50 
51  private:
52   bool PtInActiveRect(const CFX_PointF& point) override;
53   bool CommitData() override;
54   bool UpdateFWLData() override;
55   bool IsDataChanged() override;
56 
57   pdfium::CFWL_DateTimePicker* GetPickerWidget();
58 
59   uint32_t GetAlignment();
60 };
61 
62 #endif  // XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
63