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 bool LoadWidget() override; | 20 bool LoadWidget() override; |
21 void UpdateWidgetProperty() override; | 21 void UpdateWidgetProperty() override; |
22 bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 22 bool OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
23 bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 23 bool OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
24 bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; | 24 bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
25 bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; | 25 bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; |
26 bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; | 26 bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; |
27 bool CanUndo() override; | |
28 bool CanRedo() override; | |
29 bool Undo() override; | |
30 bool Redo() override; | |
31 bool CanCopy() override; | |
32 bool CanCut() override; | |
33 bool CanPaste() override; | |
34 bool CanSelectAll() override; | |
35 bool Copy(CFX_WideString& wsCopy) override; | |
36 bool Cut(CFX_WideString& wsCut) override; | |
37 bool Paste(const CFX_WideString& wsPaste) override; | |
38 bool SelectAll() override; | |
39 bool Delete() override; | |
40 bool DeSelect() override; | |
41 bool GetSuggestWords(CFX_PointF pointf, | |
42 std::vector<CFX_ByteString>& sSuggest) override; | |
43 bool ReplaceSpellCheckWord(CFX_PointF pointf, | |
44 const CFX_ByteStringC& bsReplace) override; | |
45 void OnProcessMessage(CFWL_Message* pMessage) override; | 27 void OnProcessMessage(CFWL_Message* pMessage) override; |
46 void OnProcessEvent(CFWL_Event* pEvent) override; | 28 void OnProcessEvent(CFWL_Event* pEvent) override; |
47 void OnDrawWidget(CFX_Graphics* pGraphics, | 29 void OnDrawWidget(CFX_Graphics* pGraphics, |
48 const CFX_Matrix* pMatrix = nullptr) override; | 30 const CFX_Matrix* pMatrix = nullptr) override; |
49 | 31 |
50 void OnTextChanged(IFWL_Widget* pWidget, | 32 void OnTextChanged(IFWL_Widget* pWidget, |
51 const CFX_WideString& wsChanged, | 33 const CFX_WideString& wsChanged, |
52 const CFX_WideString& wsPrevText); | 34 const CFX_WideString& wsPrevText); |
53 void OnTextFull(IFWL_Widget* pWidget); | 35 void OnTextFull(IFWL_Widget* pWidget); |
54 bool CheckWord(const CFX_ByteStringC& sWord); | 36 bool CheckWord(const CFX_ByteStringC& sWord); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 public: | 82 public: |
101 CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 83 CXFA_FFDateTimeEdit(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
102 ~CXFA_FFDateTimeEdit() override; | 84 ~CXFA_FFDateTimeEdit() override; |
103 | 85 |
104 // CXFA_FFTextEdit | 86 // CXFA_FFTextEdit |
105 bool GetBBox(CFX_RectF& rtBox, | 87 bool GetBBox(CFX_RectF& rtBox, |
106 uint32_t dwStatus, | 88 uint32_t dwStatus, |
107 bool bDrawFocus = false) override; | 89 bool bDrawFocus = false) override; |
108 bool LoadWidget() override; | 90 bool LoadWidget() override; |
109 void UpdateWidgetProperty() override; | 91 void UpdateWidgetProperty() override; |
110 | |
111 bool CanUndo() override; | |
112 bool CanRedo() override; | |
113 bool Undo() override; | |
114 bool Redo() override; | |
115 bool CanCopy() override; | |
116 bool CanCut() override; | |
117 bool CanPaste() override; | |
118 bool CanSelectAll() override; | |
119 bool Copy(CFX_WideString& wsCopy) override; | |
120 bool Cut(CFX_WideString& wsCut) override; | |
121 bool Paste(const CFX_WideString& wsPaste) override; | |
122 bool SelectAll() override; | |
123 bool Delete() override; | |
124 bool DeSelect() override; | |
125 void OnProcessEvent(CFWL_Event* pEvent) override; | 92 void OnProcessEvent(CFWL_Event* pEvent) override; |
126 | 93 |
127 void OnSelectChanged(IFWL_Widget* pWidget, | 94 void OnSelectChanged(IFWL_Widget* pWidget, |
128 int32_t iYear, | 95 int32_t iYear, |
129 int32_t iMonth, | 96 int32_t iMonth, |
130 int32_t iDay); | 97 int32_t iDay); |
131 | 98 |
132 protected: | 99 protected: |
133 bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; | 100 bool PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; |
134 bool CommitData() override; | 101 bool CommitData() override; |
135 bool UpdateFWLData() override; | 102 bool UpdateFWLData() override; |
136 bool IsDataChanged() override; | 103 bool IsDataChanged() override; |
137 | 104 |
138 uint32_t GetAlignment(); | 105 uint32_t GetAlignment(); |
139 }; | 106 }; |
140 | 107 |
141 #endif // XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ | 108 #endif // XFA_FXFA_APP_XFA_FFTEXTEDIT_H_ |
OLD | NEW |