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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 CPDF_TextPage(const CPDF_Page* pPage, int flags); | 60 CPDF_TextPage(const CPDF_Page* pPage, int flags); |
61 ~CPDF_TextPage() {} | 61 ~CPDF_TextPage() {} |
62 | 62 |
63 // IPDF_TextPage: | 63 // IPDF_TextPage: |
64 void ParseTextPage(); | 64 void ParseTextPage(); |
65 bool IsParsed() const { return m_bIsParsed; } | 65 bool IsParsed() const { return m_bIsParsed; } |
66 int CharIndexFromTextIndex(int TextIndex) const; | 66 int CharIndexFromTextIndex(int TextIndex) const; |
67 int TextIndexFromCharIndex(int CharIndex) const; | 67 int TextIndexFromCharIndex(int CharIndex) const; |
68 int CountChars() const; | 68 int CountChars() const; |
69 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; | 69 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; |
70 void GetRectArray(int start, int nCount, CFX_RectArray* rectArray) const; | 70 std::vector<CFX_FloatRect> GetRectArray(int start, int nCount) const; |
71 int GetIndexAtPos(CFX_FloatPoint point, | 71 int GetIndexAtPos(CFX_FloatPoint point, |
72 FX_FLOAT xTolerance, | 72 FX_FLOAT xTolerance, |
73 FX_FLOAT yTolerance) const; | 73 FX_FLOAT yTolerance) const; |
74 int GetIndexAtPos(FX_FLOAT x, | 74 int GetIndexAtPos(FX_FLOAT x, |
75 FX_FLOAT y, | 75 FX_FLOAT y, |
76 FX_FLOAT xTolerance, | 76 FX_FLOAT xTolerance, |
77 FX_FLOAT yTolerance) const; | 77 FX_FLOAT yTolerance) const; |
78 CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; | 78 CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; |
79 void GetRectsArrayByRect(const CFX_FloatRect& rect, | 79 std::vector<CFX_FloatRect> GetRectsArrayByRect( |
80 CFX_RectArray& resRectArray) const; | 80 const CFX_FloatRect& rect) const; |
81 CFX_WideString GetPageText(int start = 0, int nCount = -1) const; | 81 CFX_WideString GetPageText(int start = 0, int nCount = -1) const; |
82 int CountRects(int start, int nCount); | 82 int CountRects(int start, int nCount); |
83 void GetRect(int rectIndex, | 83 void GetRect(int rectIndex, |
84 FX_FLOAT& left, | 84 FX_FLOAT& left, |
85 FX_FLOAT& top, | 85 FX_FLOAT& top, |
86 FX_FLOAT& right, | 86 FX_FLOAT& right, |
87 FX_FLOAT& bottom) const; | 87 FX_FLOAT& bottom) const; |
88 int CountBoundedSegments(FX_FLOAT left, | 88 int CountBoundedSegments(FX_FLOAT left, |
89 FX_FLOAT top, | 89 FX_FLOAT top, |
90 FX_FLOAT right, | 90 FX_FLOAT right, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 std::deque<PAGECHAR_INFO> m_CharList; | 139 std::deque<PAGECHAR_INFO> m_CharList; |
140 std::deque<PAGECHAR_INFO> m_TempCharList; | 140 std::deque<PAGECHAR_INFO> m_TempCharList; |
141 CFX_WideTextBuf m_TextBuf; | 141 CFX_WideTextBuf m_TextBuf; |
142 CFX_WideTextBuf m_TempTextBuf; | 142 CFX_WideTextBuf m_TempTextBuf; |
143 const int m_parserflag; | 143 const int m_parserflag; |
144 CPDF_TextObject* m_pPreTextObj; | 144 CPDF_TextObject* m_pPreTextObj; |
145 CFX_Matrix m_perMatrix; | 145 CFX_Matrix m_perMatrix; |
146 bool m_bIsParsed; | 146 bool m_bIsParsed; |
147 CFX_Matrix m_DisplayMatrix; | 147 CFX_Matrix m_DisplayMatrix; |
148 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; | 148 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; |
149 CFX_RectArray m_SelRects; | 149 std::vector<CFX_FloatRect> m_SelRects; |
150 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; | 150 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; |
151 int32_t m_TextlineDir; | 151 int32_t m_TextlineDir; |
152 CFX_FloatRect m_CurlineRect; | 152 CFX_FloatRect m_CurlineRect; |
153 }; | 153 }; |
154 | 154 |
155 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ | 155 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ |
OLD | NEW |