| 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/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
| 11 #include "core/include/fxcrt/fx_basic.h" | 11 #include "core/include/fxcrt/fx_basic.h" |
| 12 #include "core/include/fxge/fx_dib.h" | 12 #include "core/include/fxge/fx_dib.h" |
| 13 | 13 |
| 14 class CFX_RenderDevice; | 14 class CFX_RenderDevice; |
| 15 class CPDF_Font; | 15 class CPDF_Font; |
| 16 class CFX_Matrix; | 16 class CFX_Matrix; |
| 17 class CPDF_PageObjectHolder; | 17 class CPDF_PageObjectHolder; |
| 18 class CFX_FloatPoint; | 18 class CPDF_Point; |
| 19 class CPDF_TextObject; | 19 class CPDF_TextObject; |
| 20 class IFX_Edit; | 20 class IFX_Edit; |
| 21 class IFX_Edit_FontMap; | 21 class IFX_Edit_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 class IPDF_VariableText; | 28 class IPDF_VariableText; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 FX_FLOAT fContentMin, | 85 FX_FLOAT fContentMin, |
| 86 FX_FLOAT fContentMax, | 86 FX_FLOAT fContentMax, |
| 87 FX_FLOAT fSmallStep, | 87 FX_FLOAT fSmallStep, |
| 88 FX_FLOAT fBigStep) = 0; | 88 FX_FLOAT fBigStep) = 0; |
| 89 // set the position of horizontal scrollbar. | 89 // set the position of horizontal scrollbar. |
| 90 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; | 90 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; |
| 91 // set the position of vertical scrollbar. | 91 // set the position of vertical scrollbar. |
| 92 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; | 92 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; |
| 93 // set the caret information. | 93 // set the caret information. |
| 94 virtual void IOnSetCaret(FX_BOOL bVisible, | 94 virtual void IOnSetCaret(FX_BOOL bVisible, |
| 95 const CFX_FloatPoint& ptHead, | 95 const CPDF_Point& ptHead, |
| 96 const CFX_FloatPoint& ptFoot, | 96 const CPDF_Point& ptFoot, |
| 97 const CPVT_WordPlace& place) = 0; | 97 const CPVT_WordPlace& place) = 0; |
| 98 // if the caret position is changed ,send the information of current postion | 98 // if the caret position is changed ,send the information of current postion |
| 99 // to user. | 99 // to user. |
| 100 virtual void IOnCaretChange(const CPVT_SecProps& secProps, | 100 virtual void IOnCaretChange(const CPVT_SecProps& secProps, |
| 101 const CPVT_WordProps& wordProps) = 0; | 101 const CPVT_WordProps& wordProps) = 0; |
| 102 // if the text area is changed, send the information to user. | 102 // if the text area is changed, send the information to user. |
| 103 virtual void IOnContentChange(const CFX_FloatRect& rcContent) = 0; | 103 virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0; |
| 104 // Invalidate the rectangle relative to the bounding box of edit. | 104 // Invalidate the rectangle relative to the bounding box of edit. |
| 105 virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; | 105 virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 class IFX_Edit_OprNotify { | 108 class IFX_Edit_OprNotify { |
| 109 public: | 109 public: |
| 110 virtual ~IFX_Edit_OprNotify() {} | 110 virtual ~IFX_Edit_OprNotify() {} |
| 111 | 111 |
| 112 // OprType: 0 | 112 // OprType: 0 |
| 113 virtual void OnInsertWord(const CPVT_WordPlace& place, | 113 virtual void OnInsertWord(const CPVT_WordPlace& place, |
| 114 const CPVT_WordPlace& oldplace) = 0; | 114 const CPVT_WordPlace& oldplace) = 0; |
| 115 // OprType: 1 | 115 // OprType: 1 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 virtual IFX_Edit_Iterator* GetIterator() = 0; | 197 virtual IFX_Edit_Iterator* GetIterator() = 0; |
| 198 // get a VT pointer relative to this edit. | 198 // get a VT pointer relative to this edit. |
| 199 virtual IPDF_VariableText* GetVariableText() = 0; | 199 virtual IPDF_VariableText* GetVariableText() = 0; |
| 200 // get the IFX_Edit_FontMap pointer set by user. | 200 // get the IFX_Edit_FontMap pointer set by user. |
| 201 virtual IFX_Edit_FontMap* GetFontMap() = 0; | 201 virtual IFX_Edit_FontMap* GetFontMap() = 0; |
| 202 | 202 |
| 203 // initialize the edit. | 203 // initialize the edit. |
| 204 virtual void Initialize() = 0; | 204 virtual void Initialize() = 0; |
| 205 | 205 |
| 206 // set the bounding box of the text area. | 206 // set the bounding box of the text area. |
| 207 virtual void SetPlateRect(const CFX_FloatRect& rect, | 207 virtual void SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint = TRUE) = 0; |
| 208 FX_BOOL bPaint = TRUE) = 0; | |
| 209 // set the scroll origin | 208 // set the scroll origin |
| 210 virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; | 209 virtual void SetScrollPos(const CPDF_Point& point) = 0; |
| 211 | 210 |
| 212 // set the horizontal text alignment in text box, nFormat (0:left 1:middle | 211 // set the horizontal text alignment in text box, nFormat (0:left 1:middle |
| 213 // 2:right). | 212 // 2:right). |
| 214 virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; | 213 virtual void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; |
| 215 // set the vertical text alignment in text box, nFormat (0:top 1:center | 214 // set the vertical text alignment in text box, nFormat (0:top 1:center |
| 216 // 2:bottom). | 215 // 2:bottom). |
| 217 virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; | 216 virtual void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE) = 0; |
| 218 // if the text is shown in secret , set a character for substitute. | 217 // if the text is shown in secret , set a character for substitute. |
| 219 virtual void SetPasswordChar(FX_WORD wSubWord = '*', | 218 virtual void SetPasswordChar(FX_WORD wSubWord = '*', |
| 220 FX_BOOL bPaint = TRUE) = 0; | 219 FX_BOOL bPaint = TRUE) = 0; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // get the caret position. | 289 // get the caret position. |
| 291 virtual int32_t GetCaret() const = 0; | 290 virtual int32_t GetCaret() const = 0; |
| 292 virtual CPVT_WordPlace GetCaretWordPlace() const = 0; | 291 virtual CPVT_WordPlace GetCaretWordPlace() const = 0; |
| 293 // get the string of selected text. | 292 // get the string of selected text. |
| 294 virtual CFX_WideString GetSelText() const = 0; | 293 virtual CFX_WideString GetSelText() const = 0; |
| 295 // get the text conent | 294 // get the text conent |
| 296 virtual CFX_WideString GetText() const = 0; | 295 virtual CFX_WideString GetText() const = 0; |
| 297 // query if any text is selected. | 296 // query if any text is selected. |
| 298 virtual FX_BOOL IsSelected() const = 0; | 297 virtual FX_BOOL IsSelected() const = 0; |
| 299 // get the scroll origin | 298 // get the scroll origin |
| 300 virtual CFX_FloatPoint GetScrollPos() const = 0; | 299 virtual CPDF_Point GetScrollPos() const = 0; |
| 301 // get the bounding box of the text area. | 300 // get the bounding box of the text area. |
| 302 virtual CFX_FloatRect GetPlateRect() const = 0; | 301 virtual CPDF_Rect GetPlateRect() const = 0; |
| 303 // get the fact area of the text. | 302 // get the fact area of the text. |
| 304 virtual CFX_FloatRect GetContentRect() const = 0; | 303 virtual CPDF_Rect GetContentRect() const = 0; |
| 305 // get the visible word range | 304 // get the visible word range |
| 306 virtual CPVT_WordRange GetVisibleWordRange() const = 0; | 305 virtual CPVT_WordRange GetVisibleWordRange() const = 0; |
| 307 // get the whole word range | 306 // get the whole word range |
| 308 virtual CPVT_WordRange GetWholeWordRange() const = 0; | 307 virtual CPVT_WordRange GetWholeWordRange() const = 0; |
| 309 // get the word range of select text | 308 // get the word range of select text |
| 310 virtual CPVT_WordRange GetSelectWordRange() const = 0; | 309 virtual CPVT_WordRange GetSelectWordRange() const = 0; |
| 311 | 310 |
| 312 // send the mousedown message to edit for response. | 311 // send the mousedown message to edit for response. |
| 313 // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE. | 312 // if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE. |
| 314 virtual void OnMouseDown(const CFX_FloatPoint& point, | 313 virtual void OnMouseDown(const CPDF_Point& point, |
| 315 FX_BOOL bShift, | 314 FX_BOOL bShift, |
| 316 FX_BOOL bCtrl) = 0; | 315 FX_BOOL bCtrl) = 0; |
| 317 // send the mousemove message to edit when mouse down is TRUE. | 316 // send the mousemove message to edit when mouse down is TRUE. |
| 318 virtual void OnMouseMove(const CFX_FloatPoint& point, | 317 virtual void OnMouseMove(const CPDF_Point& point, |
| 319 FX_BOOL bShift, | 318 FX_BOOL bShift, |
| 320 FX_BOOL bCtrl) = 0; | 319 FX_BOOL bCtrl) = 0; |
| 321 // send the UP key message to edit. | 320 // send the UP key message to edit. |
| 322 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 321 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 323 // send the DOWN key message to edit. | 322 // send the DOWN key message to edit. |
| 324 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 323 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 325 // send the LEFT key message to edit. | 324 // send the LEFT key message to edit. |
| 326 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 325 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 327 // send the RIGHT key message to edit. | 326 // send the RIGHT key message to edit. |
| 328 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 327 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 392 |
| 394 // get the beginning position of a section | 393 // get the beginning position of a section |
| 395 virtual CPVT_WordPlace GetSectionBeginPlace( | 394 virtual CPVT_WordPlace GetSectionBeginPlace( |
| 396 const CPVT_WordPlace& place) const = 0; | 395 const CPVT_WordPlace& place) const = 0; |
| 397 | 396 |
| 398 // get the ending position of a section | 397 // get the ending position of a section |
| 399 virtual CPVT_WordPlace GetSectionEndPlace( | 398 virtual CPVT_WordPlace GetSectionEndPlace( |
| 400 const CPVT_WordPlace& place) const = 0; | 399 const CPVT_WordPlace& place) const = 0; |
| 401 | 400 |
| 402 // search a wordplace form point | 401 // search a wordplace form point |
| 403 virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; | 402 virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0; |
| 404 | 403 |
| 405 // get the font size of non_rich text or default font size of richtext. | 404 // get the font size of non_rich text or default font size of richtext. |
| 406 virtual FX_FLOAT GetFontSize() const = 0; | 405 virtual FX_FLOAT GetFontSize() const = 0; |
| 407 // get the mask character. | 406 // get the mask character. |
| 408 virtual FX_WORD GetPasswordChar() const = 0; | 407 virtual FX_WORD GetPasswordChar() const = 0; |
| 409 // get the count of charArray | 408 // get the count of charArray |
| 410 virtual int32_t GetCharArray() const = 0; | 409 virtual int32_t GetCharArray() const = 0; |
| 411 // get the horizontal scale of all characters | 410 // get the horizontal scale of all characters |
| 412 virtual int32_t GetHorzScale() const = 0; | 411 virtual int32_t GetHorzScale() const = 0; |
| 413 // get the space of two characters | 412 // get the space of two characters |
| 414 virtual FX_FLOAT GetCharSpace() const = 0; | 413 virtual FX_FLOAT GetCharSpace() const = 0; |
| 415 // get the latin words of specified range | 414 // get the latin words of specified range |
| 416 virtual CFX_WideString GetRangeText(const CPVT_WordRange& range) const = 0; | 415 virtual CFX_WideString GetRangeText(const CPVT_WordRange& range) const = 0; |
| 417 // is the text full in bounding box | 416 // is the text full in bounding box |
| 418 virtual FX_BOOL IsTextFull() const = 0; | 417 virtual FX_BOOL IsTextFull() const = 0; |
| 419 virtual FX_BOOL CanUndo() const = 0; | 418 virtual FX_BOOL CanUndo() const = 0; |
| 420 virtual FX_BOOL CanRedo() const = 0; | 419 virtual FX_BOOL CanRedo() const = 0; |
| 421 // if the content is changed after settext? | 420 // if the content is changed after settext? |
| 422 virtual FX_BOOL IsModified() const = 0; | 421 virtual FX_BOOL IsModified() const = 0; |
| 423 // get the total words in edit | 422 // get the total words in edit |
| 424 virtual int32_t GetTotalWords() const = 0; | 423 virtual int32_t GetTotalWords() const = 0; |
| 425 | 424 |
| 426 virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; | 425 virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; |
| 427 | 426 |
| 428 static CFX_ByteString GetEditAppearanceStream( | 427 static CFX_ByteString GetEditAppearanceStream( |
| 429 IFX_Edit* pEdit, | 428 IFX_Edit* pEdit, |
| 430 const CFX_FloatPoint& ptOffset, | 429 const CPDF_Point& ptOffset, |
| 431 const CPVT_WordRange* pRange = NULL, | 430 const CPVT_WordRange* pRange = NULL, |
| 432 FX_BOOL bContinuous = TRUE, | 431 FX_BOOL bContinuous = TRUE, |
| 433 FX_WORD SubWord = 0); | 432 FX_WORD SubWord = 0); |
| 434 static CFX_ByteString GetSelectAppearanceStream( | 433 static CFX_ByteString GetSelectAppearanceStream( |
| 435 IFX_Edit* pEdit, | 434 IFX_Edit* pEdit, |
| 436 const CFX_FloatPoint& ptOffset, | 435 const CPDF_Point& ptOffset, |
| 437 const CPVT_WordRange* pRange = NULL); | 436 const CPVT_WordRange* pRange = NULL); |
| 438 static void DrawEdit(CFX_RenderDevice* pDevice, | 437 static void DrawEdit(CFX_RenderDevice* pDevice, |
| 439 CFX_Matrix* pUser2Device, | 438 CFX_Matrix* pUser2Device, |
| 440 IFX_Edit* pEdit, | 439 IFX_Edit* pEdit, |
| 441 FX_COLORREF crTextFill, | 440 FX_COLORREF crTextFill, |
| 442 FX_COLORREF crTextStroke, | 441 FX_COLORREF crTextStroke, |
| 443 const CFX_FloatRect& rcClip, | 442 const CPDF_Rect& rcClip, |
| 444 const CFX_FloatPoint& ptOffset, | 443 const CPDF_Point& ptOffset, |
| 445 const CPVT_WordRange* pRange, | 444 const CPVT_WordRange* pRange, |
| 446 IFX_SystemHandler* pSystemHandler, | 445 IFX_SystemHandler* pSystemHandler, |
| 447 void* pFFLData); | 446 void* pFFLData); |
| 448 static void DrawUnderline(CFX_RenderDevice* pDevice, | 447 static void DrawUnderline(CFX_RenderDevice* pDevice, |
| 449 CFX_Matrix* pUser2Device, | 448 CFX_Matrix* pUser2Device, |
| 450 IFX_Edit* pEdit, | 449 IFX_Edit* pEdit, |
| 451 FX_COLORREF color, | 450 FX_COLORREF color, |
| 452 const CFX_FloatRect& rcClip, | 451 const CPDF_Rect& rcClip, |
| 453 const CFX_FloatPoint& ptOffset, | 452 const CPDF_Point& ptOffset, |
| 454 const CPVT_WordRange* pRange); | 453 const CPVT_WordRange* pRange); |
| 455 static void DrawRichEdit(CFX_RenderDevice* pDevice, | 454 static void DrawRichEdit(CFX_RenderDevice* pDevice, |
| 456 CFX_Matrix* pUser2Device, | 455 CFX_Matrix* pUser2Device, |
| 457 IFX_Edit* pEdit, | 456 IFX_Edit* pEdit, |
| 458 const CFX_FloatRect& rcClip, | 457 const CPDF_Rect& rcClip, |
| 459 const CFX_FloatPoint& ptOffset, | 458 const CPDF_Point& ptOffset, |
| 460 const CPVT_WordRange* pRange); | 459 const CPVT_WordRange* pRange); |
| 461 static void GeneratePageObjects( | 460 static void GeneratePageObjects( |
| 462 CPDF_PageObjectHolder* pObjectHolder, | 461 CPDF_PageObjectHolder* pObjectHolder, |
| 463 IFX_Edit* pEdit, | 462 IFX_Edit* pEdit, |
| 464 const CFX_FloatPoint& ptOffset, | 463 const CPDF_Point& ptOffset, |
| 465 const CPVT_WordRange* pRange, | 464 const CPVT_WordRange* pRange, |
| 466 FX_COLORREF crText, | 465 FX_COLORREF crText, |
| 467 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); | 466 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); |
| 468 static void GenerateRichPageObjects( | 467 static void GenerateRichPageObjects( |
| 469 CPDF_PageObjectHolder* pObjectHolder, | 468 CPDF_PageObjectHolder* pObjectHolder, |
| 470 IFX_Edit* pEdit, | 469 IFX_Edit* pEdit, |
| 471 const CFX_FloatPoint& ptOffset, | 470 const CPDF_Point& ptOffset, |
| 472 const CPVT_WordRange* pRange, | 471 const CPVT_WordRange* pRange, |
| 473 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); | 472 CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); |
| 474 static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, | 473 static void GenerateUnderlineObjects(CPDF_PageObjectHolder* pObjectHolder, |
| 475 IFX_Edit* pEdit, | 474 IFX_Edit* pEdit, |
| 476 const CFX_FloatPoint& ptOffset, | 475 const CPDF_Point& ptOffset, |
| 477 const CPVT_WordRange* pRange, | 476 const CPVT_WordRange* pRange, |
| 478 FX_COLORREF color); | 477 FX_COLORREF color); |
| 479 | 478 |
| 480 protected: | 479 protected: |
| 481 virtual ~IFX_Edit() {} | 480 virtual ~IFX_Edit() {} |
| 482 }; | 481 }; |
| 483 | 482 |
| 484 class IFX_List_Notify { | 483 class IFX_List_Notify { |
| 485 public: | 484 public: |
| 486 // set the horizontal scrollbar information. | 485 // set the horizontal scrollbar information. |
| 487 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, | 486 virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, |
| 488 FX_FLOAT fPlateMax, | 487 FX_FLOAT fPlateMax, |
| 489 FX_FLOAT fContentMin, | 488 FX_FLOAT fContentMin, |
| 490 FX_FLOAT fContentMax, | 489 FX_FLOAT fContentMax, |
| 491 FX_FLOAT fSmallStep, | 490 FX_FLOAT fSmallStep, |
| 492 FX_FLOAT fBigStep) = 0; | 491 FX_FLOAT fBigStep) = 0; |
| 493 // set the vertical scrollbar information. | 492 // set the vertical scrollbar information. |
| 494 virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, | 493 virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, |
| 495 FX_FLOAT fPlateMax, | 494 FX_FLOAT fPlateMax, |
| 496 FX_FLOAT fContentMin, | 495 FX_FLOAT fContentMin, |
| 497 FX_FLOAT fContentMax, | 496 FX_FLOAT fContentMax, |
| 498 FX_FLOAT fSmallStep, | 497 FX_FLOAT fSmallStep, |
| 499 FX_FLOAT fBigStep) = 0; | 498 FX_FLOAT fBigStep) = 0; |
| 500 // set the position of horizontal scrollbar. | 499 // set the position of horizontal scrollbar. |
| 501 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; | 500 virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; |
| 502 // set the position of vertical scrollbar. | 501 // set the position of vertical scrollbar. |
| 503 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; | 502 virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0; |
| 504 // Invalidate the rectangle relative to the bounding box of edit. | 503 // Invalidate the rectangle relative to the bounding box of edit. |
| 505 virtual void IOnInvalidateRect(CFX_FloatRect* pRect) = 0; | 504 virtual void IOnInvalidateRect(CPDF_Rect* pRect) = 0; |
| 506 | 505 |
| 507 protected: | 506 protected: |
| 508 virtual ~IFX_List_Notify() {} | 507 virtual ~IFX_List_Notify() {} |
| 509 }; | 508 }; |
| 510 | 509 |
| 511 class IFX_List { | 510 class IFX_List { |
| 512 public: | 511 public: |
| 513 static IFX_List* NewList(); | 512 static IFX_List* NewList(); |
| 514 static void DelList(IFX_List* pList); | 513 static void DelList(IFX_List* pList); |
| 515 | 514 |
| 516 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; | 515 virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0; |
| 517 virtual void SetNotify(IFX_List_Notify* pNotify) = 0; | 516 virtual void SetNotify(IFX_List_Notify* pNotify) = 0; |
| 518 | 517 |
| 519 virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; | 518 virtual void SetPlateRect(const CPDF_Rect& rect) = 0; |
| 520 virtual void SetFontSize(FX_FLOAT fFontSize) = 0; | 519 virtual void SetFontSize(FX_FLOAT fFontSize) = 0; |
| 521 | 520 |
| 522 virtual CFX_FloatRect GetPlateRect() const = 0; | 521 virtual CPDF_Rect GetPlateRect() const = 0; |
| 523 virtual CFX_FloatRect GetContentRect() const = 0; | 522 virtual CPDF_Rect GetContentRect() const = 0; |
| 524 | 523 |
| 525 virtual FX_FLOAT GetFontSize() const = 0; | 524 virtual FX_FLOAT GetFontSize() const = 0; |
| 526 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; | 525 virtual IFX_Edit* GetItemEdit(int32_t nIndex) const = 0; |
| 527 virtual int32_t GetCount() const = 0; | 526 virtual int32_t GetCount() const = 0; |
| 528 virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0; | 527 virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0; |
| 529 virtual FX_FLOAT GetFirstHeight() const = 0; | 528 virtual FX_FLOAT GetFirstHeight() const = 0; |
| 530 | 529 |
| 531 virtual void SetMultipleSel(FX_BOOL bMultiple) = 0; | 530 virtual void SetMultipleSel(FX_BOOL bMultiple) = 0; |
| 532 virtual FX_BOOL IsMultipleSel() const = 0; | 531 virtual FX_BOOL IsMultipleSel() const = 0; |
| 533 virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; | 532 virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; |
| 534 virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const = 0; | 533 virtual int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const = 0; |
| 535 | 534 |
| 536 virtual void SetScrollPos(const CFX_FloatPoint& point) = 0; | 535 virtual void SetScrollPos(const CPDF_Point& point) = 0; |
| 537 virtual void ScrollToListItem(int32_t nItemIndex) = 0; | 536 virtual void ScrollToListItem(int32_t nItemIndex) = 0; |
| 538 virtual CFX_FloatRect GetItemRect(int32_t nIndex) const = 0; | 537 virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; |
| 539 virtual int32_t GetCaret() const = 0; | 538 virtual int32_t GetCaret() const = 0; |
| 540 virtual int32_t GetSelect() const = 0; | 539 virtual int32_t GetSelect() const = 0; |
| 541 virtual int32_t GetTopItem() const = 0; | 540 virtual int32_t GetTopItem() const = 0; |
| 542 virtual int32_t GetItemIndex(const CFX_FloatPoint& point) const = 0; | 541 virtual int32_t GetItemIndex(const CPDF_Point& point) const = 0; |
| 543 virtual int32_t GetFirstSelected() const = 0; | 542 virtual int32_t GetFirstSelected() const = 0; |
| 544 | 543 |
| 545 virtual void AddString(const FX_WCHAR* string) = 0; | 544 virtual void AddString(const FX_WCHAR* string) = 0; |
| 546 virtual void SetTopItem(int32_t nIndex) = 0; | 545 virtual void SetTopItem(int32_t nIndex) = 0; |
| 547 virtual void Select(int32_t nItemIndex) = 0; | 546 virtual void Select(int32_t nItemIndex) = 0; |
| 548 virtual void SetCaret(int32_t nItemIndex) = 0; | 547 virtual void SetCaret(int32_t nItemIndex) = 0; |
| 549 virtual void Empty() = 0; | 548 virtual void Empty() = 0; |
| 550 virtual void Cancel() = 0; | 549 virtual void Cancel() = 0; |
| 551 virtual CFX_WideString GetText() const = 0; | 550 virtual CFX_WideString GetText() const = 0; |
| 552 | 551 |
| 553 virtual void OnMouseDown(const CFX_FloatPoint& point, | 552 virtual void OnMouseDown(const CPDF_Point& point, |
| 554 FX_BOOL bShift, | 553 FX_BOOL bShift, |
| 555 FX_BOOL bCtrl) = 0; | 554 FX_BOOL bCtrl) = 0; |
| 556 virtual void OnMouseMove(const CFX_FloatPoint& point, | 555 virtual void OnMouseMove(const CPDF_Point& point, |
| 557 FX_BOOL bShift, | 556 FX_BOOL bShift, |
| 558 FX_BOOL bCtrl) = 0; | 557 FX_BOOL bCtrl) = 0; |
| 559 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 558 virtual void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 560 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 559 virtual void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 561 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 560 virtual void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 562 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 561 virtual void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 563 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 562 virtual void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 564 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 563 virtual void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 565 virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 564 virtual void OnVK(int32_t nItemIndex, FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 566 virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0; | 565 virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) = 0; |
| 567 | 566 |
| 568 protected: | 567 protected: |
| 569 virtual ~IFX_List() {} | 568 virtual ~IFX_List() {} |
| 570 }; | 569 }; |
| 571 | 570 |
| 572 CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap, | 571 CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap, |
| 573 int32_t nFontIndex, | 572 int32_t nFontIndex, |
| 574 FX_WORD Word, | 573 FX_WORD Word, |
| 575 FX_WORD SubWord); | 574 FX_WORD SubWord); |
| 576 | 575 |
| 577 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ | 576 #endif // FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ |
| OLD | NEW |