xref: /aosp_15_r20/external/pdfium/xfa/fxfa/cxfa_ffdatetimeedit.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
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 class CFWL_DateTimePicker;
14 class CFWL_Event;
15 class CFWL_Widget;
16 
17 class CXFA_FFDateTimeEdit final : public CXFA_FFTextEdit {
18  public:
19   explicit CXFA_FFDateTimeEdit(CXFA_Node* pNode);
20   ~CXFA_FFDateTimeEdit() override;
21 
22   // CXFA_FFTextEdit
23   CFX_RectF GetBBox(FocusOption focus) override;
24   bool LoadWidget() override;
25   void UpdateWidgetProperty() override;
26   void OnProcessEvent(CFWL_Event* pEvent) override;
27 
28   void OnSelectChanged(CFWL_Widget* pWidget,
29                        int32_t iYear,
30                        int32_t iMonth,
31                        int32_t iDay);
32 
33   // CXFA_FFWidget
34   bool CanUndo() override;
35   bool CanRedo() override;
36   bool CanCopy() override;
37   bool CanCut() override;
38   bool CanPaste() override;
39   bool CanSelectAll() override;
40   bool Undo() override;
41   bool Redo() override;
42   absl::optional<WideString> Copy() override;
43   absl::optional<WideString> Cut() override;
44   bool Paste(const WideString& wsPaste) override;
45   void SelectAll() override;
46   void Delete() override;
47   void DeSelect() override;
48   WideString GetText() override;
49 
50  private:
51   bool PtInActiveRect(const CFX_PointF& point) override;
52   bool CommitData() override;
53   bool UpdateFWLData() override;
54   bool IsDataChanged() override;
55 
56   CFWL_DateTimePicker* GetPickerWidget();
57 
58   uint32_t GetAlignment();
59 };
60 
61 #endif  // XFA_FXFA_CXFA_FFDATETIMEEDIT_H_
62