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_FXEDIT_INCLUDE_FXET_EDIT_H_ | 7 #ifndef FPDFSDK_FXEDIT_INCLUDE_FXET_EDIT_H_ |
8 #define FPDFSDK_FXEDIT_INCLUDE_FXET_EDIT_H_ | 8 #define FPDFSDK_FXEDIT_INCLUDE_FXET_EDIT_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 void Add(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) { | 97 void Add(const CPVT_WordRange& wrLine, const CFX_FloatRect& rcLine) { |
98 m_LineRects.Add(new CFX_Edit_LineRect(wrLine, rcLine)); | 98 m_LineRects.Add(new CFX_Edit_LineRect(wrLine, rcLine)); |
99 } | 99 } |
100 | 100 |
101 int32_t GetSize() const { return m_LineRects.GetSize(); } | 101 int32_t GetSize() const { return m_LineRects.GetSize(); } |
102 | 102 |
103 CFX_Edit_LineRect* GetAt(int32_t nIndex) const { | 103 CFX_Edit_LineRect* GetAt(int32_t nIndex) const { |
104 if (nIndex < 0 || nIndex >= m_LineRects.GetSize()) | 104 if (nIndex < 0 || nIndex >= m_LineRects.GetSize()) |
105 return NULL; | 105 return nullptr; |
106 | 106 |
107 return m_LineRects.GetAt(nIndex); | 107 return m_LineRects.GetAt(nIndex); |
108 } | 108 } |
109 | 109 |
110 CFX_ArrayTemplate<CFX_Edit_LineRect*> m_LineRects; | 110 CFX_ArrayTemplate<CFX_Edit_LineRect*> m_LineRects; |
111 }; | 111 }; |
112 | 112 |
113 class CFX_Edit_RectArray { | 113 class CFX_Edit_RectArray { |
114 public: | 114 public: |
115 CFX_Edit_RectArray() {} | 115 CFX_Edit_RectArray() {} |
(...skipping 15 matching lines...) Expand all Loading... |
131 return; | 131 return; |
132 } | 132 } |
133 | 133 |
134 m_Rects.Add(new CFX_FloatRect(rect)); | 134 m_Rects.Add(new CFX_FloatRect(rect)); |
135 } | 135 } |
136 | 136 |
137 int32_t GetSize() const { return m_Rects.GetSize(); } | 137 int32_t GetSize() const { return m_Rects.GetSize(); } |
138 | 138 |
139 CFX_FloatRect* GetAt(int32_t nIndex) const { | 139 CFX_FloatRect* GetAt(int32_t nIndex) const { |
140 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) | 140 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) |
141 return NULL; | 141 return nullptr; |
142 | 142 |
143 return m_Rects.GetAt(nIndex); | 143 return m_Rects.GetAt(nIndex); |
144 } | 144 } |
145 | 145 |
146 CFX_ArrayTemplate<CFX_FloatRect*> m_Rects; | 146 CFX_ArrayTemplate<CFX_FloatRect*> m_Rects; |
147 }; | 147 }; |
148 | 148 |
149 class CFX_Edit_Refresh { | 149 class CFX_Edit_Refresh { |
150 public: | 150 public: |
151 CFX_Edit_Refresh(); | 151 CFX_Edit_Refresh(); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 FX_BOOL bShift, | 563 FX_BOOL bShift, |
564 FX_BOOL bCtrl) override; | 564 FX_BOOL bCtrl) override; |
565 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; | 565 void OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) override; |
566 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override; | 566 void OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) override; |
567 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override; | 567 void OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
568 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override; | 568 void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) override; |
569 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override; | 569 void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) override; |
570 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; | 570 void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) override; |
571 void SetText(const FX_WCHAR* text, | 571 void SetText(const FX_WCHAR* text, |
572 int32_t charset = DEFAULT_CHARSET, | 572 int32_t charset = DEFAULT_CHARSET, |
573 const CPVT_SecProps* pSecProps = NULL, | 573 const CPVT_SecProps* pSecProps = nullptr, |
574 const CPVT_WordProps* pWordProps = NULL) override; | 574 const CPVT_WordProps* pWordProps = nullptr) override; |
575 FX_BOOL InsertWord(uint16_t word, | 575 FX_BOOL InsertWord(uint16_t word, |
576 int32_t charset = DEFAULT_CHARSET, | 576 int32_t charset = DEFAULT_CHARSET, |
577 const CPVT_WordProps* pWordProps = NULL) override; | 577 const CPVT_WordProps* pWordProps = nullptr) override; |
578 FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = NULL, | 578 FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = nullptr, |
579 const CPVT_WordProps* pWordProps = NULL) override; | 579 const CPVT_WordProps* pWordProps = nullptr) override; |
580 FX_BOOL Backspace() override; | 580 FX_BOOL Backspace() override; |
581 FX_BOOL Delete() override; | 581 FX_BOOL Delete() override; |
582 FX_BOOL Clear() override; | 582 FX_BOOL Clear() override; |
583 FX_BOOL InsertText(const FX_WCHAR* text, | 583 FX_BOOL InsertText(const FX_WCHAR* text, |
584 int32_t charset = DEFAULT_CHARSET, | 584 int32_t charset = DEFAULT_CHARSET, |
585 const CPVT_SecProps* pSecProps = NULL, | 585 const CPVT_SecProps* pSecProps = nullptr, |
586 const CPVT_WordProps* pWordProps = NULL) override; | 586 const CPVT_WordProps* pWordProps = nullptr) override; |
587 FX_BOOL Redo() override; | 587 FX_BOOL Redo() override; |
588 FX_BOOL Undo() override; | 588 FX_BOOL Undo() override; |
589 int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const override; | 589 int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const override; |
590 CPVT_WordPlace WordIndexToWordPlace(int32_t index) const override; | 590 CPVT_WordPlace WordIndexToWordPlace(int32_t index) const override; |
591 CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const override; | 591 CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace& place) const override; |
592 CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const override; | 592 CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const override; |
593 CPVT_WordPlace GetSectionBeginPlace( | 593 CPVT_WordPlace GetSectionBeginPlace( |
594 const CPVT_WordPlace& place) const override; | 594 const CPVT_WordPlace& place) const override; |
595 CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const override; | 595 CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace& place) const override; |
596 CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const override; | 596 CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const override; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange& wr); | 694 void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange& wr); |
695 void PaintInsertText(const CPVT_WordPlace& wpOld, | 695 void PaintInsertText(const CPVT_WordPlace& wpOld, |
696 const CPVT_WordPlace& wpNew); | 696 const CPVT_WordPlace& wpNew); |
697 | 697 |
698 inline CFX_FloatPoint VTToEdit(const CFX_FloatPoint& point) const; | 698 inline CFX_FloatPoint VTToEdit(const CFX_FloatPoint& point) const; |
699 inline CFX_FloatPoint EditToVT(const CFX_FloatPoint& point) const; | 699 inline CFX_FloatPoint EditToVT(const CFX_FloatPoint& point) const; |
700 inline CFX_FloatRect VTToEdit(const CFX_FloatRect& rect) const; | 700 inline CFX_FloatRect VTToEdit(const CFX_FloatRect& rect) const; |
701 inline CFX_FloatRect EditToVT(const CFX_FloatRect& rect) const; | 701 inline CFX_FloatRect EditToVT(const CFX_FloatRect& rect) const; |
702 | 702 |
703 void Refresh(REFRESH_PLAN_E ePlan, | 703 void Refresh(REFRESH_PLAN_E ePlan, |
704 const CPVT_WordRange* pRange1 = NULL, | 704 const CPVT_WordRange* pRange1 = nullptr, |
705 const CPVT_WordRange* pRange2 = NULL); | 705 const CPVT_WordRange* pRange2 = nullptr); |
706 void RefreshPushLineRects(const CPVT_WordRange& wr); | 706 void RefreshPushLineRects(const CPVT_WordRange& wr); |
707 void RefreshPushRandomRects(const CPVT_WordRange& wr); | 707 void RefreshPushRandomRects(const CPVT_WordRange& wr); |
708 | 708 |
709 void SetCaret(const CPVT_WordPlace& place); | 709 void SetCaret(const CPVT_WordPlace& place); |
710 void SetCaretInfo(); | 710 void SetCaretInfo(); |
711 void SetCaretOrigin(); | 711 void SetCaretOrigin(); |
712 void SetCaretChange(); | 712 void SetCaretChange(); |
713 | 713 |
714 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; | 714 CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace& place) const; |
715 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, | 715 CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 int32_t charset, | 795 int32_t charset, |
796 int32_t nFontIndex) override; | 796 int32_t nFontIndex) override; |
797 int32_t GetDefaultFontIndex() override; | 797 int32_t GetDefaultFontIndex() override; |
798 FX_BOOL IsLatinWord(uint16_t word) override; | 798 FX_BOOL IsLatinWord(uint16_t word) override; |
799 | 799 |
800 private: | 800 private: |
801 IPVT_FontMap* m_pFontMap; | 801 IPVT_FontMap* m_pFontMap; |
802 }; | 802 }; |
803 | 803 |
804 #endif // FPDFSDK_FXEDIT_INCLUDE_FXET_EDIT_H_ | 804 #endif // FPDFSDK_FXEDIT_INCLUDE_FXET_EDIT_H_ |
OLD | NEW |