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 _FWL_EDIT_H | 7 #ifndef FWL_EDIT_H_ |
8 #define _FWL_EDIT_H | 8 #define FWL_EDIT_H_ |
| 9 |
| 10 #include <vector> |
| 11 |
| 12 #include "xfa/include/fwl/lightwidget/widget.h" |
| 13 |
9 class CFWL_WidgetImpProperties; | 14 class CFWL_WidgetImpProperties; |
10 class IFWL_Widget; | |
11 class IFWL_EditDP; | |
12 class IFWL_Edit; | 15 class IFWL_Edit; |
| 16 |
13 #define FWL_CLASS_Edit L"FWL_EDIT" | 17 #define FWL_CLASS_Edit L"FWL_EDIT" |
14 #define FWL_CLASSHASH_Edit 2893987822 | 18 #define FWL_CLASSHASH_Edit 2893987822 |
15 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) | 19 #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) |
16 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) | 20 #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) |
17 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) | 21 #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) |
18 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) | 22 #define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) |
19 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) | 23 #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) |
20 #define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) | 24 #define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) |
21 #define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) | 25 #define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) |
22 #define FWL_STYLEEXT_EDT_Validate (1L << 7) | 26 #define FWL_STYLEEXT_EDT_Validate (1L << 7) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 CFX_WideString wsInsert; | 96 CFX_WideString wsInsert; |
93 FX_BOOL bValidate; | 97 FX_BOOL bValidate; |
94 END_FWL_EVENT_DEF | 98 END_FWL_EVENT_DEF |
95 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) | 99 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) |
96 CFX_ByteString bsWord; | 100 CFX_ByteString bsWord; |
97 FX_BOOL bCheckWord; | 101 FX_BOOL bCheckWord; |
98 END_FWL_EVENT_DEF | 102 END_FWL_EVENT_DEF |
99 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) | 103 BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) |
100 FX_BOOL bSuggestWords; | 104 FX_BOOL bSuggestWords; |
101 CFX_ByteString bsWord; | 105 CFX_ByteString bsWord; |
102 CFX_ByteStringArray bsArraySuggestWords; | 106 std::vector<CFX_ByteString> bsArraySuggestWords; |
103 END_FWL_EVENT_DEF | 107 END_FWL_EVENT_DEF |
104 class IFWL_EditDP : public IFWL_DataProvider {}; | 108 class IFWL_EditDP : public IFWL_DataProvider {}; |
105 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) | 109 #define FWL_EDT_FIND_FLAGS_Prev (0L << 0) |
106 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) | 110 #define FWL_EDT_FIND_FLAGS_Next (1L << 0) |
107 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) | 111 #define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) |
108 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) | 112 #define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) |
109 typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; | 113 typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; |
| 114 |
110 class IFWL_Edit : public IFWL_Widget { | 115 class IFWL_Edit : public IFWL_Widget { |
111 public: | 116 public: |
112 static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, | 117 static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, |
113 IFWL_Widget* pOuter); | 118 IFWL_Widget* pOuter); |
114 static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, | 119 static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, |
115 IFWL_Widget* pOuter); | 120 IFWL_Widget* pOuter); |
116 | 121 |
117 FWL_ERR SetText(const CFX_WideString& wsText); | 122 FWL_ERR SetText(const CFX_WideString& wsText); |
118 int32_t GetTextLength() const; | 123 int32_t GetTextLength() const; |
119 FWL_ERR GetText(CFX_WideString& wsText, | 124 FWL_ERR GetText(CFX_WideString& wsText, |
(...skipping 27 matching lines...) Expand all Loading... |
147 FX_BOOL Undo(); | 152 FX_BOOL Undo(); |
148 FX_BOOL Redo(); | 153 FX_BOOL Redo(); |
149 FX_BOOL CanUndo(); | 154 FX_BOOL CanUndo(); |
150 FX_BOOL CanRedo(); | 155 FX_BOOL CanRedo(); |
151 FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); | 156 FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); |
152 FWL_ERR SetOuter(IFWL_Widget* pOuter); | 157 FWL_ERR SetOuter(IFWL_Widget* pOuter); |
153 FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); | 158 FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); |
154 FWL_ERR SetBackColor(FX_DWORD dwColor); | 159 FWL_ERR SetBackColor(FX_DWORD dwColor); |
155 FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); | 160 FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); |
156 void SetScrollOffset(FX_FLOAT fScrollOffset); | 161 void SetScrollOffset(FX_FLOAT fScrollOffset); |
157 FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); | 162 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
| 163 std::vector<CFX_ByteString>& sSuggest); |
158 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 164 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
159 const CFX_ByteStringC& bsReplace); | 165 const CFX_ByteStringC& bsReplace); |
160 | 166 |
161 protected: | 167 protected: |
162 IFWL_Edit(); | 168 IFWL_Edit(); |
163 }; | 169 }; |
164 #endif | 170 |
| 171 #endif // FWL_EDIT_H_ |
OLD | NEW |