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

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

Issue 1258093002: FX Bool considered harmful, part 3 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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/include/fpdfdoc/fpdf_vt.h ('k') | core/include/fxcodec/fx_codec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../fpdfapi/fpdf_parser.h" 10 #include "../fpdfapi/fpdf_parser.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #define FPDFTEXT_DOWN 2 54 #define FPDFTEXT_DOWN 2
55 #define FPDFTEXT_WRITINGMODE_UNKNOW 0 55 #define FPDFTEXT_WRITINGMODE_UNKNOW 0
56 #define FPDFTEXT_WRITINGMODE_LRTB 1 56 #define FPDFTEXT_WRITINGMODE_LRTB 1
57 #define FPDFTEXT_WRITINGMODE_RLTB 2 57 #define FPDFTEXT_WRITINGMODE_RLTB 2
58 #define FPDFTEXT_WRITINGMODE_TBRL 3 58 #define FPDFTEXT_WRITINGMODE_TBRL 3
59 class CPDFText_ParseOptions 59 class CPDFText_ParseOptions
60 { 60 {
61 public: 61 public:
62 62
63 CPDFText_ParseOptions(); 63 CPDFText_ParseOptions();
64 FX_BOOL» » » m_bGetCharCodeOnly; 64 bool» » » m_bGetCharCodeOnly;
65 FX_BOOL» » » m_bNormalizeObjs; 65 bool» » » m_bNormalizeObjs;
66 FX_BOOL» » » m_bOutputHyphen; 66 bool» » » m_bOutputHyphen;
67 }; 67 };
68 class IPDF_TextPage 68 class IPDF_TextPage
69 { 69 {
70 public: 70 public:
71 71
72 virtual ~IPDF_TextPage() {} 72 virtual ~IPDF_TextPage() {}
73 static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, CPDFText_ ParseOptions ParserOptions); 73 static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, CPDFText_ ParseOptions ParserOptions);
74 static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, int flags = 0); 74 static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, int flags = 0);
75 static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, in t flags = 0); 75 static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, in t flags = 0);
76 static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage ); 76 static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage );
77 77
78 virtual void» » » NormalizeObjects(FX_BOOL bNormalize) = 0 ; 78 virtual void» » » NormalizeObjects(bool bNormalize) = 0;
79 79
80 virtual FX_BOOL» » » ParseTextPage() = 0; 80 virtual bool» » » ParseTextPage() = 0;
81 81
82 82
83 virtual FX_BOOL» » » IsParsered() const = 0; 83 virtual bool» » » IsParsered() const = 0;
84 public: 84 public:
85 85
86 virtual int CharIndexFromTextIndex(int TextIndex) const = 0; 86 virtual int CharIndexFromTextIndex(int TextIndex) const = 0;
87 87
88 virtual int TextIndexFromCharIndex(int CharIndex) const = 0; 88 virtual int TextIndexFromCharIndex(int CharIndex) const = 0;
89 89
90 90
91 virtual int CountChars() const = 0; 91 virtual int CountChars() const = 0;
92 92
93 virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const = 0; 93 virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const = 0;
94 94
95 virtual void GetRectArray(int start, int nCount, CFX_ RectArray& rectArray) const = 0; 95 virtual void GetRectArray(int start, int nCount, CFX_ RectArray& rectArray) const = 0;
96 96
97 97
98 98
99 virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0; 99 virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
100 100
101 virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX _FLOAT xTorelance, FX_FLOAT yTorelance) const = 0; 101 virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX _FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
102 102
103 virtual CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const = 0; 103 virtual CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const = 0;
104 104
105 virtual void GetRectsArrayByRect(const CFX_FloatRect& rect, CFX_RectArray& resRectArray) const = 0; 105 virtual void GetRectsArrayByRect(const CFX_FloatRect& rect, CFX_RectArray& resRectArray) const = 0;
106 106
107 107
108 virtual int CountRects(int start, int nCount) = 0; 108 virtual int CountRects(int start, int nCount) = 0;
109 109
110 virtual void GetRect(int rectIndex, FX_FLOAT& left, F X_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0; 110 virtual void GetRect(int rectIndex, FX_FLOAT& left, F X_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0;
111 111
112 virtual FX_BOOL» » » GetBaselineRotate(int rectIndex, int& Ro tate) = 0; 112 virtual bool» » » GetBaselineRotate(int rectIndex, int& Ro tate) = 0;
113 113
114 virtual FX_BOOL» » » GetBaselineRotate(const CFX_FloatRect& r ect, int& Rotate) = 0; 114 virtual bool» » » GetBaselineRotate(const CFX_FloatRect& r ect, int& Rotate) = 0;
115 115
116 virtual» int» » » » CountBoundedSegments(FX_FLOAT le ft, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE) = 0; 116 virtual» int» » » » CountBoundedSegments(FX_FLOAT le ft, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, bool bContains = false) = 0;
117 117
118 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0; 118 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
119 119
120 120
121 virtual int GetWordBreak(int index, int direction) c onst = 0; 121 virtual int GetWordBreak(int index, int direction) c onst = 0;
122 122
123 virtual CFX_WideString GetPageText(int start = 0, int nCount = -1 ) con st = 0; 123 virtual CFX_WideString GetPageText(int start = 0, int nCount = -1 ) con st = 0;
124 }; 124 };
125 #define FPDFTEXT_MATCHCASE 0x00000001 125 #define FPDFTEXT_MATCHCASE 0x00000001
126 #define FPDFTEXT_MATCHWHOLEWORD 0x00000002 126 #define FPDFTEXT_MATCHWHOLEWORD 0x00000002
127 #define FPDFTEXT_CONSECUTIVE 0x00000004 127 #define FPDFTEXT_CONSECUTIVE 0x00000004
128 class IPDF_TextPageFind 128 class IPDF_TextPageFind
129 { 129 {
130 public: 130 public:
131 131
132 virtual ~IPDF_TextPageFind() {} 132 virtual ~IPDF_TextPageFind() {}
133 133
134 static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTex tPage); 134 static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTex tPage);
135 public: 135 public:
136 136
137 virtual» FX_BOOL»» » » FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0; 137 virtual» bool» » » » FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0) = 0;
138 138
139 virtual» FX_BOOL»» » » FindNext() = 0; 139 virtual» bool» » » » FindNext() = 0;
140 140
141 virtual» FX_BOOL»» » » FindPrev() = 0; 141 virtual» bool» » » » FindPrev() = 0;
142 142
143 virtual void GetRectArray(CFX_RectArray& rect s) const = 0; 143 virtual void GetRectArray(CFX_RectArray& rect s) const = 0;
144 144
145 virtual int GetCurOrder() const = 0; 145 virtual int GetCurOrder() const = 0;
146 146
147 virtual int GetMatchedCount() const = 0; 147 virtual int GetMatchedCount() const = 0;
148 }; 148 };
149 class IPDF_LinkExtract 149 class IPDF_LinkExtract
150 { 150 {
151 public: 151 public:
152 152
153 virtual ~IPDF_LinkExtract() {} 153 virtual ~IPDF_LinkExtract() {}
154 154
155 static IPDF_LinkExtract* CreateLinkExtract(); 155 static IPDF_LinkExtract* CreateLinkExtract();
156 156
157 virtual FX_BOOL» » » » ExtractLinks(const IPDF_TextPage * pTextPage) = 0; 157 virtual bool» » » » ExtractLinks(const IPDF_TextPage * pTextPage) = 0;
158 public: 158 public:
159 159
160 virtual int CountLinks() const = 0; 160 virtual int CountLinks() const = 0;
161 161
162 virtual CFX_WideString GetURL(int index) const = 0; 162 virtual CFX_WideString GetURL(int index) const = 0;
163 163
164 virtual void GetBoundedSegment(int index, int & start, int& count) const = 0; 164 virtual void GetBoundedSegment(int index, int & start, int& count) const = 0;
165 165
166 virtual void GetRects(int index, CFX_RectArra y& rects) const = 0; 166 virtual void GetRects(int index, CFX_RectArra y& rects) const = 0;
167 }; 167 };
168 168
169 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ 169 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_
OLDNEW
« no previous file with comments | « core/include/fpdfdoc/fpdf_vt.h ('k') | core/include/fxcodec/fx_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698