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 _REFLOWED_TEXT_PAGE_H | 7 #ifndef _REFLOWED_TEXT_PAGE_H |
8 #define _REFLOWED_TEXT_PAGE_H | 8 #define _REFLOWED_TEXT_PAGE_H |
9 #include "../../include/reflow/reflowengine.h" | 9 #include "../../include/reflow/reflowengine.h" |
10 #include "../../src/reflow/reflowedpage.h" | 10 #include "../../src/reflow/reflowedpage.h" |
11 typedef CFX_SegmentedArray<CRF_CharData*> CRF_CharDataPtrArray; | 11 typedef CFX_SegmentedArray<CRF_CharData*> CRF_CharDataPtrArray; |
12 typedef CFX_SegmentedArray<FX_INT32> CFX_CountBSINT32Array; | 12 typedef CFX_SegmentedArray<FX_INT32> CFX_CountBSINT32Array; |
13 class CRF_TextPage : public IPDF_TextPage | 13 class CRF_TextPage : public IPDF_TextPage { |
14 { | 14 public: |
15 public: | 15 CRF_TextPage(IPDF_ReflowedPage* pRefPage); |
16 CRF_TextPage(IPDF_ReflowedPage* pRefPage); | |
17 | 16 |
18 virtual ~CRF_TextPage() ; | 17 virtual ~CRF_TextPage(); |
19 FX_BOOL» » » ParseTextPage(); | 18 FX_BOOL ParseTextPage(); |
20 void» » » NormalizeObjects(FX_BOOL bNormalize) | 19 void NormalizeObjects(FX_BOOL bNormalize) { return; }; |
21 { | |
22 return; | |
23 }; | |
24 | 20 |
25 FX_BOOL» » » IsParsered() const; | 21 FX_BOOL IsParsered() const; |
26 public: | |
27 | 22 |
28 int CharIndexFromTextIndex(int TextIndex) const; | 23 public: |
| 24 int CharIndexFromTextIndex(int TextIndex) const; |
29 | 25 |
30 int TextIndexFromCharIndex(int CharIndex) const; | 26 int TextIndexFromCharIndex(int CharIndex) const; |
31 | 27 |
| 28 int CountChars() const; |
32 | 29 |
33 int»» » » CountChars() const; | 30 virtual void GetCharInfo(int index, FPDF_CHAR_INFO& info) const; |
34 | 31 |
35 virtual» void» GetCharInfo(int index, FPDF_CHAR_INFO & info) const; | 32 void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const; |
36 | 33 |
37 void» » » GetRectArray(int start, int nCount, CFX_RectArra
y& rectArray) const; | 34 int GetIndexAtPos(CPDF_Point point, |
| 35 FX_FLOAT xTorelance, |
| 36 FX_FLOAT yTorelance) const; |
38 | 37 |
| 38 int GetIndexAtPos(FX_FLOAT x, |
| 39 FX_FLOAT y, |
| 40 FX_FLOAT xTorelance, |
| 41 FX_FLOAT yTorelance) const; |
39 | 42 |
40 int»» » » GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorela
nce, FX_FLOAT yTorelance) const; | 43 virtual int GetOrderByDirection(int index, int direction) const; |
41 | 44 |
42 int»» » » GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT x
Torelance, FX_FLOAT yTorelance) const; | 45 CFX_WideString GetTextByRect(CFX_FloatRect rect) const; |
43 | 46 |
44 virtual» int» » » » GetOrderByDirection(int index, i
nt direction) const; | 47 void GetRectsArrayByRect(CFX_FloatRect rect, |
| 48 CFX_RectArray& resRectArray) const; |
45 | 49 |
46 CFX_WideString» GetTextByRect(CFX_FloatRect rect) const; | 50 int CountRects(int start, int nCount); |
47 | 51 |
48 void» » » GetRectsArrayByRect(CFX_FloatRect rect, CFX_Rect
Array& resRectArray) const; | 52 virtual void GetRect(int rectIndex, |
| 53 FX_FLOAT& left, |
| 54 FX_FLOAT& top, |
| 55 FX_FLOAT& right, |
| 56 FX_FLOAT& bottom) const; |
| 57 virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate); |
| 58 virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate); |
49 | 59 |
| 60 virtual int CountBoundedSegments(FX_FLOAT left, |
| 61 FX_FLOAT top, |
| 62 FX_FLOAT right, |
| 63 FX_FLOAT bottom, |
| 64 FX_BOOL bContains = FALSE); |
50 | 65 |
51 int»» » » CountRects(int start, int nCount); | 66 virtual void GetBoundedSegment(int index, int& start, int& count) const; |
52 | 67 |
53 virtual» void» » » GetRect(int rectIndex, FX_FLOAT& left, F
X_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const; | 68 int GetWordBreak(int index, int direction) const; |
54 virtual» FX_BOOL»» » GetBaselineRotate(int rectIndex, int& Ro
tate); | |
55 virtual FX_BOOL» » » GetBaselineRotate(CFX_FloatRect rect, in
t& Rotate); | |
56 | 69 |
57 virtual» int» » » » CountBoundedSegments(FX_FLOAT le
ft, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE); | 70 CFX_WideString GetPageText(int start, int nCount = -1) const; |
58 | 71 |
59 virtual» void» » » GetBoundedSegment(int index, int& start,
int& count) const; | 72 private: |
60 | 73 CPDF_ReflowedPage* m_pRefPage; |
61 | 74 CRF_CharDataPtrArray* m_pDataList; |
62 int»» » » GetWordBreak(int index, int direction) const; | 75 CFX_RectArray m_rectArray; |
63 | 76 CFX_CountBSINT32Array* m_CountBSArray; |
64 CFX_WideString» GetPageText(int start, int nCount = -1 ) const; | |
65 private: | |
66 CPDF_ReflowedPage*» » m_pRefPage; | |
67 CRF_CharDataPtrArray*» m_pDataList; | |
68 CFX_RectArray» » » m_rectArray; | |
69 CFX_CountBSINT32Array*» m_CountBSArray; | |
70 }; | 77 }; |
71 #endif | 78 #endif |
OLD | NEW |