merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.
[pdfium.git] / fpdfsdk / include / fxedit / fx_edit.h
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4  
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef _FX_EDIT_H_
8 #define _FX_EDIT_H_
9
10 #define PVTWORD_STYLE_NORMAL                            0x0000L
11 #define PVTWORD_STYLE_HIGHLIGHT                         0x0001L
12 #define PVTWORD_STYLE_UNDERLINE                         0x0002L
13 #define PVTWORD_STYLE_CROSSOUT                          0x0004L
14 #define PVTWORD_STYLE_SQUIGGLY                          0x0008L
15 #define PVTWORD_STYLE_DUALCROSSOUT                      0x0010L
16 #define PVTWORD_STYLE_BOLD                                      0x0020L
17 #define PVTWORD_STYLE_ITALIC                            0x0040L
18
19 #define FX_EDIT_ISLATINWORD(u)  (u == 0x2D || (u <= 0x005A && u >= 0x0041) || (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0))
20
21 #ifdef FX_READER_DLL
22         #ifdef FXET_EXPORT
23                 #define FXET_CLASS __declspec(dllexport)
24         #else
25                 #define FXET_CLASS
26         #endif
27 #else
28         #define FXET_CLASS
29 #endif
30
31 #ifndef DEFAULT_CHARSET
32 #define DEFAULT_CHARSET         1
33 #endif 
34
35 class IFX_Edit_FontMap;
36 class IFX_Edit_Notify;
37 class IFX_Edit_Iterator;
38 class IFX_Edit_UndoItem;
39 class IFX_Edit;
40 class IFX_List_Notify;
41 class IFX_List;
42 class IFX_SystemHandler;
43
44 class IFX_Edit_FontMap
45 {
46 public:
47         virtual ~IFX_Edit_FontMap() { }
48         //map a fontindex to pdf font.
49         virtual CPDF_Font *                                             GetPDFFont(FX_INT32 nFontIndex) = 0;
50         //get the alias of a pdf font.
51         virtual CFX_ByteString                                  GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
52         //get the index of a font that can show a word.
53         virtual FX_INT32                                                GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
54         //get the charcode of word from unicode
55         virtual FX_INT32                                                CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) = 0;
56         //get the charset of unicode
57         virtual FX_INT32                                                CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) = 0;
58 };
59
60 class IFX_Edit_Notify
61 {
62 public:
63         virtual ~IFX_Edit_Notify() { }
64         //set the horizontal scrollbar information.
65         virtual void                                                    IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
66                                                                                                 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
67                                                                                                 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
68         //set the vertical scrollbar information.
69         virtual void                                                    IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
70                                                                                                 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
71                                                                                                 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
72         //set the position of horizontal scrollbar.
73         virtual void                                                    IOnSetScrollPosX(FX_FLOAT fx) = 0;
74         //set the position of vertical scrollbar.
75         virtual void                                                    IOnSetScrollPosY(FX_FLOAT fy) = 0;
76         //set the caret information.
77         virtual void                                                    IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0;
78         //if the caret position is changed ,send the information of current postion to user.
79         virtual void                                                    IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) = 0;
80         //if the text area is changed, send the information to user.
81         virtual void                                                    IOnContentChange(const CPDF_Rect& rcContent) = 0;
82         //Invalidate the rectangle relative to the bounding box of edit.
83         virtual void                                                    IOnInvalidateRect(CPDF_Rect * pRect) = 0;
84 };
85
86 class IFX_Edit_OprNotify
87 {
88 public:
89         virtual ~IFX_Edit_OprNotify() { }
90
91         //OprType: 0
92         virtual void                                                    OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
93         //OprType: 1
94         virtual void                                                    OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
95         //OprType: 2
96         virtual void                                                    OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
97         //OprType: 3
98         virtual void                                                    OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
99         //OprType: 4
100         virtual void                                                    OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
101         //OprType: 5
102         virtual void                                                    OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
103         //OprType: 6
104         virtual void                                                    OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
105         //
106         virtual void                                                    OnAddUndo(IFX_Edit_UndoItem* pUndoItem) = 0;
107 };
108
109 class IFX_Edit_Iterator
110 {
111 public:
112         virtual ~IFX_Edit_Iterator()  {}
113 public:
114         //move the current position to the next word.
115         virtual FX_BOOL                                                 NextWord() = 0;
116         //move the current position to the next line.
117         virtual FX_BOOL                                                 NextLine() = 0;
118         //move the current position to the next section. 
119         virtual FX_BOOL                                                 NextSection() = 0;
120
121         //move the current position to the previous word.
122         virtual FX_BOOL                                                 PrevWord() = 0;
123         //move the current position to the previous line.
124         virtual FX_BOOL                                                 PrevLine() = 0;
125         //move the current position to the previous section. 
126         virtual FX_BOOL                                                 PrevSection() = 0;
127
128         //get the information of the current word.
129         virtual FX_BOOL                                                 GetWord(CPVT_Word & word) const = 0;
130         //get the information of the current line.
131         virtual FX_BOOL                                                 GetLine(CPVT_Line & line) const = 0;
132         //get the information of the current section.
133         virtual FX_BOOL                                                 GetSection(CPVT_Section & section) const = 0;
134         //set the current position.
135         virtual void                                                    SetAt(FX_INT32 nWordIndex) = 0;
136         //set the current position.
137         virtual void                                                    SetAt(const CPVT_WordPlace & place) = 0;
138         //get the current position.
139         virtual const CPVT_WordPlace &                  GetAt() const = 0;
140
141         //get the edit which this iterator belongs to
142         virtual IFX_Edit*                                               GetEdit() const = 0;
143 };
144
145 class IFX_Edit_UndoItem
146 {
147 public:
148         virtual void                                                    Release() = 0;
149         virtual void                                                    Undo() = 0;
150         virtual void                                                    Redo() = 0;
151         virtual CFX_WideString                                  GetUndoTitle() = 0;
152
153 protected:
154         ~IFX_Edit_UndoItem() { }
155 };
156
157 class FXET_CLASS IFX_Edit
158 {
159 public:
160         static IFX_Edit*                                                NewEdit();
161         static  void                                                    DelEdit(IFX_Edit* pEdit);
162
163         //set a IFX_Edit_FontMap pointer implemented by user.
164         virtual void                                                    SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
165         //if user don't like to use FontMap, implement VTProvider and set it directly.
166         virtual void                                                    SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
167         //set a IFX_Edit_Notify pointer implemented by user.
168         virtual void                                                    SetNotify(IFX_Edit_Notify * pNotify) = 0;
169         virtual void                                                    SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0;
170         //get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the contents of edit, but don't need to release.
171         virtual IFX_Edit_Iterator*                              GetIterator() = 0;
172         //get a VT pointer relative to this edit.
173         virtual IPDF_VariableText*                              GetVariableText() = 0;
174         //get the IFX_Edit_FontMap pointer set by user.
175         virtual IFX_Edit_FontMap*                               GetFontMap() = 0;
176
177         //initialize the edit.
178         virtual void                                                    Initialize() = 0;
179
180         //set the bounding box of the text area.
181         virtual void                                                    SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE) = 0;
182         //set the scroll origin
183         virtual void                                                    SetScrollPos(const CPDF_Point & point) = 0;
184
185         //set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right).
186         virtual void                                                    SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
187         //set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom).
188         virtual void                                                    SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
189         //if the text is shown in secret , set a character for substitute.
190         virtual void                                                    SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0;
191         //set the maximal count of words of the text.
192         virtual void                                                    SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
193         //if set the count of charArray , then all words is shown in equal space.
194         virtual void                                                    SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE) = 0;
195         //set the space of two characters.
196         virtual void                                                    SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0;
197         //set the horizontal scale of all characters.
198         virtual void                                                    SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0;
199         //set the leading of all lines
200         virtual void                                                    SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0;
201         //if set, CRLF is allowed.
202         virtual void                                                    SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0;
203         //if set, all words auto fit the width of the bounding box.     
204         virtual void                                                    SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
205         //if set, a font size is calculated to full fit the bounding box.
206         virtual void                                                    SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
207         //is set, the text is allowed to scroll.
208         virtual void                                                    SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
209         //set the font size of all words.
210         virtual void                                                    SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
211         //the text is allowed to auto-scroll, allow the text overflow?
212         virtual void                                                    SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0;
213
214         //query if the edit is richedit.
215         virtual FX_BOOL                                                 IsRichText() const = 0;
216         //set the edit is richedit.
217         virtual void                                                    SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
218         //set the fontsize of selected text.
219         virtual FX_BOOL                                                 SetRichFontSize(FX_FLOAT fFontSize) = 0;        
220         //set the fontindex of selected text, user can change the font of selected text.
221         virtual FX_BOOL                                                 SetRichFontIndex(FX_INT32 nFontIndex) = 0;
222         //set the textcolor of selected text.
223         virtual FX_BOOL                                                 SetRichTextColor(FX_COLORREF dwColor) = 0;
224         //set the text script type of selected text. (0:normal 1:superscript 2:subscript)
225         virtual FX_BOOL                                                 SetRichTextScript(FX_INT32 nScriptType) = 0;    
226         //set the bold font style of selected text.
227         virtual FX_BOOL                                                 SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
228         //set the italic font style of selected text.
229         virtual FX_BOOL                                                 SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
230         //set the underline style of selected text.
231         virtual FX_BOOL                                                 SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
232         //set the crossout style of selected text.
233         virtual FX_BOOL                                                 SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
234         //set the charspace of selected text, in user coordinate.
235         virtual FX_BOOL                                                 SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
236         //set the horizontal scale of selected text, default value is 100.
237         virtual FX_BOOL                                                 SetRichTextHorzScale(FX_INT32 nHorzScale = 100) = 0;
238         //set the leading of selected section, in user coordinate.
239         virtual FX_BOOL                                                 SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
240         //set the indent of selected section, in user coordinate.
241         virtual FX_BOOL                                                 SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
242         //set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
243         virtual FX_BOOL                                                 SetRichTextAlignment(FX_INT32 nAlignment) = 0;
244
245         //set the selected range of text.
246         //if nStartChar == 0 and nEndChar == -1, select all the text.
247         virtual void                                                    SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) = 0;
248         //get the selected range of text.
249         virtual void                                                    GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const = 0;
250         //select all the text.
251         virtual void                                                    SelectAll() = 0;
252         //set text is not selected.
253         virtual void                                                    SelectNone() = 0;               
254         //get the caret position.
255         virtual FX_INT32                                                GetCaret() const = 0;
256         virtual CPVT_WordPlace                                  GetCaretWordPlace() const = 0;
257         //get the string of selected text.
258         virtual CFX_WideString                                  GetSelText() const = 0;
259         //get the text conent
260         virtual CFX_WideString                                  GetText() const = 0;
261         //query if any text is selected.
262         virtual FX_BOOL                                                 IsSelected() const = 0; 
263         //get the scroll origin
264         virtual CPDF_Point                                              GetScrollPos() const = 0;
265         //get the bounding box of the text area.
266         virtual CPDF_Rect                                               GetPlateRect() const = 0;
267         //get the fact area of the text.
268         virtual CPDF_Rect                                               GetContentRect() const = 0;
269         //get the visible word range
270         virtual CPVT_WordRange                                  GetVisibleWordRange() const = 0;
271         //get the whole word range
272         virtual CPVT_WordRange                                  GetWholeWordRange() const = 0;
273         //get the word range of select text
274         virtual CPVT_WordRange                                  GetSelectWordRange() const = 0;
275
276         //send the mousedown message to edit for response.
277         //if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
278         virtual void                                                    OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
279         //send the mousemove message to edit when mouse down is TRUE.
280         virtual void                                                    OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
281         //send the UP key message to edit.
282         virtual void                                                    OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
283         //send the DOWN key message to edit.
284         virtual void                                                    OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
285         //send the LEFT key message to edit.
286         virtual void                                                    OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
287         //send the RIGHT key message to edit.
288         virtual void                                                    OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
289         //send the HOME key message to edit.
290         virtual void                                                    OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
291         //send the END key message to edit.
292         virtual void                                                    OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
293
294         //put text into edit.
295         virtual void                                                    SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET,
296                                                                                                         const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;   
297         //insert a word into the edit.
298         virtual FX_BOOL                                                 InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0;
299         //insert a return into the edit.
300         virtual FX_BOOL                                                 InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;      
301         //insert text into the edit.
302         virtual FX_BOOL                                                 InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET,
303                                                                                                         const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
304         //do backspace operation.
305         virtual FX_BOOL                                                 Backspace() = 0;
306         //do delete operation.
307         virtual FX_BOOL                                                 Delete() = 0;   
308         //delete the selected text.
309         virtual FX_BOOL                                                 Clear() = 0;
310
311         //do Redo operation.
312         virtual FX_BOOL                                                 Redo() = 0;
313         //do Undo operation.
314         virtual FX_BOOL                                                 Undo() = 0;
315         //move caret
316         virtual void                                                    SetCaret(FX_INT32 nPos) = 0;
317
318         //arrange all words over again
319         virtual void                                                    Paint() = 0;
320         
321         //allow to refresh screen?
322         virtual void                                                    EnableRefresh(FX_BOOL bRefresh) = 0;
323
324         virtual void                                                    RefreshWordRange(const CPVT_WordRange& wr) = 0;
325
326         //allow undo/redo?
327         virtual void                                                    EnableUndo(FX_BOOL bUndo) = 0;
328
329         //allow notify?
330         virtual void                                                    EnableNotify(FX_BOOL bNotify) = 0;
331
332         //allow opr notify?
333         virtual void                                                    EnableOprNotify(FX_BOOL bNotify) = 0;
334
335         //map word place to word index.
336         virtual FX_INT32                                                WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
337         //map word index to word place.
338         virtual CPVT_WordPlace                                  WordIndexToWordPlace(FX_INT32 index) const = 0;
339
340         //get the beginning position of a line
341         virtual CPVT_WordPlace                                  GetLineBeginPlace(const CPVT_WordPlace & place) const = 0;
342
343         //get the ending position of a line
344         virtual CPVT_WordPlace                                  GetLineEndPlace(const CPVT_WordPlace & place) const = 0;
345
346         //get the beginning position of a section
347         virtual CPVT_WordPlace                                  GetSectionBeginPlace(const CPVT_WordPlace & place) const = 0;
348
349         //get the ending position of a section
350         virtual CPVT_WordPlace                                  GetSectionEndPlace(const CPVT_WordPlace & place) const = 0;
351
352         //search a wordplace form point
353         virtual CPVT_WordPlace                                  SearchWordPlace(const CPDF_Point& point) const = 0;
354
355         //get the font size of non_rich text or default font size of richtext.
356         virtual FX_FLOAT                                                GetFontSize() const = 0;
357         //get the mask character.
358         virtual FX_WORD                                                 GetPasswordChar() const = 0;
359         //get the count of charArray
360         virtual FX_INT32                                                GetCharArray() const = 0;
361         //get the horizontal scale of all characters
362         virtual FX_INT32                                                GetHorzScale() const = 0;
363         //get the space of two characters
364         virtual FX_FLOAT                                                GetCharSpace() const = 0;
365         //get the latin words of specified range
366         virtual CFX_WideString                                  GetRangeText(const CPVT_WordRange & range) const = 0;
367         //is the text full in bounding box
368         virtual FX_BOOL                                                 IsTextFull() const = 0;
369         virtual FX_BOOL                                                 CanUndo() const = 0;
370         virtual FX_BOOL                                                 CanRedo() const = 0;
371         //if the content is changed after settext?
372         virtual FX_BOOL                                                 IsModified() const = 0;
373         //get the total words in edit
374         virtual FX_INT32                                                GetTotalWords() const = 0;
375
376         virtual void                                                    AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
377
378         static CFX_ByteString                                   GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, 
379                                                                                                         const CPVT_WordRange* pRange = NULL, 
380                                                                                                         FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
381         static CFX_ByteString                                   GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pRange = NULL);
382         static void                                                             DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
383                                                                                                         const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData);
384         static void                                                             DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color,
385                                                                                                         const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
386         static void                                                             DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,  
387                                                                                                         const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
388         static void                                                             GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
389                                                                                                         const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
390         static void                                                             GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
391                                                                                                         const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
392         static void                                                             GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
393                                                                                                         const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color);
394
395 protected:
396     ~IFX_Edit() { }
397 };
398
399 class IFX_List_Notify
400 {
401 public:
402         virtual ~IFX_List_Notify() { }
403         //set the horizontal scrollbar information.
404         virtual void                                                    IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
405                                                                                                 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
406                                                                                                 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
407         //set the vertical scrollbar information.
408         virtual void                                                    IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, 
409                                                                                                 FX_FLOAT fContentMin, FX_FLOAT fContentMax, 
410                                                                                                 FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
411         //set the position of horizontal scrollbar.
412         virtual void                                                    IOnSetScrollPosX(FX_FLOAT fx) = 0;
413         //set the position of vertical scrollbar.
414         virtual void                                                    IOnSetScrollPosY(FX_FLOAT fy) = 0;
415         //Invalidate the rectangle relative to the bounding box of edit.
416         virtual void                                                    IOnInvalidateRect(CPDF_Rect * pRect) = 0;
417 };
418
419 class FXET_CLASS IFX_List
420 {
421 public:
422         static IFX_List*                                                NewList();
423         static void                                                             DelList(IFX_List* pList);
424
425         virtual void                                                    SetFontMap(IFX_Edit_FontMap * pFontMap) = 0;
426         virtual void                                                    SetNotify(IFX_List_Notify * pNotify) = 0;
427
428         virtual void                                                    SetPlateRect(const CPDF_Rect & rect) = 0;
429         virtual void                                                    SetFontSize(FX_FLOAT fFontSize) = 0;
430
431         virtual CPDF_Rect                                               GetPlateRect() const = 0;
432         virtual CPDF_Rect                                               GetContentRect() const = 0;
433
434         virtual FX_FLOAT                                                GetFontSize() const = 0;
435         virtual IFX_Edit*                                               GetItemEdit(FX_INT32 nIndex) const = 0;
436         virtual FX_INT32                                                GetCount() const = 0;
437         virtual FX_BOOL                                                 IsItemSelected(FX_INT32 nIndex) const = 0;
438         virtual FX_FLOAT                                                GetFirstHeight() const = 0;
439         
440         virtual void                                                    SetMultipleSel(FX_BOOL bMultiple) = 0;
441         virtual FX_BOOL                                                 IsMultipleSel() const = 0;      
442         virtual FX_BOOL                                                 IsValid(FX_INT32 nItemIndex) const = 0;
443         virtual FX_INT32                                                FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const = 0;     
444
445         virtual void                                                    SetScrollPos(const CPDF_Point & point) = 0;
446         virtual void                                                    ScrollToListItem(FX_INT32 nItemIndex) = 0;
447         virtual CPDF_Rect                                               GetItemRect(FX_INT32 nIndex) const = 0;
448         virtual FX_INT32                                                GetCaret() const = 0;
449         virtual FX_INT32                                                GetSelect() const = 0;  
450         virtual FX_INT32                                                GetTopItem() const = 0;
451         virtual FX_INT32                                                GetItemIndex(const CPDF_Point & point) const = 0;
452         virtual FX_INT32                                                GetFirstSelected() const = 0;
453
454         virtual void                                                    AddString(FX_LPCWSTR string) = 0;
455         virtual void                                                    SetTopItem(FX_INT32 nIndex) = 0;        
456         virtual void                                                    Select(FX_INT32 nItemIndex) = 0;
457         virtual void                                                    SetCaret(FX_INT32 nItemIndex) = 0;
458         virtual void                                                    Empty() = 0;
459         virtual void                                                    Cancel() = 0;
460         virtual CFX_WideString                                  GetText() const = 0;
461
462
463         virtual void                                                    OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
464         virtual void                                                    OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
465         virtual void                                                    OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
466         virtual void                                                    OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
467         virtual void                                                    OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
468         virtual void                                                    OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
469         virtual void                                                    OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
470         virtual void                                                    OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
471         virtual void                                                    OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
472         virtual FX_BOOL                                                 OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
473
474 protected:
475         ~IFX_List() { }
476 };
477
478 #endif
479