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_FXFA_APP_XFA_FFTEXTEDIT_H_ | 7 #ifndef XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ |
8 #define XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ | 8 #define XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "xfa/fxfa/app/xfa_fffield.h" | 12 #include "xfa/fxfa/app/xfa_fffield.h" |
13 | 13 |
14 class CXFA_FFTextEdit : public CXFA_FFField { | 14 class CXFA_FFTextEdit : public CXFA_FFField { |
15 public: | 15 public: |
16 CXFA_FFTextEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 16 CXFA_FFTextEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
17 ~CXFA_FFTextEdit() override; | 17 ~CXFA_FFTextEdit() override; |
18 | 18 |
19 // CXFA_FFField: | 19 // CXFA_FFField: |
20 FX_BOOL LoadWidget() override; | 20 FX_BOOL LoadWidget() override; |
21 void UpdateWidgetProperty() override; | 21 void UpdateWidgetProperty() override; |
22 FX_BOOL OnLButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 22 FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
23 FX_BOOL OnRButtonDown(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 23 FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
24 FX_BOOL OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 24 FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
25 FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override; | 25 FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget) override; |
26 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; | 26 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; |
27 FX_BOOL CanUndo() override; | 27 FX_BOOL CanUndo() override; |
28 FX_BOOL CanRedo() override; | 28 FX_BOOL CanRedo() override; |
29 FX_BOOL Undo() override; | 29 FX_BOOL Undo() override; |
30 FX_BOOL Redo() override; | 30 FX_BOOL Redo() override; |
31 FX_BOOL CanCopy() override; | 31 FX_BOOL CanCopy() override; |
32 FX_BOOL CanCut() override; | 32 FX_BOOL CanCut() override; |
33 FX_BOOL CanPaste() override; | 33 FX_BOOL CanPaste() override; |
34 FX_BOOL CanSelectAll() override; | 34 FX_BOOL CanSelectAll() override; |
(...skipping 16 matching lines...) Expand all Loading... |
51 | 51 |
52 void OnTextChanged(IFWL_Widget* pWidget, | 52 void OnTextChanged(IFWL_Widget* pWidget, |
53 const CFX_WideString& wsChanged, | 53 const CFX_WideString& wsChanged, |
54 const CFX_WideString& wsPrevText); | 54 const CFX_WideString& wsPrevText); |
55 void OnTextFull(IFWL_Widget* pWidget); | 55 void OnTextFull(IFWL_Widget* pWidget); |
56 FX_BOOL CheckWord(const CFX_ByteStringC& sWord); | 56 FX_BOOL CheckWord(const CFX_ByteStringC& sWord); |
57 FX_BOOL GetSuggestWords(const CFX_ByteStringC& sWord, | 57 FX_BOOL GetSuggestWords(const CFX_ByteStringC& sWord, |
58 std::vector<CFX_ByteString>& sSuggest); | 58 std::vector<CFX_ByteString>& sSuggest); |
59 | 59 |
60 protected: | 60 protected: |
61 FX_DWORD GetAlignment(); | 61 uint32_t GetAlignment(); |
62 FX_BOOL CommitData() override; | 62 FX_BOOL CommitData() override; |
63 FX_BOOL UpdateFWLData() override; | 63 FX_BOOL UpdateFWLData() override; |
64 FX_BOOL IsDataChanged() override; | 64 FX_BOOL IsDataChanged() override; |
65 void ValidateNumberField(const CFX_WideString& wsText); | 65 void ValidateNumberField(const CFX_WideString& wsText); |
66 | 66 |
67 IFWL_WidgetDelegate* m_pOldDelegate; | 67 IFWL_WidgetDelegate* m_pOldDelegate; |
68 }; | 68 }; |
69 | 69 |
70 class CXFA_FFNumericEdit : public CXFA_FFTextEdit { | 70 class CXFA_FFNumericEdit : public CXFA_FFTextEdit { |
71 public: | 71 public: |
(...skipping 19 matching lines...) Expand all Loading... |
91 XFA_DATETIMETYPE_Date = 0, | 91 XFA_DATETIMETYPE_Date = 0, |
92 XFA_DATETIMETYPE_Time, | 92 XFA_DATETIMETYPE_Time, |
93 XFA_DATETIMETYPE_DateAndTime | 93 XFA_DATETIMETYPE_DateAndTime |
94 }; | 94 }; |
95 class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { | 95 class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { |
96 public: | 96 public: |
97 CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 97 CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
98 virtual ~CXFA_FFDateTimeEdit(); | 98 virtual ~CXFA_FFDateTimeEdit(); |
99 | 99 |
100 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, | 100 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, |
101 FX_DWORD dwStatus, | 101 uint32_t dwStatus, |
102 FX_BOOL bDrawFocus = FALSE); | 102 FX_BOOL bDrawFocus = FALSE); |
103 virtual FX_BOOL LoadWidget(); | 103 virtual FX_BOOL LoadWidget(); |
104 virtual void UpdateWidgetProperty(); | 104 virtual void UpdateWidgetProperty(); |
105 | 105 |
106 virtual FX_BOOL CanUndo(); | 106 virtual FX_BOOL CanUndo(); |
107 virtual FX_BOOL CanRedo(); | 107 virtual FX_BOOL CanRedo(); |
108 virtual FX_BOOL Undo(); | 108 virtual FX_BOOL Undo(); |
109 virtual FX_BOOL Redo(); | 109 virtual FX_BOOL Redo(); |
110 | 110 |
111 virtual FX_BOOL CanCopy(); | 111 virtual FX_BOOL CanCopy(); |
112 virtual FX_BOOL CanCut(); | 112 virtual FX_BOOL CanCut(); |
113 virtual FX_BOOL CanPaste(); | 113 virtual FX_BOOL CanPaste(); |
114 virtual FX_BOOL CanSelectAll(); | 114 virtual FX_BOOL CanSelectAll(); |
115 virtual FX_BOOL Copy(CFX_WideString& wsCopy); | 115 virtual FX_BOOL Copy(CFX_WideString& wsCopy); |
116 virtual FX_BOOL Cut(CFX_WideString& wsCut); | 116 virtual FX_BOOL Cut(CFX_WideString& wsCut); |
117 virtual FX_BOOL Paste(const CFX_WideString& wsPaste); | 117 virtual FX_BOOL Paste(const CFX_WideString& wsPaste); |
118 virtual FX_BOOL SelectAll(); | 118 virtual FX_BOOL SelectAll(); |
119 virtual FX_BOOL Delete(); | 119 virtual FX_BOOL Delete(); |
120 virtual FX_BOOL DeSelect(); | 120 virtual FX_BOOL DeSelect(); |
121 | 121 |
122 protected: | 122 protected: |
123 FX_DWORD GetAlignment(); | 123 uint32_t GetAlignment(); |
124 | 124 |
125 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); | 125 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); |
126 virtual FX_BOOL CommitData(); | 126 virtual FX_BOOL CommitData(); |
127 virtual FX_BOOL UpdateFWLData(); | 127 virtual FX_BOOL UpdateFWLData(); |
128 virtual FX_BOOL IsDataChanged(); | 128 virtual FX_BOOL IsDataChanged(); |
129 | 129 |
130 public: | 130 public: |
131 void OnSelectChanged(IFWL_Widget* pWidget, | 131 void OnSelectChanged(IFWL_Widget* pWidget, |
132 int32_t iYear, | 132 int32_t iYear, |
133 int32_t iMonth, | 133 int32_t iMonth, |
134 int32_t iDay); | 134 int32_t iDay); |
135 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); | 135 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); |
136 }; | 136 }; |
137 | 137 |
138 #endif // XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ | 138 #endif // XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ |
OLD | NEW |