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 CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ | 7 #ifndef CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ |
8 #define CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ | 8 #define CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ |
9 | 9 |
10 #include "core/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, | 35 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, |
36 CPDF_Document* pDoc, | 36 CPDF_Document* pDoc, |
37 CPDF_Dictionary* pPage, | 37 CPDF_Dictionary* pPage, |
38 FX_DWORD flags); | 38 FX_DWORD flags); |
39 CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, | 39 CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, |
40 CPDF_Dictionary* pPage); | 40 CPDF_Dictionary* pPage); |
41 #define CHAR_ERROR -1 | 41 #define CHAR_ERROR -1 |
42 #define CHAR_NORMAL 0 | 42 #define CHAR_NORMAL 0 |
43 #define CHAR_GENERATED 1 | 43 #define CHAR_GENERATED 1 |
44 #define CHAR_UNUNICODE 2 | 44 #define CHAR_UNUNICODE 2 |
45 typedef struct { | 45 |
| 46 struct FPDF_CHAR_INFO { |
46 FX_WCHAR m_Unicode; | 47 FX_WCHAR m_Unicode; |
47 FX_WCHAR m_Charcode; | 48 FX_WCHAR m_Charcode; |
48 int32_t m_Flag; | 49 int32_t m_Flag; |
49 FX_FLOAT m_FontSize; | 50 FX_FLOAT m_FontSize; |
50 FX_FLOAT m_OriginX; | 51 FX_FLOAT m_OriginX; |
51 FX_FLOAT m_OriginY; | 52 FX_FLOAT m_OriginY; |
52 CFX_FloatRect m_CharBox; | 53 CFX_FloatRect m_CharBox; |
53 CPDF_TextObject* m_pTextObj; | 54 CPDF_TextObject* m_pTextObj; |
54 CFX_Matrix m_Matrix; | 55 CFX_Matrix m_Matrix; |
55 } FPDF_CHAR_INFO; | 56 }; |
| 57 |
56 typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray; | 58 typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray; |
57 #define FPDFTEXT_LRTB 0 | 59 #define FPDFTEXT_LRTB 0 |
58 #define FPDFTEXT_RLTB 1 | 60 #define FPDFTEXT_RLTB 1 |
59 #define FPDFTEXT_TBRL 2 | 61 #define FPDFTEXT_TBRL 2 |
60 #define FPDFTEXT_LEFT -1 | 62 #define FPDFTEXT_LEFT -1 |
61 #define FPDFTEXT_RIGHT 1 | 63 #define FPDFTEXT_RIGHT 1 |
62 #define FPDFTEXT_UP -2 | 64 #define FPDFTEXT_UP -2 |
63 #define FPDFTEXT_DOWN 2 | 65 #define FPDFTEXT_DOWN 2 |
64 #define FPDFTEXT_WRITINGMODE_UNKNOW 0 | 66 #define FPDFTEXT_WRITINGMODE_UNKNOW 0 |
65 #define FPDFTEXT_WRITINGMODE_LRTB 1 | 67 #define FPDFTEXT_WRITINGMODE_LRTB 1 |
(...skipping 19 matching lines...) Expand all Loading... |
85 virtual FX_BOOL ParseTextPage() = 0; | 87 virtual FX_BOOL ParseTextPage() = 0; |
86 | 88 |
87 virtual bool IsParsed() const = 0; | 89 virtual bool IsParsed() const = 0; |
88 | 90 |
89 virtual int CharIndexFromTextIndex(int TextIndex) const = 0; | 91 virtual int CharIndexFromTextIndex(int TextIndex) const = 0; |
90 | 92 |
91 virtual int TextIndexFromCharIndex(int CharIndex) const = 0; | 93 virtual int TextIndexFromCharIndex(int CharIndex) const = 0; |
92 | 94 |
93 virtual int CountChars() const = 0; | 95 virtual int CountChars() const = 0; |
94 | 96 |
95 virtual void GetCharInfo(int index, FPDF_CHAR_INFO& info) const = 0; | 97 virtual void GetCharInfo(int index, FPDF_CHAR_INFO* info) const = 0; |
96 | 98 |
97 virtual void GetRectArray(int start, | 99 virtual void GetRectArray(int start, |
98 int nCount, | 100 int nCount, |
99 CFX_RectArray& rectArray) const = 0; | 101 CFX_RectArray& rectArray) const = 0; |
100 | 102 |
101 virtual int GetIndexAtPos(CPDF_Point point, | 103 virtual int GetIndexAtPos(CPDF_Point point, |
102 FX_FLOAT xTolerance, | 104 FX_FLOAT xTolerance, |
103 FX_FLOAT yTolerance) const = 0; | 105 FX_FLOAT yTolerance) const = 0; |
104 | 106 |
105 virtual int GetIndexAtPos(FX_FLOAT x, | 107 virtual int GetIndexAtPos(FX_FLOAT x, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 virtual int CountLinks() const = 0; | 175 virtual int CountLinks() const = 0; |
174 | 176 |
175 virtual CFX_WideString GetURL(int index) const = 0; | 177 virtual CFX_WideString GetURL(int index) const = 0; |
176 | 178 |
177 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0; | 179 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0; |
178 | 180 |
179 virtual void GetRects(int index, CFX_RectArray& rects) const = 0; | 181 virtual void GetRects(int index, CFX_RectArray& rects) const = 0; |
180 }; | 182 }; |
181 | 183 |
182 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ | 184 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ |
OLD | NEW |