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