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> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) | 47 #define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) |
48 #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) | 48 #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) |
49 #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) | 49 #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) |
50 | 50 |
51 enum FWL_EDT_TEXTCHANGED { | 51 enum FWL_EDT_TEXTCHANGED { |
52 FWL_EDT_TEXTCHANGED_Insert = 0, | 52 FWL_EDT_TEXTCHANGED_Insert = 0, |
53 FWL_EDT_TEXTCHANGED_Delete, | 53 FWL_EDT_TEXTCHANGED_Delete, |
54 FWL_EDT_TEXTCHANGED_Replace, | 54 FWL_EDT_TEXTCHANGED_Replace, |
55 }; | 55 }; |
56 | 56 |
57 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, CFWL_EventType::TextChanged) | 57 FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, |
58 int32_t nChangeType; | 58 CFWL_EventType::TextChanged, |
59 CFX_WideString wsInsert; | 59 int32_t nChangeType; |
60 CFX_WideString wsDelete; | 60 CFX_WideString wsInsert; |
61 CFX_WideString wsPrevText; | 61 CFX_WideString wsDelete; |
62 END_FWL_EVENT_DEF | 62 CFX_WideString wsPrevText;) |
63 | 63 |
64 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull) | 64 FWL_EVENT_DEF(CFWL_EvtEdtTextFull, CFWL_EventType::TextFull) |
65 END_FWL_EVENT_DEF | |
66 | 65 |
67 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, CFWL_EventType::PreSelfAdaption) | 66 FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, |
68 FX_BOOL bHSelfAdaption; | 67 CFWL_EventType::PreSelfAdaption, |
69 FX_BOOL bVSelfAdaption; | 68 FX_BOOL bHSelfAdaption; |
70 CFX_RectF rtAfterChange; | 69 FX_BOOL bVSelfAdaption; |
71 END_FWL_EVENT_DEF | 70 CFX_RectF rtAfterChange;) |
72 | 71 |
73 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, CFWL_EventType::Validate) | 72 FWL_EVENT_DEF(CFWL_EvtEdtValidate, |
74 IFWL_Widget* pDstWidget; | 73 CFWL_EventType::Validate, |
75 CFX_WideString wsInsert; | 74 IFWL_Widget* pDstWidget; |
76 FX_BOOL bValidate; | 75 CFX_WideString wsInsert; |
77 END_FWL_EVENT_DEF | 76 FX_BOOL bValidate;) |
78 | 77 |
79 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, CFWL_EventType::CheckWord) | 78 FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, |
80 CFX_ByteString bsWord; | 79 CFWL_EventType::CheckWord, |
81 FX_BOOL bCheckWord; | 80 CFX_ByteString bsWord; |
82 END_FWL_EVENT_DEF | 81 FX_BOOL bCheckWord;) |
83 | 82 |
84 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, | 83 FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, |
85 CFWL_EventType::GetSuggestedWords) | 84 CFWL_EventType::GetSuggestedWords, |
86 FX_BOOL bSuggestWords; | 85 FX_BOOL bSuggestWords; |
87 CFX_ByteString bsWord; | 86 CFX_ByteString bsWord; |
88 std::vector<CFX_ByteString> bsArraySuggestWords; | 87 std::vector<CFX_ByteString> bsArraySuggestWords;) |
89 END_FWL_EVENT_DEF | |
90 | 88 |
91 class CFWL_WidgetImpProperties; | 89 class CFWL_WidgetImpProperties; |
92 class IFDE_TxtEdtDoRecord; | 90 class IFDE_TxtEdtDoRecord; |
93 | 91 |
94 class IFWL_EditDP : public IFWL_DataProvider {}; | 92 class IFWL_EditDP : public IFWL_DataProvider {}; |
95 | 93 |
96 class IFWL_Edit : public IFWL_Widget { | 94 class IFWL_Edit : public IFWL_Widget { |
97 public: | 95 public: |
98 static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, | 96 static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, |
99 IFWL_Widget* pOuter); | 97 IFWL_Widget* pOuter); |
100 static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, | 98 static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, |
101 IFWL_Widget* pOuter); | 99 IFWL_Widget* pOuter); |
102 | 100 |
103 FWL_Error SetText(const CFX_WideString& wsText); | 101 FWL_Error SetText(const CFX_WideString& wsText); |
104 int32_t GetTextLength() const; | 102 int32_t GetTextLength() const; |
105 FWL_Error GetText(CFX_WideString& wsText, | 103 FWL_Error GetText(CFX_WideString& wsText, |
106 int32_t nStart = 0, | 104 int32_t nStart = 0, |
107 int32_t nCount = -1) const; | 105 int32_t nCount = -1) const; |
108 FWL_Error ClearText(); | 106 FWL_Error ClearText(); |
109 int32_t GetCaretPos() const; | 107 int32_t GetCaretPos() const; |
110 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); | 108 int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); |
111 FWL_Error AddSelRange(int32_t nStart, int32_t nCount = -1); | 109 FWL_Error AddSelRange(int32_t nStart, int32_t nCount = -1); |
112 int32_t CountSelRanges(); | 110 int32_t CountSelRanges(); |
113 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); | 111 int32_t GetSelRange(int32_t nIndex, int32_t& nStart); |
114 FWL_Error ClearSelections(); | 112 FWL_Error ClearSelections(); |
115 int32_t GetLimit(); | 113 int32_t GetLimit(); |
116 FWL_Error SetLimit(int32_t nLimit); | 114 FWL_Error SetLimit(int32_t nLimit); |
117 FWL_Error SetAliasChar(FX_WCHAR wAlias); | 115 FWL_Error SetAliasChar(FX_WCHAR wAlias); |
118 FWL_Error SetFormatString(const CFX_WideString& wsFormat); | |
119 FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); | 116 FWL_Error Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); |
120 FWL_Error DeleteSelections(); | 117 FWL_Error DeleteSelections(); |
121 FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1); | 118 FWL_Error DeleteRange(int32_t nStart, int32_t nCount = -1); |
122 FWL_Error Replace(int32_t nStart, | 119 FWL_Error Replace(int32_t nStart, |
123 int32_t nLen, | 120 int32_t nLen, |
124 const CFX_WideStringC& wsReplace); | 121 const CFX_WideStringC& wsReplace); |
125 FWL_Error DoClipboard(int32_t iCmd); | 122 FWL_Error DoClipboard(int32_t iCmd); |
126 FX_BOOL Copy(CFX_WideString& wsCopy); | 123 FX_BOOL Copy(CFX_WideString& wsCopy); |
127 FX_BOOL Cut(CFX_WideString& wsCut); | 124 FX_BOOL Cut(CFX_WideString& wsCut); |
128 FX_BOOL Paste(const CFX_WideString& wsPaste); | 125 FX_BOOL Paste(const CFX_WideString& wsPaste); |
(...skipping 13 matching lines...) Expand all Loading... |
142 FX_BOOL GetSuggestWords(CFX_PointF pointf, | 139 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
143 std::vector<CFX_ByteString>& sSuggest); | 140 std::vector<CFX_ByteString>& sSuggest); |
144 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 141 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
145 const CFX_ByteStringC& bsReplace); | 142 const CFX_ByteStringC& bsReplace); |
146 | 143 |
147 protected: | 144 protected: |
148 IFWL_Edit(); | 145 IFWL_Edit(); |
149 }; | 146 }; |
150 | 147 |
151 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ | 148 #endif // XFA_FWL_BASEWIDGET_IFWL_EDIT_H_ |
OLD | NEW |