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 void GetRectArray(int start, int nCount, CFX_RectArray* rectArray) 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 void GetRectsArrayByRect(const CFX_FloatRect& rect, |
80 CFX_RectArray& resRectArray) const; | 80 CFX_RectArray& resRectArray) 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 FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate); | |
89 FX_BOOL GetBaselineRotate(const CFX_FloatRect& rect, int& Rotate); | |
90 int CountBoundedSegments(FX_FLOAT left, | 88 int CountBoundedSegments(FX_FLOAT left, |
91 FX_FLOAT top, | 89 FX_FLOAT top, |
92 FX_FLOAT right, | 90 FX_FLOAT right, |
93 FX_FLOAT bottom, | 91 FX_FLOAT bottom, |
94 FX_BOOL bContains = FALSE); | 92 FX_BOOL bContains = FALSE); |
95 void GetBoundedSegment(int index, int& start, int& count) const; | 93 |
96 int GetWordBreak(int index, int direction) const; | 94 int GetWordBreak(int index, int direction) const; |
97 | 95 |
98 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, | 96 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, |
99 const CFX_FloatRect& rect2); | 97 const CFX_FloatRect& rect2); |
100 static FX_BOOL IsLetter(FX_WCHAR unicode); | 98 static FX_BOOL IsLetter(FX_WCHAR unicode); |
101 | 99 |
102 private: | 100 private: |
103 FX_BOOL IsHyphen(FX_WCHAR curChar); | 101 FX_BOOL IsHyphen(FX_WCHAR curChar); |
104 bool IsControlChar(const PAGECHAR_INFO& charInfo); | 102 bool IsControlChar(const PAGECHAR_INFO& charInfo); |
105 FX_BOOL GetBaselineRotate(int start, int end, int& Rotate); | 103 FX_BOOL GetBaselineRotate(int start, int end, int& Rotate); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 bool m_bIsParsed; | 146 bool m_bIsParsed; |
149 CFX_Matrix m_DisplayMatrix; | 147 CFX_Matrix m_DisplayMatrix; |
150 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; | 148 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; |
151 CFX_RectArray m_SelRects; | 149 CFX_RectArray m_SelRects; |
152 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; | 150 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; |
153 int32_t m_TextlineDir; | 151 int32_t m_TextlineDir; |
154 CFX_FloatRect m_CurlineRect; | 152 CFX_FloatRect m_CurlineRect; |
155 }; | 153 }; |
156 | 154 |
157 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ | 155 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ |
OLD | NEW |