Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: core/fpdftext/include/cpdf_textpage.h

Issue 2271973004: Clean up CPDF_TextPage (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdftext/fpdf_text_int.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" 13 #include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h"
14 #include "core/fxcrt/include/fx_basic.h" 14 #include "core/fxcrt/include/fx_basic.h"
15 #include "core/fxcrt/include/fx_coordinates.h" 15 #include "core/fxcrt/include/fx_coordinates.h"
16 #include "core/fxcrt/include/fx_string.h" 16 #include "core/fxcrt/include/fx_string.h"
17 17
18 class CFX_BidiChar;
19 class CPDF_Font; 18 class CPDF_Font;
20 class CPDF_FormObject; 19 class CPDF_FormObject;
21 class CPDF_Page; 20 class CPDF_Page;
22 class CPDF_TextObject; 21 class CPDF_TextObject;
23 22
24 enum class FPDFText_MarkedContent { Pass = 0, Done, Delay }; 23 enum class FPDFText_MarkedContent { Pass = 0, Done, Delay };
25 24
26 enum class FPDFText_Direction { Left = -1, Right = 1 }; 25 enum class FPDFText_Direction { Left = -1, Right = 1 };
27 26
28 struct FPDF_CHAR_INFO { 27 struct FPDF_CHAR_INFO {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; 72 void GetCharInfo(int index, FPDF_CHAR_INFO* info) const;
74 std::vector<CFX_FloatRect> GetRectArray(int start, int nCount) const; 73 std::vector<CFX_FloatRect> GetRectArray(int start, int nCount) const;
75 int GetIndexAtPos(CFX_FloatPoint point, 74 int GetIndexAtPos(CFX_FloatPoint point,
76 FX_FLOAT xTolerance, 75 FX_FLOAT xTolerance,
77 FX_FLOAT yTolerance) const; 76 FX_FLOAT yTolerance) const;
78 int GetIndexAtPos(FX_FLOAT x, 77 int GetIndexAtPos(FX_FLOAT x,
79 FX_FLOAT y, 78 FX_FLOAT y,
80 FX_FLOAT xTolerance, 79 FX_FLOAT xTolerance,
81 FX_FLOAT yTolerance) const; 80 FX_FLOAT yTolerance) const;
82 CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; 81 CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const;
83 std::vector<CFX_FloatRect> GetRectsArrayByRect(
84 const CFX_FloatRect& rect) const;
85 CFX_WideString GetPageText(int start = 0, int nCount = -1) const; 82 CFX_WideString GetPageText(int start = 0, int nCount = -1) const;
86 int CountRects(int start, int nCount); 83 int CountRects(int start, int nCount);
87 void GetRect(int rectIndex, 84 void GetRect(int rectIndex,
88 FX_FLOAT& left, 85 FX_FLOAT& left,
89 FX_FLOAT& top, 86 FX_FLOAT& top,
90 FX_FLOAT& right, 87 FX_FLOAT& right,
91 FX_FLOAT& bottom) const; 88 FX_FLOAT& bottom) const;
92 int CountBoundedSegments(FX_FLOAT left,
93 FX_FLOAT top,
94 FX_FLOAT right,
95 FX_FLOAT bottom,
96 FX_BOOL bContains = FALSE);
97 89
98 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, 90 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1,
99 const CFX_FloatRect& rect2); 91 const CFX_FloatRect& rect2);
100 92
101 private: 93 private:
102 enum class TextOrientation { 94 enum class TextOrientation {
103 Unknown, 95 Unknown,
104 Horizontal, 96 Horizontal,
105 Vertical, 97 Vertical,
106 }; 98 };
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 bool m_bIsParsed; 152 bool m_bIsParsed;
161 CFX_Matrix m_DisplayMatrix; 153 CFX_Matrix m_DisplayMatrix;
162 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments; 154 CFX_ArrayTemplate<FPDF_SEGMENT> m_Segments;
163 std::vector<CFX_FloatRect> m_SelRects; 155 std::vector<CFX_FloatRect> m_SelRects;
164 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj; 156 CFX_ArrayTemplate<PDFTEXT_Obj> m_LineObj;
165 TextOrientation m_TextlineDir; 157 TextOrientation m_TextlineDir;
166 CFX_FloatRect m_CurlineRect; 158 CFX_FloatRect m_CurlineRect;
167 }; 159 };
168 160
169 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ 161 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_
OLDNEW
« no previous file with comments | « core/fpdftext/fpdf_text_int.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698