| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ | 7 #ifndef CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ |
| 8 #define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ | 8 #define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 int m_Index; | 54 int m_Index; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 struct PDFTEXT_Obj { | 57 struct PDFTEXT_Obj { |
| 58 CPDF_TextObject* m_pTextObj; | 58 CPDF_TextObject* m_pTextObj; |
| 59 CFX_Matrix m_formMatrix; | 59 CFX_Matrix m_formMatrix; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 class CPDF_TextPage { | 62 class CPDF_TextPage { |
| 63 public: | 63 public: |
| 64 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, | |
| 65 const CFX_FloatRect& rect2); | |
| 66 | |
| 67 CPDF_TextPage(const CPDF_Page* pPage, FPDFText_Direction flags); | 64 CPDF_TextPage(const CPDF_Page* pPage, FPDFText_Direction flags); |
| 68 ~CPDF_TextPage() {} | 65 ~CPDF_TextPage(); |
| 69 | 66 |
| 70 // IPDF_TextPage: | 67 // IPDF_TextPage: |
| 71 void ParseTextPage(); | 68 void ParseTextPage(); |
| 72 bool IsParsed() const { return m_bIsParsed; } | 69 bool IsParsed() const { return m_bIsParsed; } |
| 73 int CharIndexFromTextIndex(int TextIndex) const; | 70 int CharIndexFromTextIndex(int TextIndex) const; |
| 74 int TextIndexFromCharIndex(int CharIndex) const; | 71 int TextIndexFromCharIndex(int CharIndex) const; |
| 75 int CountChars() const; | 72 int CountChars() const; |
| 76 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; | 73 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; |
| 77 std::vector<CFX_FloatRect> GetRectArray(int start, int nCount) const; | 74 std::vector<CFX_FloatRect> GetRectArray(int start, int nCount) const; |
| 78 int GetIndexAtPos(CFX_FloatPoint point, | 75 int GetIndexAtPos(CFX_FloatPoint point, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 91 FX_FLOAT& left, | 88 FX_FLOAT& left, |
| 92 FX_FLOAT& top, | 89 FX_FLOAT& top, |
| 93 FX_FLOAT& right, | 90 FX_FLOAT& right, |
| 94 FX_FLOAT& bottom) const; | 91 FX_FLOAT& bottom) const; |
| 95 int CountBoundedSegments(FX_FLOAT left, | 92 int CountBoundedSegments(FX_FLOAT left, |
| 96 FX_FLOAT top, | 93 FX_FLOAT top, |
| 97 FX_FLOAT right, | 94 FX_FLOAT right, |
| 98 FX_FLOAT bottom, | 95 FX_FLOAT bottom, |
| 99 FX_BOOL bContains = FALSE); | 96 FX_BOOL bContains = FALSE); |
| 100 | 97 |
| 98 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, |
| 99 const CFX_FloatRect& rect2); |
| 100 |
| 101 private: | 101 private: |
| 102 enum class TextOrientation { | 102 enum class TextOrientation { |
| 103 Unknown, | 103 Unknown, |
| 104 Horizontal, | 104 Horizontal, |
| 105 Vertical, | 105 Vertical, |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 enum class GenerateCharacter { | 108 enum class GenerateCharacter { |
| 109 None, | 109 None, |
| 110 Space, | 110 Space, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool m_bIsParsed; | 160 bool m_bIsParsed; |
| 161 CFX_Matrix m_DisplayMatrix; | 161 CFX_Matrix m_DisplayMatrix; |
| 162 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; | 162 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; |
| 163 std::vector<CFX_FloatRect> m_SelRects; | 163 std::vector<CFX_FloatRect> m_SelRects; |
| 164 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; | 164 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; |
| 165 TextOrientation m_TextlineDir; | 165 TextOrientation m_TextlineDir; |
| 166 CFX_FloatRect m_CurlineRect; | 166 CFX_FloatRect m_CurlineRect; |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ | 169 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ |
| OLD | NEW |