| 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 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/fpdfdoc/include/cpdf_variabletext.h" |
| 10 #include "core/fxcrt/include/fx_basic.h" | 11 #include "core/fxcrt/include/fx_basic.h" |
| 11 #include "core/include/fpdfdoc/fpdf_vt.h" | |
| 12 #include "core/include/fxge/fx_dib.h" | 12 #include "core/include/fxge/fx_dib.h" |
| 13 | 13 |
| 14 class CPDF_Font; |
| 15 class CPDF_PageObjectHolder; |
| 16 class CPDF_TextObject; |
| 17 class CFX_FloatPoint; |
| 18 class CFX_Matrix; |
| 14 class CFX_RenderDevice; | 19 class CFX_RenderDevice; |
| 15 class CPDF_Font; | |
| 16 class CFX_Matrix; | |
| 17 class CPDF_PageObjectHolder; | |
| 18 class CFX_FloatPoint; | |
| 19 class CPDF_TextObject; | |
| 20 class IFX_Edit; | 20 class IFX_Edit; |
| 21 class IFX_Edit_FontMap; | 21 class IPVT_FontMap; |
| 22 class IFX_Edit_Iterator; | 22 class IFX_Edit_Iterator; |
| 23 class IFX_Edit_Notify; | 23 class IFX_Edit_Notify; |
| 24 class IFX_Edit_UndoItem; | 24 class IFX_Edit_UndoItem; |
| 25 class IFX_List; | 25 class IFX_List; |
| 26 class IFX_List_Notify; | 26 class IFX_List_Notify; |
| 27 class IFX_SystemHandler; | 27 class IFX_SystemHandler; |
| 28 | 28 |
| 29 struct CPVT_Line; | 29 struct CPVT_Line; |
| 30 struct CPVT_SecProps; | 30 struct CPVT_SecProps; |
| 31 struct CPVT_Section; | 31 struct CPVT_Section; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 44 #define PVTWORD_STYLE_ITALIC 0x0040L | 44 #define PVTWORD_STYLE_ITALIC 0x0040L |
| 45 | 45 |
| 46 #define FX_EDIT_ISLATINWORD(u) \ | 46 #define FX_EDIT_ISLATINWORD(u) \ |
| 47 (u == 0x2D || (u <= 0x005A && u >= 0x0041) || \ | 47 (u == 0x2D || (u <= 0x005A && u >= 0x0041) || \ |
| 48 (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0)) | 48 (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0)) |
| 49 | 49 |
| 50 #ifndef DEFAULT_CHARSET | 50 #ifndef DEFAULT_CHARSET |
| 51 #define DEFAULT_CHARSET 1 | 51 #define DEFAULT_CHARSET 1 |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 class IFX_Edit_FontMap { | |
| 55 public: | |
| 56 virtual ~IFX_Edit_FontMap() {} | |
| 57 // map a fontindex to pdf font. | |
| 58 virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; | |
| 59 // get the alias of a pdf font. | |
| 60 virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; | |
| 61 // get the index of a font that can show a word. | |
| 62 virtual int32_t GetWordFontIndex(uint16_t word, | |
| 63 int32_t charset, | |
| 64 int32_t nFontIndex) = 0; | |
| 65 // get the charcode of word from unicode | |
| 66 virtual int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) = 0; | |
| 67 // get the charset of unicode | |
| 68 virtual int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) = 0; | |
| 69 }; | |
| 70 | |
| 71 class IFX_Edit_Notify { | 54 class IFX_Edit_Notify { |
| 72 public: | 55 public: |
| 73 virtual ~IFX_Edit_Notify() {} | 56 virtual ~IFX_Edit_Notify() {} |
| 74 // set the horizontal scrollbar information. | 57 // set the horizontal scrollbar information. |
| 75 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, | 58 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, |
| 76 FX_FLOAT fPlateMax, | 59 FX_FLOAT fPlateMax, |
| 77 FX_FLOAT fContentMin, | 60 FX_FLOAT fContentMin, |
| 78 FX_FLOAT fContentMax, | 61 FX_FLOAT fContentMax, |
| 79 FX_FLOAT fSmallStep, | 62 FX_FLOAT fSmallStep, |
| 80 FX_FLOAT fBigStep) = 0; | 63 FX_FLOAT fBigStep) = 0; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 virtual void Undo() = 0; | 159 virtual void Undo() = 0; |
| 177 virtual void Redo() = 0; | 160 virtual void Redo() = 0; |
| 178 virtual CFX_WideString GetUndoTitle() = 0; | 161 virtual CFX_WideString GetUndoTitle() = 0; |
| 179 }; | 162 }; |
| 180 | 163 |
| 181 class IFX_Edit { | 164 class IFX_Edit { |
| 182 public: | 165 public: |
| 183 static IFX_Edit* NewEdit(); | 166 static IFX_Edit* NewEdit(); |
| 184 static void DelEdit(IFX_Edit* pEdit); | 167 static void DelEdit(IFX_Edit* pEdit); |
| 185 | 168 |
| 186 // set a IFX_Edit_FontMap pointer implemented by user. | 169 // set a IPVT_FontMap pointer implemented by user. |
| 187 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; | 170 virtual void SetFontMap(IPVT_FontMap* pFontMap) = 0; |
| 171 |
| 188 // if user don't like to use FontMap, implement VTProvider and set it | 172 // if user don't like to use FontMap, implement VTProvider and set it |
| 189 // directly. | 173 // directly. |
| 190 virtual void SetVTProvider(IPDF_VariableText::Provider* pProvider) = 0; | 174 virtual void SetVTProvider(CPDF_VariableText::Provider* pProvider) = 0; |
| 175 |
| 191 // set a IFX_Edit_Notify pointer implemented by user. | 176 // set a IFX_Edit_Notify pointer implemented by user. |
| 192 virtual void SetNotify(IFX_Edit_Notify* pNotify) = 0; | 177 virtual void SetNotify(IFX_Edit_Notify* pNotify) = 0; |
| 193 virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0; | 178 virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0; |
| 179 |
| 194 // get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the | 180 // get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the |
| 195 // contents of edit, but don't need to release. | 181 // contents of edit, but don't need to release. |
| 196 virtual IFX_Edit_Iterator* GetIterator() = 0; | 182 virtual IFX_Edit_Iterator* GetIterator() = 0; |
| 183 |
| 197 // get a VT pointer relative to this edit. | 184 // get a VT pointer relative to this edit. |
| 198 virtual IPDF_VariableText* GetVariableText() = 0; | 185 virtual CPDF_VariableText* GetVariableText() = 0; |
| 199 // get the IFX_Edit_FontMap pointer set by user. | 186 |
| 200 virtual IFX_Edit_FontMap* GetFontMap() = 0; | 187 // get the IPVT_FontMap pointer set by user. |
| 188 virtual IPVT_FontMap* GetFontMap() = 0; |
| 201 | 189 |
| 202 // initialize the edit. | 190 // initialize the edit. |
| 203 virtual void Initialize() = 0; | 191 virtual void Initialize() = 0; |
| 204 | 192 |
| 205 // set the bounding box of the text area. | 193 // set the bounding box of the text area. |
| 206 virtual void SetPlateRect(const CFX_FloatRect& rect, | 194 virtual void SetPlateRect(const CFX_FloatRect& rect, |
| 207 FX_BOOL bPaint = TRUE) = 0; | 195 FX_BOOL bPaint = TRUE) = 0; |
| 196 |
| 208 // set the scroll origin | 197 // set the scroll origin |
| 209 virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; | 198 virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; |
| 210 | 199 |
| 211 // set the horizontal text alignment in text box, nFormat (0:left 1:middle | 200 // set the horizontal text alignment in text box, nFormat (0:left 1:middle |
| 212 // 2:right). | 201 // 2:right). |
| 213 virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; | 202 virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; |
| 203 |
| 214 // set the vertical text alignment in text box, nFormat (0:top 1:center | 204 // set the vertical text alignment in text box, nFormat (0:top 1:center |
| 215 // 2:bottom). | 205 // 2:bottom). |
| 216 virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; | 206 virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; |
| 207 |
| 217 // if the text is shown in secret , set a character for substitute. | 208 // if the text is shown in secret , set a character for substitute. |
| 218 virtual void SetPasswordChar(uint16_t wSubWord = '*', | 209 virtual void SetPasswordChar(uint16_t wSubWord = '*', |
| 219 FX_BOOL bPaint = TRUE) = 0; | 210 FX_BOOL bPaint = TRUE) = 0; |
| 211 |
| 220 // set the maximal count of words of the text. | 212 // set the maximal count of words of the text. |
| 221 virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; | 213 virtual void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0; |
| 214 |
| 222 // if set the count of charArray , then all words is shown in equal space. | 215 // if set the count of charArray , then all words is shown in equal space. |
| 223 virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; | 216 virtual void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE) = 0; |
| 217 |
| 224 // set the space of two characters. | 218 // set the space of two characters. |
| 225 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, | 219 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, |
| 226 FX_BOOL bPaint = TRUE) = 0; | 220 FX_BOOL bPaint = TRUE) = 0; |
| 221 |
| 227 // set the horizontal scale of all characters. | 222 // set the horizontal scale of all characters. |
| 228 virtual void SetHorzScale(int32_t nHorzScale = 100, | 223 virtual void SetHorzScale(int32_t nHorzScale = 100, |
| 229 FX_BOOL bPaint = TRUE) = 0; | 224 FX_BOOL bPaint = TRUE) = 0; |
| 225 |
| 230 // set the leading of all lines | 226 // set the leading of all lines |
| 231 virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; | 227 virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; |
| 228 |
| 232 // if set, CRLF is allowed. | 229 // if set, CRLF is allowed. |
| 233 virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, | 230 virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, |
| 234 FX_BOOL bPaint = TRUE) = 0; | 231 FX_BOOL bPaint = TRUE) = 0; |
| 232 |
| 235 // if set, all words auto fit the width of the bounding box. | 233 // if set, all words auto fit the width of the bounding box. |
| 236 virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; | 234 virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; |
| 235 |
| 237 // if set, a font size is calculated to full fit the bounding box. | 236 // if set, a font size is calculated to full fit the bounding box. |
| 238 virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; | 237 virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; |
| 238 |
| 239 // is set, the text is allowed to scroll. | 239 // is set, the text is allowed to scroll. |
| 240 virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; | 240 virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; |
| 241 |
| 241 // set the font size of all words. | 242 // set the font size of all words. |
| 242 virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0; | 243 virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0; |
| 244 |
| 243 // the text is allowed to auto-scroll, allow the text overflow? | 245 // the text is allowed to auto-scroll, allow the text overflow? |
| 244 virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, | 246 virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, |
| 245 FX_BOOL bPaint = TRUE) = 0; | 247 FX_BOOL bPaint = TRUE) = 0; |
| 246 | 248 |
| 247 // query if the edit is richedit. | 249 // query if the edit is richedit. |
| 248 virtual FX_BOOL IsRichText() const = 0; | 250 virtual FX_BOOL IsRichText() const = 0; |
| 251 |
| 249 // set the edit is richedit. | 252 // set the edit is richedit. |
| 250 virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; | 253 virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; |
| 254 |
| 251 // set the fontsize of selected text. | 255 // set the fontsize of selected text. |
| 252 virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; | 256 virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; |
| 257 |
| 253 // set the fontindex of selected text, user can change the font of selected | 258 // set the fontindex of selected text, user can change the font of selected |
| 254 // text. | 259 // text. |
| 255 virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; | 260 virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; |
| 261 |
| 256 // set the textcolor of selected text. | 262 // set the textcolor of selected text. |
| 257 virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; | 263 virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; |
| 264 |
| 258 // set the text script type of selected text. (0:normal 1:superscript | 265 // set the text script type of selected text. (0:normal 1:superscript |
| 259 // 2:subscript) | 266 // 2:subscript) |
| 260 virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; | 267 virtual FX_BOOL SetRichTextScript( |
| 268 CPDF_VariableText::ScriptType nScriptType) = 0; |
| 269 |
| 261 // set the bold font style of selected text. | 270 // set the bold font style of selected text. |
| 262 virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; | 271 virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; |
| 272 |
| 263 // set the italic font style of selected text. | 273 // set the italic font style of selected text. |
| 264 virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0; | 274 virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0; |
| 275 |
| 265 // set the underline style of selected text. | 276 // set the underline style of selected text. |
| 266 virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0; | 277 virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0; |
| 278 |
| 267 // set the crossout style of selected text. | 279 // set the crossout style of selected text. |
| 268 virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0; | 280 virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0; |
| 281 |
| 269 // set the charspace of selected text, in user coordinate. | 282 // set the charspace of selected text, in user coordinate. |
| 270 virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; | 283 virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0; |
| 284 |
| 271 // set the horizontal scale of selected text, default value is 100. | 285 // set the horizontal scale of selected text, default value is 100. |
| 272 virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; | 286 virtual FX_BOOL SetRichTextHorzScale(int32_t nHorzScale = 100) = 0; |
| 287 |
| 273 // set the leading of selected section, in user coordinate. | 288 // set the leading of selected section, in user coordinate. |
| 274 virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; | 289 virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0; |
| 290 |
| 275 // set the indent of selected section, in user coordinate. | 291 // set the indent of selected section, in user coordinate. |
| 276 virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; | 292 virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0; |
| 293 |
| 277 // set the alignment of selected section, nAlignment(0:left 1:middle 2:right) | 294 // set the alignment of selected section, nAlignment(0:left 1:middle 2:right) |
| 278 virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0; | 295 virtual FX_BOOL SetRichTextAlignment(int32_t nAlignment) = 0; |
| 279 | 296 |
| 280 // set the selected range of text. | 297 // set the selected range of text. |
| 281 // if nStartChar == 0 and nEndChar == -1, select all the text. | 298 // if nStartChar == 0 and nEndChar == -1, select all the text. |
| 282 virtual void SetSel(int32_t nStartChar, int32_t nEndChar) = 0; | 299 virtual void SetSel(int32_t nStartChar, int32_t nEndChar) = 0; |
| 300 |
| 283 // get the selected range of text. | 301 // get the selected range of text. |
| 284 virtual void GetSel(int32_t& nStartChar, int32_t& nEndChar) const = 0; | 302 virtual void GetSel(int32_t& nStartChar, int32_t& nEndChar) const = 0; |
| 303 |
| 285 // select all the text. | 304 // select all the text. |
| 286 virtual void SelectAll() = 0; | 305 virtual void SelectAll() = 0; |
| 306 |
| 287 // set text is not selected. | 307 // set text is not selected. |
| 288 virtual void SelectNone() = 0; | 308 virtual void SelectNone() = 0; |
| 309 |
| 289 // get the caret position. | 310 // get the caret position. |
| 290 virtual int32_t GetCaret() const = 0; | 311 virtual int32_t GetCaret() const = 0; |
| 291 virtual CPVT_WordPlace GetCaretWordPlace() const = 0; | 312 virtual CPVT_WordPlace GetCaretWordPlace() const = 0; |
| 313 |
| 292 // get the string of selected text. | 314 // get the string of selected text. |
| 293 virtual CFX_WideString GetSelText() const = 0; | 315 virtual CFX_WideString GetSelText() const = 0; |
| 316 |
| 294 // get the text conent | 317 // get the text conent |
| 295 virtual CFX_WideString GetText() const = 0; | 318 virtual CFX_WideString GetText() const = 0; |
| 319 |
| 296 // query if any text is selected. | 320 // query if any text is selected. |
| 297 virtual FX_BOOL IsSelected() const = 0; | 321 virtual FX_BOOL IsSelected() const = 0; |
| 322 |
| 298 // get the scroll origin | 323 // get the scroll origin |
| 299 virtual CFX_FloatPoint GetScrollPos() const = 0; | 324 virtual CFX_FloatPoint GetScrollPos() const = 0; |
| 325 |
| 300 // get the bounding box of the text area. | 326 // get the bounding box of the text area. |
| 301 virtual CFX_FloatRect GetPlateRect() const = 0; | 327 virtual CFX_FloatRect GetPlateRect() const = 0; |
| 328 |
| 302 // get the fact area of the text. | 329 // get the fact area of the text. |
| 303 virtual CFX_FloatRect GetContentRect() const = 0; | 330 virtual CFX_FloatRect GetContentRect() const = 0; |
| 331 |
| 304 // get the visible word range | 332 // get the visible word range |
| 305 virtual CPVT_WordRange GetVisibleWordRange() const = 0; | 333 virtual CPVT_WordRange GetVisibleWordRange() const = 0; |
| 334 |
| 306 // get the whole word range | 335 // get the whole word range |
| 307 virtual CPVT_WordRange GetWholeWordRange() const = 0; | 336 virtual CPVT_WordRange GetWholeWordRange() const = 0; |
| 337 |
| 308 // get the word range of select text | 338 // get the word range of select text |
| 309 virtual CPVT_WordRange GetSelectWordRange() const = 0; | 339 virtual CPVT_WordRange GetSelectWordRange() const = 0; |
| 310 | 340 |
| 311 // send the mousedown message to edit for response. | 341 // send the mousedown message to edit for response. |
| 312 // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE. | 342 // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE. |
| 313 virtual void OnMouseDown(const CFX_FloatPoint& point, | 343 virtual void OnMouseDown(const CFX_FloatPoint& point, |
| 314 FX_BOOL bShift, | 344 FX_BOOL bShift, |
| 315 FX_BOOL bCtrl) = 0; | 345 FX_BOOL bCtrl) = 0; |
| 346 |
| 316 // send the mousemove message to edit when mouse down is TRUE. | 347 // send the mousemove message to edit when mouse down is TRUE. |
| 317 virtual void OnMouseMove(const CFX_FloatPoint& point, | 348 virtual void OnMouseMove(const CFX_FloatPoint& point, |
| 318 FX_BOOL bShift, | 349 FX_BOOL bShift, |
| 319 FX_BOOL bCtrl) = 0; | 350 FX_BOOL bCtrl) = 0; |
| 351 |
| 320 // send the UP key message to edit. | 352 // send the UP key message to edit. |
| 321 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 353 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 354 |
| 322 // send the DOWN key message to edit. | 355 // send the DOWN key message to edit. |
| 323 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 356 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 357 |
| 324 // send the LEFT key message to edit. | 358 // send the LEFT key message to edit. |
| 325 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 359 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 360 |
| 326 // send the RIGHT key message to edit. | 361 // send the RIGHT key message to edit. |
| 327 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 362 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 363 |
| 328 // send the HOME key message to edit. | 364 // send the HOME key message to edit. |
| 329 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 365 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 366 |
| 330 // send the END key message to edit. | 367 // send the END key message to edit. |
| 331 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 368 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 332 | 369 |
| 333 // put text into edit. | 370 // put text into edit. |
| 334 virtual void SetText(const FX_WCHAR* text, | 371 virtual void SetText(const FX_WCHAR* text, |
| 335 int32_t charset = DEFAULT_CHARSET, | 372 int32_t charset = DEFAULT_CHARSET, |
| 336 const CPVT_SecProps* pSecProps = NULL, | 373 const CPVT_SecProps* pSecProps = NULL, |
| 337 const CPVT_WordProps* pWordProps = NULL) = 0; | 374 const CPVT_WordProps* pWordProps = NULL) = 0; |
| 375 |
| 338 // insert a word into the edit. | 376 // insert a word into the edit. |
| 339 virtual FX_BOOL InsertWord(uint16_t word, | 377 virtual FX_BOOL InsertWord(uint16_t word, |
| 340 int32_t charset = DEFAULT_CHARSET, | 378 int32_t charset = DEFAULT_CHARSET, |
| 341 const CPVT_WordProps* pWordProps = NULL) = 0; | 379 const CPVT_WordProps* pWordProps = NULL) = 0; |
| 380 |
| 342 // insert a return into the edit. | 381 // insert a return into the edit. |
| 343 virtual FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL, | 382 virtual FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL, |
| 344 const CPVT_WordProps* pWordProps = NULL) = 0; | 383 const CPVT_WordProps* pWordProps = NULL) = 0; |
| 384 |
| 345 // insert text into the edit. | 385 // insert text into the edit. |
| 346 virtual FX_BOOL InsertText(const FX_WCHAR* text, | 386 virtual FX_BOOL InsertText(const FX_WCHAR* text, |
| 347 int32_t charset = DEFAULT_CHARSET, | 387 int32_t charset = DEFAULT_CHARSET, |
| 348 const CPVT_SecProps* pSecProps = NULL, | 388 const CPVT_SecProps* pSecProps = NULL, |
| 349 const CPVT_WordProps* pWordProps = NULL) = 0; | 389 const CPVT_WordProps* pWordProps = NULL) = 0; |
| 390 |
| 350 // do backspace operation. | 391 // do backspace operation. |
| 351 virtual FX_BOOL Backspace() = 0; | 392 virtual FX_BOOL Backspace() = 0; |
| 393 |
| 352 // do delete operation. | 394 // do delete operation. |
| 353 virtual FX_BOOL Delete() = 0; | 395 virtual FX_BOOL Delete() = 0; |
| 396 |
| 354 // delete the selected text. | 397 // delete the selected text. |
| 355 virtual FX_BOOL Clear() = 0; | 398 virtual FX_BOOL Clear() = 0; |
| 356 | 399 |
| 357 // do Redo operation. | 400 // do Redo operation. |
| 358 virtual FX_BOOL Redo() = 0; | 401 virtual FX_BOOL Redo() = 0; |
| 402 |
| 359 // do Undo operation. | 403 // do Undo operation. |
| 360 virtual FX_BOOL Undo() = 0; | 404 virtual FX_BOOL Undo() = 0; |
| 405 |
| 361 // move caret | 406 // move caret |
| 362 virtual void SetCaret(int32_t nPos) = 0; | 407 virtual void SetCaret(int32_t nPos) = 0; |
| 363 | 408 |
| 364 // arrange all words over again | 409 // arrange all words over again |
| 365 virtual void Paint() = 0; | 410 virtual void Paint() = 0; |
| 366 | 411 |
| 367 // allow to refresh screen? | 412 // allow to refresh screen? |
| 368 virtual void EnableRefresh(FX_BOOL bRefresh) = 0; | 413 virtual void EnableRefresh(FX_BOOL bRefresh) = 0; |
| 369 | 414 |
| 370 virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0; | 415 virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 396 | 441 |
| 397 // get the ending position of a section | 442 // get the ending position of a section |
| 398 virtual CPVT_WordPlace GetSectionEndPlace( | 443 virtual CPVT_WordPlace GetSectionEndPlace( |
| 399 const CPVT_WordPlace& place) const = 0; | 444 const CPVT_WordPlace& place) const = 0; |
| 400 | 445 |
| 401 // search a wordplace form point | 446 // search a wordplace form point |
| 402 virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; | 447 virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; |
| 403 | 448 |
| 404 // get the font size of non_rich text or default font size of richtext. | 449 // get the font size of non_rich text or default font size of richtext. |
| 405 virtual FX_FLOAT GetFontSize() const = 0; | 450 virtual FX_FLOAT GetFontSize() const = 0; |
| 451 |
| 406 // get the mask character. | 452 // get the mask character. |
| 407 virtual uint16_t GetPasswordChar() const = 0; | 453 virtual uint16_t GetPasswordChar() const = 0; |
| 454 |
| 408 // get the count of charArray | 455 // get the count of charArray |
| 409 virtual int32_t GetCharArray() const = 0; | 456 virtual int32_t GetCharArray() const = 0; |
| 457 |
| 410 // get the horizontal scale of all characters | 458 // get the horizontal scale of all characters |
| 411 virtual int32_t GetHorzScale() const = 0; | 459 virtual int32_t GetHorzScale() const = 0; |
| 460 |
| 412 // get the space of two characters | 461 // get the space of two characters |
| 413 virtual FX_FLOAT GetCharSpace() const = 0; | 462 virtual FX_FLOAT GetCharSpace() const = 0; |
| 463 |
| 414 // get the latin words of specified range | 464 // get the latin words of specified range |
| 415 virtual CFX_WideString GetRangeText(const CPVT_WordRange& range) const = 0; | 465 virtual CFX_WideString GetRangeText(const CPVT_WordRange& range) const = 0; |
| 466 |
| 416 // is the text full in bounding box | 467 // is the text full in bounding box |
| 417 virtual FX_BOOL IsTextFull() const = 0; | 468 virtual FX_BOOL IsTextFull() const = 0; |
| 418 virtual FX_BOOL CanUndo() const = 0; | 469 virtual FX_BOOL CanUndo() const = 0; |
| 419 virtual FX_BOOL CanRedo() const = 0; | 470 virtual FX_BOOL CanRedo() const = 0; |
| 471 |
| 420 // if the content is changed after settext? | 472 // if the content is changed after settext? |
| 421 virtual FX_BOOL IsModified() const = 0; | 473 virtual FX_BOOL IsModified() const = 0; |
| 474 |
| 422 // get the total words in edit | 475 // get the total words in edit |
| 423 virtual int32_t GetTotalWords() const = 0; | 476 virtual int32_t GetTotalWords() const = 0; |
| 424 | 477 |
| 425 virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; | 478 virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; |
| 426 | 479 |
| 427 static CFX_ByteString GetEditAppearanceStream( | 480 static CFX_ByteString GetEditAppearanceStream( |
| 428 IFX_Edit* pEdit, | 481 IFX_Edit* pEdit, |
| 429 const CFX_FloatPoint& ptOffset, | 482 const CFX_FloatPoint& ptOffset, |
| 430 const CPVT_WordRange* pRange = NULL, | 483 const CPVT_WordRange* pRange = NULL, |
| 431 FX_BOOL bContinuous = TRUE, | 484 FX_BOOL bContinuous = TRUE, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 558 |
| 506 protected: | 559 protected: |
| 507 virtual ~IFX_List_Notify() {} | 560 virtual ~IFX_List_Notify() {} |
| 508 }; | 561 }; |
| 509 | 562 |
| 510 class IFX_List { | 563 class IFX_List { |
| 511 public: | 564 public: |
| 512 static IFX_List* NewList(); | 565 static IFX_List* NewList(); |
| 513 static void DelList(IFX_List* pList); | 566 static void DelList(IFX_List* pList); |
| 514 | 567 |
| 515 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; | 568 virtual void SetFontMap(IPVT_FontMap* pFontMap) = 0; |
| 516 virtual void SetNotify(IFX_List_Notify* pNotify) = 0; | 569 virtual void SetNotify(IFX_List_Notify* pNotify) = 0; |
| 517 | 570 |
| 518 virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; | 571 virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; |
| 519 virtual void SetFontSize(FX_FLOAT fFontSize) = 0; | 572 virtual void SetFontSize(FX_FLOAT fFontSize) = 0; |
| 520 | 573 |
| 521 virtual CFX_FloatRect GetPlateRect() const = 0; | 574 virtual CFX_FloatRect GetPlateRect() const = 0; |
| 522 virtual CFX_FloatRect GetContentRect() const = 0; | 575 virtual CFX_FloatRect GetContentRect() const = 0; |
| 523 | 576 |
| 524 virtual FX_FLOAT GetFontSize() const = 0; | 577 virtual FX_FLOAT GetFontSize() const = 0; |
| 525 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; | 578 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 614 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 562 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 615 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 563 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 616 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 564 virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 617 virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 565 virtual FX_BOOL OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 618 virtual FX_BOOL OnChar(uint16_t nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 566 | 619 |
| 567 protected: | 620 protected: |
| 568 virtual ~IFX_List() {} | 621 virtual ~IFX_List() {} |
| 569 }; | 622 }; |
| 570 | 623 |
| 571 CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap, | 624 CFX_ByteString GetPDFWordString(IPVT_FontMap* pFontMap, |
| 572 int32_t nFontIndex, | 625 int32_t nFontIndex, |
| 573 uint16_t Word, | 626 uint16_t Word, |
| 574 uint16_t SubWord); | 627 uint16_t SubWord); |
| 575 | 628 |
| 576 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ | 629 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ |
| OLD | NEW |