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