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_BASEWIDGET_IFWL_EDIT_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
8 #define XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 8 #define XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "xfa/fwl/core/cfwl_event.h" |
12 #include "xfa/fwl/core/ifwl_dataprovider.h" | 13 #include "xfa/fwl/core/ifwl_dataprovider.h" |
13 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 14 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
14 | 15 |
15 #define FWL_CLASS_Edit L"FWL_EDIT" | 16 #define FWL_CLASS_Edit L"FWL_EDIT" |
16 #define FWL_CLASSHASH_Edit 2893987822 | 17 #define FWL_CLASSHASH_Edit 2893987822 |
17 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) | 18 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) |
18 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) | 19 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) |
19 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) | 20 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) |
20 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) | 21 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) |
21 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) | 22 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) |
(...skipping 28 matching lines...) Expand all Loading... |
50 #define FWL_STATE_EDT_Editing (1 << FWL_WGTSTATE_MAX) | 51 #define FWL_STATE_EDT_Editing (1 << FWL_WGTSTATE_MAX) |
51 #define FWL_PART_EDT_Border 1 | 52 #define FWL_PART_EDT_Border 1 |
52 #define FWL_PART_EDT_Edge 2 | 53 #define FWL_PART_EDT_Edge 2 |
53 #define FWL_PART_EDT_Background 3 | 54 #define FWL_PART_EDT_Background 3 |
54 #define FWL_PART_EDT_CombTextLine 4 | 55 #define FWL_PART_EDT_CombTextLine 4 |
55 #define FWL_PARTDATA_EDT_Background 0 | 56 #define FWL_PARTDATA_EDT_Background 0 |
56 #define FWL_PARTDATA_EDT_StaticBackground 1 | 57 #define FWL_PARTDATA_EDT_StaticBackground 1 |
57 #define FWL_PARTSTATE_EDT_Normal (0L << 0) | 58 #define FWL_PARTSTATE_EDT_Normal (0L << 0) |
58 #define FWL_PARTSTATE_EDT_ReadOnly (1L << 0) | 59 #define FWL_PARTSTATE_EDT_ReadOnly (1L << 0) |
59 #define FWL_PARTSTATE_EDT_Disable (2L << 0) | 60 #define FWL_PARTSTATE_EDT_Disable (2L << 0) |
60 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 | |
61 #define FWL_EVTHASH_EDT_TextChanged 1064022132 | |
62 #define FWL_EVTHASH_EDT_PreSelfAdaption 1001979178 | |
63 #define FWL_EVTHASH_EDT_Validate 3373308608 | |
64 #define FWL_EVTHASH_EDT_CheckWord 2897181520 | |
65 #define FWL_EVTHASH_EDT_GetSuggestWords 315782791 | |
66 #define FWL_EVTHASH_EDT_TextFull 2158580174 | |
67 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) | 61 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) |
68 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) | 62 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) |
69 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) | 63 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) |
70 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) | 64 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) |
71 | 65 |
72 typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND; | 66 typedef struct FWL_HEDTFIND_ { void* pData; } * FWL_HEDTFIND; |
73 | 67 |
74 enum FWL_EDT_TEXTCHANGED { | 68 enum FWL_EDT_TEXTCHANGED { |
75 FWL_EDT_TEXTCHANGED_Insert = 0, | 69 FWL_EDT_TEXTCHANGED_Insert = 0, |
76 FWL_EDT_TEXTCHANGED_Delete, | 70 FWL_EDT_TEXTCHANGED_Delete, |
77 FWL_EDT_TEXTCHANGED_Replace, | 71 FWL_EDT_TEXTCHANGED_Replace, |
78 }; | 72 }; |
79 | 73 |
80 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged) | 74 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, CFWL_EventType::TextChanged) |
81 int32_t nChangeType; | 75 int32_t nChangeType; |
82 CFX_WideString wsInsert; | 76 CFX_WideString wsInsert; |
83 CFX_WideString wsDelete; | 77 CFX_WideString wsDelete; |
84 CFX_WideString wsPrevText; | 78 CFX_WideString wsPrevText; |
85 END_FWL_EVENT_DEF | 79 END_FWL_EVENT_DEF |
86 | 80 |
87 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, FWL_EVTHASH_EDT_TextFull) | 81 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull) |
88 END_FWL_EVENT_DEF | 82 END_FWL_EVENT_DEF |
89 | 83 |
90 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, FWL_EVTHASH_EDT_PreSelfAdaption) | 84 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, CFWL_EventType::PreSelfAdaption) |
91 FX_BOOL bHSelfAdaption; | 85 FX_BOOL bHSelfAdaption; |
92 FX_BOOL bVSelfAdaption; | 86 FX_BOOL bVSelfAdaption; |
93 CFX_RectF rtAfterChange; | 87 CFX_RectF rtAfterChange; |
94 END_FWL_EVENT_DEF | 88 END_FWL_EVENT_DEF |
95 | 89 |
96 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, FWL_EVTHASH_EDT_Validate) | 90 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, CFWL_EventType::Validate) |
97 IFWL_Widget* pDstWidget; | 91 IFWL_Widget* pDstWidget; |
98 CFX_WideString wsInsert; | 92 CFX_WideString wsInsert; |
99 FX_BOOL bValidate; | 93 FX_BOOL bValidate; |
100 END_FWL_EVENT_DEF | 94 END_FWL_EVENT_DEF |
101 | 95 |
102 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) | 96 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, CFWL_EventType::CheckWord) |
103 CFX_ByteString bsWord; | 97 CFX_ByteString bsWord; |
104 FX_BOOL bCheckWord; | 98 FX_BOOL bCheckWord; |
105 END_FWL_EVENT_DEF | 99 END_FWL_EVENT_DEF |
106 | 100 |
107 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) | 101 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, |
| 102 CFWL_EventType::GetSuggestedWords) |
108 FX_BOOL bSuggestWords; | 103 FX_BOOL bSuggestWords; |
109 CFX_ByteString bsWord; | 104 CFX_ByteString bsWord; |
110 std::vector<CFX_ByteString> bsArraySuggestWords; | 105 std::vector<CFX_ByteString> bsArraySuggestWords; |
111 END_FWL_EVENT_DEF | 106 END_FWL_EVENT_DEF |
112 | 107 |
113 class CFWL_WidgetImpProperties; | 108 class CFWL_WidgetImpProperties; |
114 | 109 |
115 class IFWL_EditDP : public IFWL_DataProvider {}; | 110 class IFWL_EditDP : public IFWL_DataProvider {}; |
116 | 111 |
117 class IFWL_Edit : public IFWL_Widget { | 112 class IFWL_Edit : public IFWL_Widget { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 FX_BOOL GetSuggestWords(CFX_PointF pointf, | 159 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
165 std::vector<CFX_ByteString>& sSuggest); | 160 std::vector<CFX_ByteString>& sSuggest); |
166 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 161 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
167 const CFX_ByteStringC& bsReplace); | 162 const CFX_ByteStringC& bsReplace); |
168 | 163 |
169 protected: | 164 protected: |
170 IFWL_Edit(); | 165 IFWL_Edit(); |
171 }; | 166 }; |
172 | 167 |
173 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 168 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
OLD | NEW |