Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: fpdfsdk/include/fxedit/fx_edit.h

Issue 1265503005: clang-format all pdfium code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: sigh Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ 7 #ifndef FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_
8 #define FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ 8 #define FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_
9 9
10 #include "../../../core/include/fxcrt/fx_basic.h" 10 #include "../../../core/include/fxcrt/fx_basic.h"
(...skipping 17 matching lines...) Expand all
28 class IPDF_VariableText; 28 class IPDF_VariableText;
29 class IPDF_VariableText_Provider; 29 class IPDF_VariableText_Provider;
30 struct CPVT_Line; 30 struct CPVT_Line;
31 struct CPVT_SecProps; 31 struct CPVT_SecProps;
32 struct CPVT_Section; 32 struct CPVT_Section;
33 struct CPVT_Word; 33 struct CPVT_Word;
34 struct CPVT_WordPlace; 34 struct CPVT_WordPlace;
35 struct CPVT_WordProps; 35 struct CPVT_WordProps;
36 struct CPVT_WordRange; 36 struct CPVT_WordRange;
37 37
38 #define PVTWORD_STYLE_NORMAL» » » » 0x0000L 38 #define PVTWORD_STYLE_NORMAL 0x0000L
39 #define PVTWORD_STYLE_HIGHLIGHT»» » » 0x0001L 39 #define PVTWORD_STYLE_HIGHLIGHT 0x0001L
40 #define PVTWORD_STYLE_UNDERLINE»» » » 0x0002L 40 #define PVTWORD_STYLE_UNDERLINE 0x0002L
41 #define PVTWORD_STYLE_CROSSOUT» » » » 0x0004L 41 #define PVTWORD_STYLE_CROSSOUT 0x0004L
42 #define PVTWORD_STYLE_SQUIGGLY» » » » 0x0008L 42 #define PVTWORD_STYLE_SQUIGGLY 0x0008L
43 #define PVTWORD_STYLE_DUALCROSSOUT» » » 0x0010L 43 #define PVTWORD_STYLE_DUALCROSSOUT 0x0010L
44 #define PVTWORD_STYLE_BOLD» » » » » 0x0020L 44 #define PVTWORD_STYLE_BOLD 0x0020L
45 #define PVTWORD_STYLE_ITALIC» » » » 0x0040L 45 #define PVTWORD_STYLE_ITALIC 0x0040L
46 46
47 #define FX_EDIT_ISLATINWORD(u)» (u == 0x2D || (u <= 0x005A && u >= 0x0041) || (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0)) 47 #define FX_EDIT_ISLATINWORD(u) \
48 (u == 0x2D || (u <= 0x005A && u >= 0x0041) || \
49 (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0))
48 50
49 #ifndef DEFAULT_CHARSET 51 #ifndef DEFAULT_CHARSET
50 #define DEFAULT_CHARSET 1 52 #define DEFAULT_CHARSET 1
51 #endif 53 #endif
52 54
53 class IFX_Edit_FontMap 55 class IFX_Edit_FontMap {
54 { 56 public:
55 public: 57 virtual ~IFX_Edit_FontMap() {}
56 virtual ~IFX_Edit_FontMap() { } 58 // map a fontindex to pdf font.
57 //map a fontindex to pdf font. 59 virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0;
58 virtual CPDF_Font * GetPDFFo nt(int32_t nFontIndex) = 0; 60 // get the alias of a pdf font.
59 //get the alias of a pdf font. 61 virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0;
60 virtual CFX_ByteString GetPDFFontAlias( int32_t nFontIndex) = 0; 62 // get the index of a font that can show a word.
61 //get the index of a font that can show a word. 63 virtual int32_t GetWordFontIndex(FX_WORD word,
62 virtual int32_t GetWordFontIndex (FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; 64 int32_t charset,
63 //get the charcode of word from unicode 65 int32_t nFontIndex) = 0;
64 virtual int32_t CharCodeFromUnic ode(int32_t nFontIndex, FX_WORD word) = 0; 66 // get the charcode of word from unicode
65 //get the charset of unicode 67 virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, FX_WORD word) = 0;
66 virtual int32_t CharSetFromUnico de(FX_WORD word, int32_t nOldCharset) = 0; 68 // get the charset of unicode
67 }; 69 virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset) = 0;
68 70 };
69 class IFX_Edit_Notify 71
70 { 72 class IFX_Edit_Notify {
71 public: 73 public:
72 virtual ~IFX_Edit_Notify() { } 74 virtual ~IFX_Edit_Notify() {}
73 //set the horizontal scrollbar information. 75 // set the horizontal scrollbar information.
74 virtual void IOnSetSc rollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 76 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin,
75 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 77 FX_FLOAT fPlateMax,
76 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; 78 FX_FLOAT fContentMin,
77 //set the vertical scrollbar information. 79 FX_FLOAT fContentMax,
78 virtual void IOnSetSc rollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 80 FX_FLOAT fSmallStep,
79 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 81 FX_FLOAT fBigStep) = 0;
80 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; 82 // set the vertical scrollbar information.
81 //set the position of horizontal scrollbar. 83 virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
82 virtual void IOnSetSc rollPosX(FX_FLOAT fx) = 0; 84 FX_FLOAT fPlateMax,
83 //set the position of vertical scrollbar. 85 FX_FLOAT fContentMin,
84 virtual void IOnSetSc rollPosY(FX_FLOAT fy) = 0; 86 FX_FLOAT fContentMax,
85 //set the caret information. 87 FX_FLOAT fSmallStep,
86 virtual void IOnSetCa ret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0; 88 FX_FLOAT fBigStep) = 0;
87 //if the caret position is changed ,send the information of current post ion to user. 89 // set the position of horizontal scrollbar.
88 virtual void IOnCaret Change(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) = 0; 90 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
89 //if the text area is changed, send the information to user. 91 // set the position of vertical scrollbar.
90 virtual void IOnConte ntChange(const CPDF_Rect& rcContent) = 0; 92 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
91 //Invalidate the rectangle relative to the bounding box of edit. 93 // set the caret information.
92 virtual void IOnInval idateRect(CPDF_Rect * pRect) = 0; 94 virtual void IOnSetCaret(FX_BOOL bVisible,
93 }; 95 const CPDF_Point& ptHead,
94 96 const CPDF_Point& ptFoot,
95 class IFX_Edit_OprNotify 97 const CPVT_WordPlace& place) = 0;
96 { 98 // if the caret position is changed ,send the information of current postion
97 public: 99 // to user.
98 virtual ~IFX_Edit_OprNotify() { } 100 virtual void IOnCaretChange(const CPVT_SecProps& secProps,
99 101 const CPVT_WordProps& wordProps) = 0;
100 //OprType: 0 102 // if the text area is changed, send the information to user.
101 virtual void OnInsert Word(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 103 virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0;
102 //OprType: 1 104 // Invalidate the rectangle relative to the bounding box of edit.
103 virtual void OnInsert Return(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 105 virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0;
104 //OprType: 2 106 };
105 virtual void OnBackSp ace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 107
106 //OprType: 3 108 class IFX_Edit_OprNotify {
107 virtual void OnDelete (const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 109 public:
108 //OprType: 4 110 virtual ~IFX_Edit_OprNotify() {}
109 virtual void OnClear( const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 111
110 //OprType: 5 112 // OprType: 0
111 virtual void OnInsert Text(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 113 virtual void OnInsertWord(const CPVT_WordPlace& place,
112 //OprType: 6 114 const CPVT_WordPlace& oldplace) = 0;
113 virtual void OnSetTex t(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0; 115 // OprType: 1
114 // 116 virtual void OnInsertReturn(const CPVT_WordPlace& place,
115 virtual void OnAddUnd o(IFX_Edit_UndoItem* pUndoItem) = 0; 117 const CPVT_WordPlace& oldplace) = 0;
116 }; 118 // OprType: 2
117 119 virtual void OnBackSpace(const CPVT_WordPlace& place,
118 class IFX_Edit_Iterator 120 const CPVT_WordPlace& oldplace) = 0;
119 { 121 // OprType: 3
120 public: 122 virtual void OnDelete(const CPVT_WordPlace& place,
121 virtual ~IFX_Edit_Iterator() {} 123 const CPVT_WordPlace& oldplace) = 0;
122 public: 124 // OprType: 4
123 //move the current position to the next word. 125 virtual void OnClear(const CPVT_WordPlace& place,
124 virtual FX_BOOL NextWord () = 0; 126 const CPVT_WordPlace& oldplace) = 0;
125 //move the current position to the next line. 127 // OprType: 5
126 virtual FX_BOOL NextLine () = 0; 128 virtual void OnInsertText(const CPVT_WordPlace& place,
127 //move the current position to the next section. 129 const CPVT_WordPlace& oldplace) = 0;
128 virtual FX_BOOL NextSect ion() = 0; 130 // OprType: 6
129 131 virtual void OnSetText(const CPVT_WordPlace& place,
130 //move the current position to the previous word. 132 const CPVT_WordPlace& oldplace) = 0;
131 virtual FX_BOOL PrevWord () = 0; 133 //
132 //move the current position to the previous line. 134 virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem) = 0;
133 virtual FX_BOOL PrevLine () = 0; 135 };
134 //move the current position to the previous section. 136
135 virtual FX_BOOL PrevSect ion() = 0; 137 class IFX_Edit_Iterator {
136 138 public:
137 //get the information of the current word. 139 virtual ~IFX_Edit_Iterator() {}
138 virtual FX_BOOL GetWord( CPVT_Word & word) const = 0; 140
139 //get the information of the current line. 141 public:
140 virtual FX_BOOL GetLine( CPVT_Line & line) const = 0; 142 // move the current position to the next word.
141 //get the information of the current section. 143 virtual FX_BOOL NextWord() = 0;
142 virtual FX_BOOL GetSecti on(CPVT_Section & section) const = 0; 144 // move the current position to the next line.
143 //set the current position. 145 virtual FX_BOOL NextLine() = 0;
144 virtual void SetAt(in t32_t nWordIndex) = 0; 146 // move the current position to the next section.
145 //set the current position. 147 virtual FX_BOOL NextSection() = 0;
146 virtual void SetAt(co nst CPVT_WordPlace & place) = 0; 148
147 //get the current position. 149 // move the current position to the previous word.
148 virtual const CPVT_WordPlace & GetAt() const = 0; 150 virtual FX_BOOL PrevWord() = 0;
149 151 // move the current position to the previous line.
150 //get the edit which this iterator belongs to 152 virtual FX_BOOL PrevLine() = 0;
151 virtual IFX_Edit* GetEdit( ) const = 0; 153 // move the current position to the previous section.
152 }; 154 virtual FX_BOOL PrevSection() = 0;
153 155
154 class IFX_Edit_UndoItem 156 // get the information of the current word.
155 { 157 virtual FX_BOOL GetWord(CPVT_Word& word) const = 0;
156 public: 158 // get the information of the current line.
157 virtual ~IFX_Edit_UndoItem() { } 159 virtual FX_BOOL GetLine(CPVT_Line& line) const = 0;
158 160 // get the information of the current section.
159 virtual void Undo() = 0; 161 virtual FX_BOOL GetSection(CPVT_Section& section) const = 0;
160 virtual void Redo() = 0; 162 // set the current position.
161 virtual CFX_WideString GetUndoTitle() = 0; 163 virtual void SetAt(int32_t nWordIndex) = 0;
162 }; 164 // set the current position.
163 165 virtual void SetAt(const CPVT_WordPlace& place) = 0;
164 class IFX_Edit 166 // get the current position.
165 { 167 virtual const CPVT_WordPlace& GetAt() const = 0;
166 public: 168
167 static IFX_Edit* NewEdit( ); 169 // get the edit which this iterator belongs to
168 static void DelEdit( IFX_Edit* pEdit); 170 virtual IFX_Edit* GetEdit() const = 0;
169 171 };
170 //set a IFX_Edit_FontMap pointer implemented by user. 172
171 virtual void SetFontM ap(IFX_Edit_FontMap* pFontMap) = 0; 173 class IFX_Edit_UndoItem {
172 //if user don't like to use FontMap, implement VTProvider and set it dir ectly. 174 public:
173 virtual void SetVTPro vider(IPDF_VariableText_Provider* pProvider) = 0; 175 virtual ~IFX_Edit_UndoItem() {}
174 //set a IFX_Edit_Notify pointer implemented by user. 176
175 virtual void SetNotif y(IFX_Edit_Notify * pNotify) = 0; 177 virtual void Undo() = 0;
176 virtual void SetOprNo tify(IFX_Edit_OprNotify* pOprNotify) = 0; 178 virtual void Redo() = 0;
177 //get a pointer allocated by CPDF_Edit, by this pointer, user can iterat e the contents of edit, but don't need to release. 179 virtual CFX_WideString GetUndoTitle() = 0;
178 virtual IFX_Edit_Iterator* GetIterator() = 0; 180 };
179 //get a VT pointer relative to this edit. 181
180 virtual IPDF_VariableText* GetVariableText( ) = 0; 182 class IFX_Edit {
181 //get the IFX_Edit_FontMap pointer set by user. 183 public:
182 virtual IFX_Edit_FontMap* GetFontMap() = 0 ; 184 static IFX_Edit* NewEdit();
183 185 static void DelEdit(IFX_Edit* pEdit);
184 //initialize the edit. 186
185 virtual void Initiali ze() = 0; 187 // set a IFX_Edit_FontMap pointer implemented by user.
186 188 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
187 //set the bounding box of the text area. 189 // if user don't like to use FontMap, implement VTProvider and set it
188 virtual void SetPlate Rect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE) = 0; 190 // directly.
189 //set the scroll origin 191 virtual void SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
190 virtual void SetScrol lPos(const CPDF_Point & point) = 0; 192 // set a IFX_Edit_Notify pointer implemented by user.
191 193 virtual void SetNotify(IFX_Edit_Notify* pNotify) = 0;
192 //set the horizontal text alignment in text box, nFormat (0:left 1:middl e 2:right). 194 virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0;
193 virtual void SetAlign mentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; 195 // get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the
194 //set the vertical text alignment in text box, nFormat (0:top 1:center 2 :bottom). 196 // contents of edit, but don't need to release.
195 virtual void SetAlign mentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; 197 virtual IFX_Edit_Iterator* GetIterator() = 0;
196 //if the text is shown in secret , set a character for substitute. 198 // get a VT pointer relative to this edit.
197 virtual void SetPassw ordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0; 199 virtual IPDF_VariableText* GetVariableText() = 0;
198 //set the maximal count of words of the text. 200 // get the IFX_Edit_FontMap pointer set by user.
199 virtual void SetLimit Char(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; 201 virtual IFX_Edit_FontMap* GetFontMap() = 0;
200 //if set the count of charArray , then all words is shown in equal space . 202
201 virtual void SetCharA rray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; 203 // initialize the edit.
202 //set the space of two characters. 204 virtual void Initialize() = 0;
203 virtual void SetCharS pace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0; 205
204 //set the horizontal scale of all characters. 206 // set the bounding box of the text area.
205 virtual void SetHorzS cale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0; 207 virtual void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) = 0;
206 //set the leading of all lines 208 // set the scroll origin
207 virtual void SetLineL eading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; 209 virtual void SetScrollPos(const CPDF_Point& point) = 0;
208 //if set, CRLF is allowed. 210
209 virtual void SetMulti Line(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0; 211 // set the horizontal text alignment in text box, nFormat (0:left 1:middle
210 //if set, all words auto fit the width of the bounding box. 212 // 2:right).
211 virtual void SetAutoR eturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; 213 virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
212 //if set, a font size is calculated to full fit the bounding box. 214 // set the vertical text alignment in text box, nFormat (0:top 1:center
213 virtual void SetAutoF ontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; 215 // 2:bottom).
214 //is set, the text is allowed to scroll. 216 virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
215 virtual void SetAutoS croll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; 217 // if the text is shown in secret , set a character for substitute.
216 //set the font size of all words. 218 virtual void SetPasswordChar(FX_WORD wSubWord = '*',
217 virtual void SetFontS ize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0; 219 FX_BOOL bPaint = TRUE) = 0;
218 //the text is allowed to auto-scroll, allow the text overflow? 220 // set the maximal count of words of the text.
219 virtual void SetTextO verflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0; 221 virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
220 222 // if set the count of charArray , then all words is shown in equal space.
221 //query if the edit is richedit. 223 virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0;
222 virtual FX_BOOL IsRichTe xt() const = 0; 224 // set the space of two characters.
223 //set the edit is richedit. 225 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f,
224 virtual void SetRichT ext(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; 226 FX_BOOL bPaint = TRUE) = 0;
225 //set the fontsize of selected text. 227 // set the horizontal scale of all characters.
226 virtual FX_BOOL SetRichF ontSize(FX_FLOAT fFontSize) = 0; 228 virtual void SetHorzScale(int32_t nHorzScale = 100,
227 //set the fontindex of selected text, user can change the font of select ed text. 229 FX_BOOL bPaint = TRUE) = 0;
228 virtual FX_BOOL SetRichF ontIndex(int32_t nFontIndex) = 0; 230 // set the leading of all lines
229 //set the textcolor of selected text. 231 virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0;
230 virtual FX_BOOL SetRichT extColor(FX_COLORREF dwColor) = 0; 232 // if set, CRLF is allowed.
231 //set the text script type of selected text. (0:normal 1:superscript 2:s ubscript) 233 virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE,
232 virtual FX_BOOL SetRichT extScript(int32_t nScriptType) = 0; 234 FX_BOOL bPaint = TRUE) = 0;
233 //set the bold font style of selected text. 235 // if set, all words auto fit the width of the bounding box.
234 virtual FX_BOOL SetRichT extBold(FX_BOOL bBold = TRUE) = 0; 236 virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
235 //set the italic font style of selected text. 237 // if set, a font size is calculated to full fit the bounding box.
236 virtual FX_BOOL SetRichT extItalic(FX_BOOL bItalic = TRUE) = 0; 238 virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
237 //set the underline style of selected text. 239 // is set, the text is allowed to scroll.
238 virtual FX_BOOL SetRichT extUnderline(FX_BOOL bUnderline = TRUE) = 0; 240 virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
239 //set the crossout style of selected text. 241 // set the font size of all words.
240 virtual FX_BOOL SetRichT extCrossout(FX_BOOL bCrossout = TRUE) = 0; 242 virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
241 //set the charspace of selected text, in user coordinate. 243 // the text is allowed to auto-scroll, allow the text overflow?
242 virtual FX_BOOL SetRichT extCharSpace(FX_FLOAT fCharSpace) = 0; 244 virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE,
243 //set the horizontal scale of selected text, default value is 100. 245 FX_BOOL bPaint = TRUE) = 0;
244 virtual FX_BOOL SetRichT extHorzScale(int32_t nHorzScale = 100) = 0; 246
245 //set the leading of selected section, in user coordinate. 247 // query if the edit is richedit.
246 virtual FX_BOOL SetRichT extLineLeading(FX_FLOAT fLineLeading) = 0; 248 virtual FX_BOOL IsRichText() const = 0;
247 //set the indent of selected section, in user coordinate. 249 // set the edit is richedit.
248 virtual FX_BOOL SetRichT extLineIndent(FX_FLOAT fLineIndent) = 0; 250 virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
249 //set the alignment of selected section, nAlignment(0:left 1:middle 2:ri ght) 251 // set the fontsize of selected text.
250 virtual FX_BOOL SetRichT extAlignment(int32_t nAlignment) = 0; 252 virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0;
251 253 // set the fontindex of selected text, user can change the font of selected
252 //set the selected range of text. 254 // text.
253 //if nStartChar == 0 and nEndChar == -1, select all the text. 255 virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0;
254 virtual void SetSel(i nt32_t nStartChar,int32_t nEndChar) = 0; 256 // set the textcolor of selected text.
255 //get the selected range of text. 257 virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0;
256 virtual void GetSel(i nt32_t & nStartChar, int32_t & nEndChar) const = 0; 258 // set the text script type of selected text. (0:normal 1:superscript
257 //select all the text. 259 // 2:subscript)
258 virtual void SelectAl l() = 0; 260 virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0;
259 //set text is not selected. 261 // set the bold font style of selected text.
260 virtual void SelectNo ne() = 0; 262 virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
261 //get the caret position. 263 // set the italic font style of selected text.
262 virtual int32_t GetCaret() const = 0; 264 virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
263 virtual CPVT_WordPlace GetCaretWordPlac e() const = 0; 265 // set the underline style of selected text.
264 //get the string of selected text. 266 virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
265 virtual CFX_WideString GetSelText() con st = 0; 267 // set the crossout style of selected text.
266 //get the text conent 268 virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
267 virtual CFX_WideString GetText() const = 0; 269 // set the charspace of selected text, in user coordinate.
268 //query if any text is selected. 270 virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
269 virtual FX_BOOL IsSelect ed() const = 0; 271 // set the horizontal scale of selected text, default value is 100.
270 //get the scroll origin 272 virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0;
271 virtual CPDF_Point GetScrol lPos() const = 0; 273 // set the leading of selected section, in user coordinate.
272 //get the bounding box of the text area. 274 virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
273 virtual CPDF_Rect GetPlate Rect() const = 0; 275 // set the indent of selected section, in user coordinate.
274 //get the fact area of the text. 276 virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
275 virtual CPDF_Rect GetConte ntRect() const = 0; 277 // set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
276 //get the visible word range 278 virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0;
277 virtual CPVT_WordRange GetVisibleWordRa nge() const = 0; 279
278 //get the whole word range 280 // set the selected range of text.
279 virtual CPVT_WordRange GetWholeWordRang e() const = 0; 281 // if nStartChar == 0 and nEndChar == -1, select all the text.
280 //get the word range of select text 282 virtual void SetSel(int32_t nStartChar, int32_t nEndChar) = 0;
281 virtual CPVT_WordRange GetSelectWordRan ge() const = 0; 283 // get the selected range of text.
282 284 virtual void GetSel(int32_t& nStartChar, int32_t& nEndChar) const = 0;
283 //send the mousedown message to edit for response. 285 // select all the text.
284 //if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TR UE. 286 virtual void SelectAll() = 0;
285 virtual void OnMouseD own(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 287 // set text is not selected.
286 //send the mousemove message to edit when mouse down is TRUE. 288 virtual void SelectNone() = 0;
287 virtual void OnMouseM ove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 289 // get the caret position.
288 //send the UP key message to edit. 290 virtual int32_t GetCaret() const = 0;
289 virtual void OnVK_UP( FX_BOOL bShift,FX_BOOL bCtrl) = 0; 291 virtual CPVT_WordPlace GetCaretWordPlace() const = 0;
290 //send the DOWN key message to edit. 292 // get the string of selected text.
291 virtual void OnVK_DOW N(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 293 virtual CFX_WideString GetSelText() const = 0;
292 //send the LEFT key message to edit. 294 // get the text conent
293 virtual void OnVK_LEF T(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 295 virtual CFX_WideString GetText() const = 0;
294 //send the RIGHT key message to edit. 296 // query if any text is selected.
295 virtual void OnVK_RIG HT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 297 virtual FX_BOOL IsSelected() const = 0;
296 //send the HOME key message to edit. 298 // get the scroll origin
297 virtual void OnVK_HOM E(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 299 virtual CPDF_Point GetScrollPos() const = 0;
298 //send the END key message to edit. 300 // get the bounding box of the text area.
299 virtual void OnVK_END (FX_BOOL bShift,FX_BOOL bCtrl) = 0; 301 virtual CPDF_Rect GetPlateRect() const = 0;
300 302 // get the fact area of the text.
301 //put text into edit. 303 virtual CPDF_Rect GetContentRect() const = 0;
302 virtual void SetText( const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, 304 // get the visible word range
303 const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr ops * pWordProps = NULL) = 0; 305 virtual CPVT_WordRange GetVisibleWordRange() const = 0;
304 //insert a word into the edit. 306 // get the whole word range
305 virtual FX_BOOL InsertWo rd(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWord Props = NULL) = 0; 307 virtual CPVT_WordRange GetWholeWordRange() const = 0;
306 //insert a return into the edit. 308 // get the word range of select text
307 virtual FX_BOOL InsertRe turn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; 309 virtual CPVT_WordRange GetSelectWordRange() const = 0;
308 //insert text into the edit. 310
309 virtual FX_BOOL InsertTe xt(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, 311 // send the mousedown message to edit for response.
310 const CPVT_SecProps * pSecProps = NULL,const CPVT_WordPr ops * pWordProps = NULL) = 0; 312 // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
311 //do backspace operation. 313 virtual void OnMouseDown(const CPDF_Point& point,
312 virtual FX_BOOL Backspac e() = 0; 314 FX_BOOL bShift,
313 //do delete operation. 315 FX_BOOL bCtrl) = 0;
314 virtual FX_BOOL Delete() = 0; 316 // send the mousemove message to edit when mouse down is TRUE.
315 //delete the selected text. 317 virtual void OnMouseMove(const CPDF_Point& point,
316 virtual FX_BOOL Clear() = 0; 318 FX_BOOL bShift,
317 319 FX_BOOL bCtrl) = 0;
318 //do Redo operation. 320 // send the UP key message to edit.
319 virtual FX_BOOL Redo() = 0; 321 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
320 //do Undo operation. 322 // send the DOWN key message to edit.
321 virtual FX_BOOL Undo() = 0; 323 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
322 //move caret 324 // send the LEFT key message to edit.
323 virtual void SetCaret (int32_t nPos) = 0; 325 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
324 326 // send the RIGHT key message to edit.
325 //arrange all words over again 327 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
326 virtual void Paint() = 0; 328 // send the HOME key message to edit.
327 329 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
328 //allow to refresh screen? 330 // send the END key message to edit.
329 virtual void EnableRe fresh(FX_BOOL bRefresh) = 0; 331 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
330 332
331 virtual void RefreshW ordRange(const CPVT_WordRange& wr) = 0; 333 // put text into edit.
332 334 virtual void SetText(const FX_WCHAR* text,
333 //allow undo/redo? 335 int32_t charset = DEFAULT_CHARSET,
334 virtual void EnableUn do(FX_BOOL bUndo) = 0; 336 const CPVT_SecProps* pSecProps = NULL,
335 337 const CPVT_WordProps* pWordProps = NULL) = 0;
336 //allow notify? 338 // insert a word into the edit.
337 virtual void EnableNo tify(FX_BOOL bNotify) = 0; 339 virtual FX_BOOL InsertWord(FX_WORD word,
338 340 int32_t charset = DEFAULT_CHARSET,
339 //allow opr notify? 341 const CPVT_WordProps* pWordProps = NULL) = 0;
340 virtual void EnableOp rNotify(FX_BOOL bNotify) = 0; 342 // insert a return into the edit.
341 343 virtual FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL,
342 //map word place to word index. 344 const CPVT_WordProps* pWordProps = NULL) = 0;
343 virtual int32_t WordPlaceToWordI ndex(const CPVT_WordPlace & place) const = 0; 345 // insert text into the edit.
344 //map word index to word place. 346 virtual FX_BOOL InsertText(const FX_WCHAR* text,
345 virtual CPVT_WordPlace WordIndexToWordP lace(int32_t index) const = 0; 347 int32_t charset = DEFAULT_CHARSET,
346 348 const CPVT_SecProps* pSecProps = NULL,
347 //get the beginning position of a line 349 const CPVT_WordProps* pWordProps = NULL) = 0;
348 virtual CPVT_WordPlace GetLineBeginPlac e(const CPVT_WordPlace & place) const = 0; 350 // do backspace operation.
349 351 virtual FX_BOOL Backspace() = 0;
350 //get the ending position of a line 352 // do delete operation.
351 virtual CPVT_WordPlace GetLineEndPlace( const CPVT_WordPlace & place) const = 0; 353 virtual FX_BOOL Delete() = 0;
352 354 // delete the selected text.
353 //get the beginning position of a section 355 virtual FX_BOOL Clear() = 0;
354 virtual CPVT_WordPlace GetSectionBeginP lace(const CPVT_WordPlace & place) const = 0; 356
355 357 // do Redo operation.
356 //get the ending position of a section 358 virtual FX_BOOL Redo() = 0;
357 virtual CPVT_WordPlace GetSectionEndPla ce(const CPVT_WordPlace & place) const = 0; 359 // do Undo operation.
358 360 virtual FX_BOOL Undo() = 0;
359 //search a wordplace form point 361 // move caret
360 virtual CPVT_WordPlace SearchWordPlace( const CPDF_Point& point) const = 0; 362 virtual void SetCaret(int32_t nPos) = 0;
361 363
362 //get the font size of non_rich text or default font size of richtext. 364 // arrange all words over again
363 virtual FX_FLOAT GetFontS ize() const = 0; 365 virtual void Paint() = 0;
364 //get the mask character. 366
365 virtual FX_WORD GetPassw ordChar() const = 0; 367 // allow to refresh screen?
366 //get the count of charArray 368 virtual void EnableRefresh(FX_BOOL bRefresh) = 0;
367 virtual int32_t GetCharArray() c onst = 0; 369
368 //get the horizontal scale of all characters 370 virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0;
369 virtual int32_t GetHorzScale() c onst = 0; 371
370 //get the space of two characters 372 // allow undo/redo?
371 virtual FX_FLOAT GetCharS pace() const = 0; 373 virtual void EnableUndo(FX_BOOL bUndo) = 0;
372 //get the latin words of specified range 374
373 virtual CFX_WideString GetRangeText(con st CPVT_WordRange & range) const = 0; 375 // allow notify?
374 //is the text full in bounding box 376 virtual void EnableNotify(FX_BOOL bNotify) = 0;
375 virtual FX_BOOL IsTextFu ll() const = 0; 377
376 virtual FX_BOOL CanUndo( ) const = 0; 378 // allow opr notify?
377 virtual FX_BOOL CanRedo( ) const = 0; 379 virtual void EnableOprNotify(FX_BOOL bNotify) = 0;
378 //if the content is changed after settext? 380
379 virtual FX_BOOL IsModifi ed() const = 0; 381 // map word place to word index.
380 //get the total words in edit 382 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0;
381 virtual int32_t GetTotalWords() const = 0; 383 // map word index to word place.
382 384 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0;
383 virtual void AddUndoI tem(IFX_Edit_UndoItem* pUndoItem) = 0; 385
384 386 // get the beginning position of a line
385 static CFX_ByteString GetEditAppearanc eStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, 387 virtual CPVT_WordPlace GetLineBeginPlace(
386 const CPVT_WordRange* pRange = NULL, 388 const CPVT_WordPlace& place) const = 0;
387 FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); 389
388 static CFX_ByteString GetSelectAppeara nceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pR ange = NULL); 390 // get the ending position of a line
389 static void DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, 391 virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const = 0;
390 const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, con st CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData); 392
391 static void DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pE dit, FX_COLORREF color, 393 // get the beginning position of a section
392 const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, con st CPVT_WordRange* pRange); 394 virtual CPVT_WordPlace GetSectionBeginPlace(
393 static void DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEd it, 395 const CPVT_WordPlace& place) const = 0;
394 const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, con st CPVT_WordRange* pRange); 396
395 static void GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit, 397 // get the ending position of a section
396 const CPDF_Point& ptOffset, const CPVT_WordRange* pRange , FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); 398 virtual CPVT_WordPlace GetSectionEndPlace(
397 static void GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit, 399 const CPVT_WordPlace& place) const = 0;
398 const CPDF_Point& ptOffset, const CPVT_WordRange* pRange , CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); 400
399 static void GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit, 401 // search a wordplace form point
400 const CPDF_Point& ptOffset, const CPVT_WordRange* pRange , FX_COLORREF color); 402 virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
401 403
402 protected: 404 // get the font size of non_rich text or default font size of richtext.
403 ~IFX_Edit() { } 405 virtual FX_FLOAT GetFontSize() const = 0;
404 }; 406 // get the mask character.
405 407 virtual FX_WORD GetPasswordChar() const = 0;
406 class IFX_List_Notify 408 // get the count of charArray
407 { 409 virtual int32_t GetCharArray() const = 0;
408 public: 410 // get the horizontal scale of all characters
409 virtual ~IFX_List_Notify() { } 411 virtual int32_t GetHorzScale() const = 0;
410 //set the horizontal scrollbar information. 412 // get the space of two characters
411 virtual void IOnSetSc rollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 413 virtual FX_FLOAT GetCharSpace() const = 0;
412 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 414 // get the latin words of specified range
413 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; 415 virtual CFX_WideString GetRangeText(const CPVT_WordRange& range) const = 0;
414 //set the vertical scrollbar information. 416 // is the text full in bounding box
415 virtual void IOnSetSc rollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 417 virtual FX_BOOL IsTextFull() const = 0;
416 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 418 virtual FX_BOOL CanUndo() const = 0;
417 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; 419 virtual FX_BOOL CanRedo() const = 0;
418 //set the position of horizontal scrollbar. 420 // if the content is changed after settext?
419 virtual void IOnSetSc rollPosX(FX_FLOAT fx) = 0; 421 virtual FX_BOOL IsModified() const = 0;
420 //set the position of vertical scrollbar. 422 // get the total words in edit
421 virtual void IOnSetSc rollPosY(FX_FLOAT fy) = 0; 423 virtual int32_t GetTotalWords() const = 0;
422 //Invalidate the rectangle relative to the bounding box of edit. 424
423 virtual void IOnInval idateRect(CPDF_Rect * pRect) = 0; 425 virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
424 }; 426
425 427 static CFX_ByteString GetEditAppearanceStream(
426 class IFX_List 428 IFX_Edit* pEdit,
427 { 429 const CPDF_Point& ptOffset,
428 public: 430 const CPVT_WordRange* pRange = NULL,
429 static IFX_List* NewList( ); 431 FX_BOOL bContinuous = TRUE,
430 static void DelList(IFX_List* pList); 432 FX_WORD SubWord = 0);
431 433 static CFX_ByteString GetSelectAppearanceStream(
432 virtual void SetFontM ap(IFX_Edit_FontMap * pFontMap) = 0; 434 IFX_Edit* pEdit,
433 virtual void SetNotif y(IFX_List_Notify * pNotify) = 0; 435 const CPDF_Point& ptOffset,
434 436 const CPVT_WordRange* pRange = NULL);
435 virtual void SetPlate Rect(const CPDF_Rect & rect) = 0; 437 static void DrawEdit(CFX_RenderDevice* pDevice,
436 virtual void SetFontS ize(FX_FLOAT fFontSize) = 0; 438 CPDF_Matrix* pUser2Device,
437 439 IFX_Edit* pEdit,
438 virtual CPDF_Rect GetPlate Rect() const = 0; 440 FX_COLORREF crTextFill,
439 virtual CPDF_Rect GetConte ntRect() const = 0; 441 FX_COLORREF crTextStroke,
440 442 const CPDF_Rect& rcClip,
441 virtual FX_FLOAT GetFontS ize() const = 0; 443 const CPDF_Point& ptOffset,
442 virtual IFX_Edit* GetItemE dit(int32_t nIndex) const = 0; 444 const CPVT_WordRange* pRange,
443 virtual int32_t GetCount() const = 0; 445 IFX_SystemHandler* pSystemHandler,
444 virtual FX_BOOL IsItemSe lected(int32_t nIndex) const = 0; 446 void* pFFLData);
445 virtual FX_FLOAT GetFirst Height() const = 0; 447 static void DrawUnderline(CFX_RenderDevice* pDevice,
446 448 CPDF_Matrix* pUser2Device,
447 virtual void SetMulti pleSel(FX_BOOL bMultiple) = 0; 449 IFX_Edit* pEdit,
448 virtual FX_BOOL IsMultip leSel() const = 0; 450 FX_COLORREF color,
449 virtual FX_BOOL IsValid( int32_t nItemIndex) const = 0; 451 const CPDF_Rect& rcClip,
450 virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0; 452 const CPDF_Point& ptOffset,
451 453 const CPVT_WordRange* pRange);
452 virtual void SetScrol lPos(const CPDF_Point & point) = 0; 454 static void DrawRichEdit(CFX_RenderDevice* pDevice,
453 virtual void ScrollTo ListItem(int32_t nItemIndex) = 0; 455 CPDF_Matrix* pUser2Device,
454 virtual CPDF_Rect GetItemR ect(int32_t nIndex) const = 0; 456 IFX_Edit* pEdit,
455 virtual int32_t GetCaret() const = 0; 457 const CPDF_Rect& rcClip,
456 virtual int32_t GetSelect() cons t = 0; 458 const CPDF_Point& ptOffset,
457 virtual int32_t GetTopItem() con st = 0; 459 const CPVT_WordRange* pRange);
458 virtual int32_t GetItemIndex(con st CPDF_Point & point) const = 0; 460 static void GeneratePageObjects(
459 virtual int32_t GetFirstSelected () const = 0; 461 CPDF_PageObjects* pPageObjects,
460 462 IFX_Edit* pEdit,
461 virtual void AddStrin g(const FX_WCHAR* string) = 0; 463 const CPDF_Point& ptOffset,
462 virtual void SetTopIt em(int32_t nIndex) = 0; 464 const CPVT_WordRange* pRange,
463 virtual void Select(i nt32_t nItemIndex) = 0; 465 FX_COLORREF crText,
464 virtual void SetCaret (int32_t nItemIndex) = 0; 466 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
465 virtual void Empty() = 0; 467 static void GenerateRichPageObjects(
466 virtual void Cancel() = 0; 468 CPDF_PageObjects* pPageObjects,
467 virtual CFX_WideString GetText() const = 0; 469 IFX_Edit* pEdit,
468 470 const CPDF_Point& ptOffset,
469 471 const CPVT_WordRange* pRange,
470 virtual void OnMouseD own(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 472 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
471 virtual void OnMouseM ove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 473 static void GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects,
472 virtual void OnVK_UP( FX_BOOL bShift,FX_BOOL bCtrl) = 0; 474 IFX_Edit* pEdit,
473 virtual void OnVK_DOW N(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 475 const CPDF_Point& ptOffset,
474 virtual void OnVK_LEF T(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 476 const CPVT_WordRange* pRange,
475 virtual void OnVK_RIG HT(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 477 FX_COLORREF color);
476 virtual void OnVK_HOM E(FX_BOOL bShift,FX_BOOL bCtrl) = 0; 478
477 virtual void OnVK_END (FX_BOOL bShift,FX_BOOL bCtrl) = 0; 479 protected:
478 virtual void OnVK(int 32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 480 ~IFX_Edit() {}
479 virtual FX_BOOL OnChar(F X_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0; 481 };
480 482
481 protected: 483 class IFX_List_Notify {
482 ~IFX_List() { } 484 public:
485 virtual ~IFX_List_Notify() {}
486 // set the horizontal scrollbar information.
487 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin,
488 FX_FLOAT fPlateMax,
489 FX_FLOAT fContentMin,
490 FX_FLOAT fContentMax,
491 FX_FLOAT fSmallStep,
492 FX_FLOAT fBigStep) = 0;
493 // set the vertical scrollbar information.
494 virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
495 FX_FLOAT fPlateMax,
496 FX_FLOAT fContentMin,
497 FX_FLOAT fContentMax,
498 FX_FLOAT fSmallStep,
499 FX_FLOAT fBigStep) = 0;
500 // set the position of horizontal scrollbar.
501 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
502 // set the position of vertical scrollbar.
503 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
504 // Invalidate the rectangle relative to the bounding box of edit.
505 virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0;
506 };
507
508 class IFX_List {
509 public:
510 static IFX_List* NewList();
511 static void DelList(IFX_List* pList);
512
513 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
514 virtual void SetNotify(IFX_List_Notify* pNotify) = 0;
515
516 virtual void SetPlateRect(const CPDF_Rect& rect) = 0;
517 virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
518
519 virtual CPDF_Rect GetPlateRect() const = 0;
520 virtual CPDF_Rect GetContentRect() const = 0;
521
522 virtual FX_FLOAT GetFontSize() const = 0;
523 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0;
524 virtual int32_t GetCount() const = 0;
525 virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0;
526 virtual FX_FLOAT GetFirstHeight() const = 0;
527
528 virtual void SetMultipleSel(FX_BOOL bMultiple) = 0;
529 virtual FX_BOOL IsMultipleSel() const = 0;
530 virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0;
531 virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const = 0;
532
533 virtual void SetScrollPos(const CPDF_Point& point) = 0;
534 virtual void ScrollToListItem(int32_t nItemIndex) = 0;
535 virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0;
536 virtual int32_t GetCaret() const = 0;
537 virtual int32_t GetSelect() const = 0;
538 virtual int32_t GetTopItem() const = 0;
539 virtual int32_t GetItemIndex(const CPDF_Point& point) const = 0;
540 virtual int32_t GetFirstSelected() const = 0;
541
542 virtual void AddString(const FX_WCHAR* string) = 0;
543 virtual void SetTopItem(int32_t nIndex) = 0;
544 virtual void Select(int32_t nItemIndex) = 0;
545 virtual void SetCaret(int32_t nItemIndex) = 0;
546 virtual void Empty() = 0;
547 virtual void Cancel() = 0;
548 virtual CFX_WideString GetText() const = 0;
549
550 virtual void OnMouseDown(const CPDF_Point& point,
551 FX_BOOL bShift,
552 FX_BOOL bCtrl) = 0;
553 virtual void OnMouseMove(const CPDF_Point& point,
554 FX_BOOL bShift,
555 FX_BOOL bCtrl) = 0;
556 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
557 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
558 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
559 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
560 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
561 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0;
562 virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0;
563 virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0;
564
565 protected:
566 ~IFX_List() {}
483 }; 567 };
484 568
485 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ 569 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698