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

Side by Side Diff: core/include/fpdfdoc/fpdf_vt.h

Issue 1265503005: clang-format all pdfium code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: sigh 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
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_FPDFDOC_FPDF_VT_H_ 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_VT_H_
8 #define CORE_INCLUDE_FPDFDOC_FPDF_VT_H_ 8 #define CORE_INCLUDE_FPDFDOC_FPDF_VT_H_
9 9
10 #include "../fpdfapi/fpdf_parser.h" 10 #include "../fpdfapi/fpdf_parser.h"
11 #include "../fxge/fx_dib.h" 11 #include "../fxge/fx_dib.h"
12 12
13 class IPDF_VariableText; 13 class IPDF_VariableText;
14 class IPDF_VariableText_Iterator; 14 class IPDF_VariableText_Iterator;
15 class IPDF_VariableText_Provider; 15 class IPDF_VariableText_Provider;
16 struct CPVT_Line; 16 struct CPVT_Line;
17 struct CPVT_Section; 17 struct CPVT_Section;
18 struct CPVT_Word; 18 struct CPVT_Word;
19 struct CPVT_WordPlace; 19 struct CPVT_WordPlace;
20 struct CPVT_WordRange; 20 struct CPVT_WordRange;
21 21
22 struct CPVT_WordPlace { 22 struct CPVT_WordPlace {
23 23 CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1) {}
24 CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1) 24
25 { 25 CPVT_WordPlace(int32_t other_nSecIndex,
26 } 26 int32_t other_nLineIndex,
27 27 int32_t other_nWordIndex) {
28 CPVT_WordPlace(int32_t other_nSecIndex, 28 nSecIndex = other_nSecIndex;
29 int32_t other_nLineIndex, 29 nLineIndex = other_nLineIndex;
30 int32_t other_nWordIndex) 30 nWordIndex = other_nWordIndex;
31 { 31 }
32 nSecIndex = other_nSecIndex; 32
33 nLineIndex = other_nLineIndex; 33 void Default() { nSecIndex = nLineIndex = nWordIndex = -1; }
34 nWordIndex = other_nWordIndex; 34
35 } 35 FX_BOOL operator==(const CPVT_WordPlace& wp) const {
36 36 return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex &&
37 void Default() 37 wp.nWordIndex == nWordIndex;
38 { 38 }
39 nSecIndex = nLineIndex = nWordIndex = -1; 39
40 } 40 FX_BOOL operator!=(const CPVT_WordPlace& wp) const {
41 41 return wp.nSecIndex != nSecIndex || wp.nLineIndex != nLineIndex ||
42 FX_BOOL operator == (const CPVT_WordPlace & wp) const 42 wp.nWordIndex != nWordIndex;
43 { 43 }
44 return wp.nSecIndex == nSecIndex && wp.nLineIndex == nLineIndex && wp.nW ordIndex == nWordIndex; 44
45 } 45 inline int32_t WordCmp(const CPVT_WordPlace& wp) const {
46 46 if (nSecIndex > wp.nSecIndex) {
47 FX_BOOL operator != (const CPVT_WordPlace & wp) const 47 return 1;
48 { 48 }
49 return wp.nSecIndex != nSecIndex || wp.nLineIndex != nLineIndex || wp.nW ordIndex != nWordIndex; 49 if (nSecIndex < wp.nSecIndex) {
50 } 50 return -1;
51 51 }
52 inline int32_t WordCmp(const CPVT_WordPlace & wp) const 52 if (nLineIndex > wp.nLineIndex) {
53 { 53 return 1;
54 if (nSecIndex > wp.nSecIndex) { 54 }
55 return 1; 55 if (nLineIndex < wp.nLineIndex) {
56 } 56 return -1;
57 if (nSecIndex < wp.nSecIndex) { 57 }
58 return -1; 58 if (nWordIndex > wp.nWordIndex) {
59 } 59 return 1;
60 if (nLineIndex > wp.nLineIndex) { 60 }
61 return 1; 61 if (nWordIndex < wp.nWordIndex) {
62 } 62 return -1;
63 if (nLineIndex < wp.nLineIndex) { 63 }
64 return -1; 64 return 0;
65 } 65 }
66 if (nWordIndex > wp.nWordIndex) { 66
67 return 1; 67 inline int32_t LineCmp(const CPVT_WordPlace& wp) const {
68 } 68 if (nSecIndex > wp.nSecIndex) {
69 if (nWordIndex < wp.nWordIndex) { 69 return 1;
70 return -1; 70 }
71 } 71 if (nSecIndex < wp.nSecIndex) {
72 return 0; 72 return -1;
73 } 73 }
74 74 if (nLineIndex > wp.nLineIndex) {
75 inline int32_t LineCmp(const CPVT_WordPlace & wp) const 75 return 1;
76 { 76 }
77 if (nSecIndex > wp.nSecIndex) { 77 if (nLineIndex < wp.nLineIndex) {
78 return 1; 78 return -1;
79 } 79 }
80 if (nSecIndex < wp.nSecIndex) { 80 return 0;
81 return -1; 81 }
82 } 82
83 if (nLineIndex > wp.nLineIndex) { 83 inline int32_t SecCmp(const CPVT_WordPlace& wp) const {
84 return 1; 84 if (nSecIndex > wp.nSecIndex) {
85 } 85 return 1;
86 if (nLineIndex < wp.nLineIndex) { 86 }
87 return -1; 87 if (nSecIndex < wp.nSecIndex) {
88 } 88 return -1;
89 return 0; 89 }
90 } 90 return 0;
91 91 }
92 inline int32_t SecCmp(const CPVT_WordPlace & wp) const 92
93 { 93 int32_t nSecIndex;
94 if (nSecIndex > wp.nSecIndex) { 94
95 return 1; 95 int32_t nLineIndex;
96 } 96
97 if (nSecIndex < wp.nSecIndex) { 97 int32_t nWordIndex;
98 return -1;
99 }
100 return 0;
101 }
102
103 int32_t» » » » » » » nSecIndex;
104
105 int32_t» » » » » » » nLineIndex;
106
107 int32_t» » » » » » » nWordIndex;
108 }; 98 };
109 struct CPVT_WordRange { 99 struct CPVT_WordRange {
110 100 CPVT_WordRange() {}
111 CPVT_WordRange() 101
112 { 102 CPVT_WordRange(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) {
113 } 103 Set(begin, end);
114 104 }
115 CPVT_WordRange(const CPVT_WordPlace & begin, const CPVT_WordPlace & end) 105
116 { 106 void Default() {
117 Set(begin, end); 107 BeginPos.Default();
118 } 108 EndPos.Default();
119 109 }
120 void Default() 110
121 { 111 void Set(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) {
122 BeginPos.Default(); 112 BeginPos = begin;
123 EndPos.Default(); 113 EndPos = end;
124 } 114 SwapWordPlace();
125 115 }
126 void Set(const CPVT_WordPlace & begin, const CPVT_WordPlace & end) 116
127 { 117 void SetBeginPos(const CPVT_WordPlace& begin) {
128 BeginPos = begin; 118 BeginPos = begin;
129 EndPos = end; 119 SwapWordPlace();
130 SwapWordPlace(); 120 }
131 } 121
132 122 void SetEndPos(const CPVT_WordPlace& end) {
133 void SetBeginPos(const CPVT_WordPlace & begin) 123 EndPos = end;
134 { 124 SwapWordPlace();
135 BeginPos = begin; 125 }
136 SwapWordPlace(); 126
137 } 127 FX_BOOL IsExist() const { return BeginPos != EndPos; }
138 128
139 void SetEndPos(const CPVT_WordPlace & end) 129 FX_BOOL operator!=(const CPVT_WordRange& wr) const {
140 { 130 return wr.BeginPos != BeginPos || wr.EndPos != EndPos;
141 EndPos = end; 131 }
142 SwapWordPlace(); 132
143 } 133 void SwapWordPlace() {
144 134 if (BeginPos.WordCmp(EndPos) > 0) {
145 FX_BOOL IsExist() const 135 CPVT_WordPlace place = EndPos;
146 { 136 EndPos = BeginPos;
147 return BeginPos != EndPos; 137 BeginPos = place;
148 } 138 }
149 139 }
150 FX_BOOL operator != (const CPVT_WordRange & wr) const 140
151 { 141 CPVT_WordPlace BeginPos;
152 return wr.BeginPos != BeginPos || wr.EndPos != EndPos; 142
153 } 143 CPVT_WordPlace EndPos;
154 144 };
155 void SwapWordPlace() 145 struct CPVT_SecProps {
156 { 146 CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0) {}
157 if (BeginPos.WordCmp(EndPos) > 0) { 147
158 CPVT_WordPlace place = EndPos; 148 CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment)
159 EndPos = BeginPos; 149 : fLineLeading(lineLeading),
160 BeginPos = place; 150 fLineIndent(lineIndent),
161 } 151 nAlignment(alignment) {}
162 } 152
163 153 CPVT_SecProps(const CPVT_SecProps& other)
164 CPVT_WordPlace BeginPos; 154 : fLineLeading(other.fLineLeading),
165 155 fLineIndent(other.fLineIndent),
166 CPVT_WordPlace EndPos; 156 nAlignment(other.nAlignment) {}
167 }; 157
168 struct CPVT_SecProps { 158 FX_FLOAT fLineLeading;
169 159
170 CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0) 160 FX_FLOAT fLineIndent;
171 { 161
172 } 162 int32_t nAlignment;
173 163 };
174 CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) : 164 struct CPVT_WordProps {
175 fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment ) 165 CPVT_WordProps()
176 { 166 : nFontIndex(-1),
177 } 167 fFontSize(0.0f),
178 168 dwWordColor(0),
179 CPVT_SecProps(const CPVT_SecProps & other) : 169 nScriptType(0),
180 fLineLeading(other.fLineLeading), fLineIndent(other.fLineIndent), nAlign ment(other.nAlignment) 170 nWordStyle(0),
181 { 171 fCharSpace(0.0f),
182 } 172 nHorzScale(0) {}
183 173
184 FX_FLOAT» » » fLineLeading; 174 CPVT_WordProps(int32_t fontIndex,
185 175 FX_FLOAT fontSize,
186 FX_FLOAT» » » fLineIndent; 176 FX_COLORREF wordColor = 0,
187 177 int32_t scriptType = 0,
188 int32_t» » » nAlignment; 178 int32_t wordStyle = 0,
189 }; 179 FX_FLOAT charSpace = 0,
190 struct CPVT_WordProps { 180 int32_t horzScale = 100)
191 181 : nFontIndex(fontIndex),
192 CPVT_WordProps() : nFontIndex(-1), fFontSize(0.0f), dwWordColor(0), nScriptT ype(0), nWordStyle(0), 182 fFontSize(fontSize),
193 fCharSpace(0.0f), nHorzScale(0) 183 dwWordColor(wordColor),
194 { 184 nScriptType(scriptType),
195 } 185 nWordStyle(wordStyle),
196 186 fCharSpace(charSpace),
197 CPVT_WordProps(int32_t» fontIndex, FX_FLOAT fontSize, FX_COLORREF wordCo lor = 0, int32_t scriptType = 0, int32_t wordStyle = 0, 187 nHorzScale(horzScale) {}
198 FX_FLOAT charSpace = 0, int32_t horzScale = 100) : 188
199 nFontIndex(fontIndex), fFontSize(fontSize), dwWordColor(wordColor), nScr iptType(scriptType), 189 CPVT_WordProps(const CPVT_WordProps& other)
200 nWordStyle(wordStyle), fCharSpace(charSpace), nHorzScale(horzScale) 190 : nFontIndex(other.nFontIndex),
201 { 191 fFontSize(other.fFontSize),
202 } 192 dwWordColor(other.dwWordColor),
203 193 nScriptType(other.nScriptType),
204 CPVT_WordProps(const CPVT_WordProps & other) : 194 nWordStyle(other.nWordStyle),
205 nFontIndex(other.nFontIndex), fFontSize(other.fFontSize), dwWordColor(ot her.dwWordColor), 195 fCharSpace(other.fCharSpace),
206 nScriptType(other.nScriptType), nWordStyle(other.nWordStyle), fCharSpace (other.fCharSpace), 196 nHorzScale(other.nHorzScale) {}
207 nHorzScale(other.nHorzScale) 197
208 { 198 int32_t nFontIndex;
209 } 199
210 200 FX_FLOAT fFontSize;
211 int32_t» » » » » nFontIndex; 201
212 202 FX_COLORREF dwWordColor;
213 FX_FLOAT» » » » » fFontSize; 203
214 204 int32_t nScriptType;
215 FX_COLORREF»» » » » dwWordColor; 205
216 206 int32_t nWordStyle;
217 int32_t» » » » » nScriptType; 207
218 208 FX_FLOAT fCharSpace;
219 int32_t» » » » » nWordStyle; 209
220 210 int32_t nHorzScale;
221 FX_FLOAT» » » » » fCharSpace;
222
223 int32_t» » » » » nHorzScale;
224 }; 211 };
225 struct CPVT_Word { 212 struct CPVT_Word {
226 213 CPVT_Word()
227 CPVT_Word() : Word(0), nCharset(0), ptWord(0, 0), fAscent(0.0f), fDescent(0. 0f), fWidth(0.0f), 214 : Word(0),
228 fFontSize(0), WordProps() 215 nCharset(0),
229 { 216 ptWord(0, 0),
230 } 217 fAscent(0.0f),
231 218 fDescent(0.0f),
232 FX_WORD» » » » » » Word; 219 fWidth(0.0f),
233 220 fFontSize(0),
234 int32_t» » » » » nCharset; 221 WordProps() {}
235 222
236 CPVT_WordPlace» » » » WordPlace; 223 FX_WORD Word;
237 224
238 CPDF_Point» » » » » ptWord; 225 int32_t nCharset;
239 226
240 FX_FLOAT» » » » » fAscent; 227 CPVT_WordPlace WordPlace;
241 228
242 FX_FLOAT» » » » » fDescent; 229 CPDF_Point ptWord;
243 230
244 FX_FLOAT» » » » » fWidth; 231 FX_FLOAT fAscent;
245 232
246 int32_t» » » » » nFontIndex; 233 FX_FLOAT fDescent;
247 234
248 FX_FLOAT» » » » » fFontSize; 235 FX_FLOAT fWidth;
249 236
250 CPVT_WordProps» » » » WordProps; 237 int32_t nFontIndex;
238
239 FX_FLOAT fFontSize;
240
241 CPVT_WordProps WordProps;
251 }; 242 };
252 struct CPVT_Line { 243 struct CPVT_Line {
253 244 CPVT_Line()
254 CPVT_Line() : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescen t(0.0f) 245 : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {}
255 { 246
256 } 247 CPVT_WordPlace lineplace;
257 248
258 CPVT_WordPlace» » » » lineplace; 249 CPVT_WordPlace lineEnd;
259 250
260 CPVT_WordPlace» » » » lineEnd; 251 CPDF_Point ptLine;
261 252
262 CPDF_Point» » » » » ptLine; 253 FX_FLOAT fLineWidth;
263 254
264 FX_FLOAT» » » » » fLineWidth; 255 FX_FLOAT fLineAscent;
265 256
266 FX_FLOAT» » » » » fLineAscent; 257 FX_FLOAT fLineDescent;
267
268 FX_FLOAT» » » » » fLineDescent;
269 }; 258 };
270 struct CPVT_Section { 259 struct CPVT_Section {
271 260 CPVT_WordPlace secplace;
272 CPVT_WordPlace secplace; 261
273 262 CPDF_Rect rcSection;
274 CPDF_Rect rcSection; 263
275 264 CPVT_SecProps SecProps;
276 CPVT_SecProps SecProps; 265
277 266 CPVT_WordProps WordProps;
278 CPVT_WordProps WordProps; 267 };
279 }; 268 class IPDF_VariableText_Provider {
280 class IPDF_VariableText_Provider 269 public:
281 { 270 virtual ~IPDF_VariableText_Provider() {}
282 public: 271
283 virtual ~IPDF_VariableText_Provider() { } 272 virtual int32_t GetCharWidth(int32_t nFontIndex,
284 273 FX_WORD word,
285 virtual int32_t GetCharWidth(int 32_t nFontIndex, FX_WORD word, int32_t nWordStyle) = 0; 274 int32_t nWordStyle) = 0;
286 275
287 virtual int32_t GetTypeAscent(in t32_t nFontIndex) = 0; 276 virtual int32_t GetTypeAscent(int32_t nFontIndex) = 0;
288 277
289 virtual int32_t GetTypeDescent(i nt32_t nFontIndex) = 0; 278 virtual int32_t GetTypeDescent(int32_t nFontIndex) = 0;
290 279
291 virtual int32_t GetWordFontIndex (FX_WORD word, int32_t charset, int32_t nFontIndex) = 0; 280 virtual int32_t GetWordFontIndex(FX_WORD word,
292 281 int32_t charset,
293 virtual FX_BOOL IsLatinW ord(FX_WORD word) = 0; 282 int32_t nFontIndex) = 0;
294 283
295 virtual int32_t GetDefaultFontIn dex() = 0; 284 virtual FX_BOOL IsLatinWord(FX_WORD word) = 0;
296 }; 285
297 class IPDF_VariableText_Iterator 286 virtual int32_t GetDefaultFontIndex() = 0;
298 { 287 };
299 public: 288 class IPDF_VariableText_Iterator {
300 virtual ~IPDF_VariableText_Iterator() { } 289 public:
301 290 virtual ~IPDF_VariableText_Iterator() {}
302 virtual FX_BOOL NextWord () = 0; 291
303 292 virtual FX_BOOL NextWord() = 0;
304 virtual FX_BOOL PrevWord () = 0; 293
305 294 virtual FX_BOOL PrevWord() = 0;
306 virtual FX_BOOL NextLine () = 0; 295
307 296 virtual FX_BOOL NextLine() = 0;
308 virtual FX_BOOL PrevLine () = 0; 297
309 298 virtual FX_BOOL PrevLine() = 0;
310 virtual FX_BOOL NextSect ion() = 0; 299
311 300 virtual FX_BOOL NextSection() = 0;
312 virtual FX_BOOL PrevSect ion() = 0; 301
313 302 virtual FX_BOOL PrevSection() = 0;
314 virtual FX_BOOL GetWord( CPVT_Word & word) const = 0; 303
315 304 virtual FX_BOOL GetWord(CPVT_Word& word) const = 0;
316 virtual FX_BOOL SetWord( const CPVT_Word & word) = 0; 305
317 306 virtual FX_BOOL SetWord(const CPVT_Word& word) = 0;
318 virtual FX_BOOL GetLine( CPVT_Line & line) const = 0; 307
319 308 virtual FX_BOOL GetLine(CPVT_Line& line) const = 0;
320 virtual FX_BOOL GetSecti on(CPVT_Section & section) const = 0; 309
321 310 virtual FX_BOOL GetSection(CPVT_Section& section) const = 0;
322 virtual FX_BOOL SetSecti on(const CPVT_Section & section) = 0; 311
323 312 virtual FX_BOOL SetSection(const CPVT_Section& section) = 0;
324 virtual void SetAt(in t32_t nWordIndex) = 0; 313
325 314 virtual void SetAt(int32_t nWordIndex) = 0;
326 virtual void SetAt(co nst CPVT_WordPlace & place) = 0; 315
327 316 virtual void SetAt(const CPVT_WordPlace& place) = 0;
328 virtual const CPVT_WordPlace & GetAt() const = 0; 317
329 }; 318 virtual const CPVT_WordPlace& GetAt() const = 0;
330 class IPDF_VariableText 319 };
331 { 320 class IPDF_VariableText {
332 public: 321 public:
333 static IPDF_VariableText* NewVariableText(); 322 static IPDF_VariableText* NewVariableText();
334 323
335 static void DelVariableText( IPDF_VariableText* pVT); 324 static void DelVariableText(IPDF_VariableText* pVT);
336 325
337 virtual IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Pr ovider * pProvider) = 0; 326 virtual IPDF_VariableText_Provider* SetProvider(
338 327 IPDF_VariableText_Provider* pProvider) = 0;
339 virtual IPDF_VariableText_Iterator* GetIterator() = 0; 328
340 329 virtual IPDF_VariableText_Iterator* GetIterator() = 0;
341 virtual void SetPlate Rect(const CPDF_Rect & rect) = 0; 330
342 331 virtual void SetPlateRect(const CPDF_Rect& rect) = 0;
343 virtual void SetAlign ment(int32_t nFormat = 0) = 0; 332
344 333 virtual void SetAlignment(int32_t nFormat = 0) = 0;
345 virtual void SetPassw ordChar(FX_WORD wSubWord = '*') = 0; 334
346 335 virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0;
347 virtual void SetLimit Char(int32_t nLimitChar = 0) = 0; 336
348 337 virtual void SetLimitChar(int32_t nLimitChar = 0) = 0;
349 virtual void SetCharA rray(int32_t nCharArray = 0) = 0; 338
350 339 virtual void SetCharArray(int32_t nCharArray = 0) = 0;
351 virtual void SetCharS pace(FX_FLOAT fCharSpace = 0.0f) = 0; 340
352 341 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0;
353 virtual void SetHorzS cale(int32_t nHorzScale = 100) = 0; 342
354 343 virtual void SetHorzScale(int32_t nHorzScale = 100) = 0;
355 virtual void SetMulti Line(FX_BOOL bMultiLine = TRUE) = 0; 344
356 345 virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0;
357 virtual void SetAutoR eturn(FX_BOOL bAuto = TRUE) = 0; 346
358 347 virtual void SetAutoReturn(FX_BOOL bAuto = TRUE) = 0;
359 virtual void SetAutoF ontSize(FX_BOOL bAuto = TRUE) = 0; 348
360 349 virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE) = 0;
361 virtual void SetFontS ize(FX_FLOAT fFontSize) = 0; 350
362 351 virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
363 virtual void SetLineL eading(FX_FLOAT fLineLeading) = 0; 352
364 353 virtual void SetLineLeading(FX_FLOAT fLineLeading) = 0;
365 virtual void SetRichT ext(FX_BOOL bRichText) = 0; 354
366 355 virtual void SetRichText(FX_BOOL bRichText) = 0;
367 virtual void Initiali ze() = 0; 356
368 357 virtual void Initialize() = 0;
369 virtual FX_BOOL IsValid( ) const = 0; 358
370 359 virtual FX_BOOL IsValid() const = 0;
371 virtual FX_BOOL IsRichTe xt() const = 0; 360
372 361 virtual FX_BOOL IsRichText() const = 0;
373 virtual void Rearrang eAll() = 0; 362
374 363 virtual void RearrangeAll() = 0;
375 virtual void Rearrang ePart(const CPVT_WordRange & PlaceRange) = 0; 364
376 365 virtual void RearrangePart(const CPVT_WordRange& PlaceRange) = 0;
377 virtual void ResetAll () = 0; 366
378 367 virtual void ResetAll() = 0;
379 virtual void SetText( const FX_WCHAR* text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NUL L, 368
380 const CPVT_WordProps * pWordProps = NULL) = 0; 369 virtual void SetText(const FX_WCHAR* text,
381 370 int32_t charset = 1,
382 virtual CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1, 371 const CPVT_SecProps* pSecProps = NULL,
383 const CPVT_WordProps * pWordProps = NULL) = 0; 372 const CPVT_WordProps* pWordProps = NULL) = 0;
384 373
385 virtual CPVT_WordPlace InsertSection(co nst CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, 374 virtual CPVT_WordPlace InsertWord(
386 const CPVT_WordProps * pWordProps = NULL) = 0; 375 const CPVT_WordPlace& place,
387 376 FX_WORD word,
388 virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, const FX_WCHAR* text, int32_t charset = 1, 377 int32_t charset = 1,
389 const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * p WordProps = NULL) = 0; 378 const CPVT_WordProps* pWordProps = NULL) = 0;
390 379
391 virtual CPVT_WordPlace DeleteWords(cons t CPVT_WordRange & PlaceRange) = 0; 380 virtual CPVT_WordPlace InsertSection(
392 381 const CPVT_WordPlace& place,
393 virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place) = 0; 382 const CPVT_SecProps* pSecProps = NULL,
394 383 const CPVT_WordProps* pWordProps = NULL) = 0;
395 virtual CPVT_WordPlace BackSpaceWord(co nst CPVT_WordPlace & place) = 0; 384
396 385 virtual CPVT_WordPlace InsertText(
397 virtual const CPDF_Rect & GetPlateRect() const = 0 ; 386 const CPVT_WordPlace& place,
398 387 const FX_WCHAR* text,
399 virtual CPDF_Rect GetContentRect() const = 0; 388 int32_t charset = 1,
400 389 const CPVT_SecProps* pSecProps = NULL,
401 virtual int32_t GetTotalWords() const = 0; 390 const CPVT_WordProps* pWordProps = NULL) = 0;
402 391
403 virtual FX_FLOAT GetFontSize() co nst = 0; 392 virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange) = 0;
404 393
405 virtual int32_t GetAlignment() c onst = 0; 394 virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place) = 0;
406 395
407 virtual FX_WORD GetPassw ordChar() const = 0; 396 virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) = 0;
408 397
409 virtual int32_t GetCharArray() c onst = 0; 398 virtual const CPDF_Rect& GetPlateRect() const = 0;
410 399
411 virtual int32_t GetLimitChar() c onst = 0; 400 virtual CPDF_Rect GetContentRect() const = 0;
412 401
413 virtual FX_BOOL IsMultiL ine() const = 0; 402 virtual int32_t GetTotalWords() const = 0;
414 403
415 virtual int32_t GetHorzScale() c onst = 0; 404 virtual FX_FLOAT GetFontSize() const = 0;
416 405
417 virtual FX_FLOAT GetCharSpace() c onst = 0; 406 virtual int32_t GetAlignment() const = 0;
418 407
419 virtual CPVT_WordPlace GetBeginWordPlac e() const = 0; 408 virtual FX_WORD GetPasswordChar() const = 0;
420 409
421 virtual CPVT_WordPlace GetEndWordPlace( ) const = 0; 410 virtual int32_t GetCharArray() const = 0;
422 411
423 virtual CPVT_WordPlace GetPrevWordPlace (const CPVT_WordPlace & place) const = 0; 412 virtual int32_t GetLimitChar() const = 0;
424 413
425 virtual CPVT_WordPlace GetNextWordPlace (const CPVT_WordPlace & place) const = 0; 414 virtual FX_BOOL IsMultiLine() const = 0;
426 415
427 virtual CPVT_WordPlace SearchWordPlace( const CPDF_Point & point) const = 0; 416 virtual int32_t GetHorzScale() const = 0;
428 417
429 virtual CPVT_WordPlace GetUpWordPlace(c onst CPVT_WordPlace & place, const CPDF_Point & point) const = 0; 418 virtual FX_FLOAT GetCharSpace() const = 0;
430 419
431 virtual CPVT_WordPlace GetDownWordPlace (const CPVT_WordPlace & place, const CPDF_Point & point) const = 0; 420 virtual CPVT_WordPlace GetBeginWordPlace() const = 0;
432 421
433 virtual CPVT_WordPlace GetLineBeginPlac e(const CPVT_WordPlace & place) const = 0; 422 virtual CPVT_WordPlace GetEndWordPlace() const = 0;
434 423
435 virtual CPVT_WordPlace GetLineEndPlace( const CPVT_WordPlace & place) const = 0; 424 virtual CPVT_WordPlace GetPrevWordPlace(
436 425 const CPVT_WordPlace& place) const = 0;
437 virtual CPVT_WordPlace GetSectionBeginP lace(const CPVT_WordPlace & place) const = 0; 426
438 427 virtual CPVT_WordPlace GetNextWordPlace(
439 virtual CPVT_WordPlace GetSectionEndPla ce(const CPVT_WordPlace & place) const = 0; 428 const CPVT_WordPlace& place) const = 0;
440 429
441 virtual void UpdateWo rdPlace(CPVT_WordPlace & place) const = 0; 430 virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
442 431
443 virtual CPVT_WordPlace AjustLineHeader( const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0; 432 virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place,
444 433 const CPDF_Point& point) const = 0;
445 virtual int32_t WordPlaceToWordI ndex(const CPVT_WordPlace & place) const = 0; 434
446 435 virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place,
447 virtual CPVT_WordPlace WordIndexToWordP lace(int32_t index) const = 0; 436 const CPDF_Point& point) const = 0;
448 437
449 protected: 438 virtual CPVT_WordPlace GetLineBeginPlace(
450 ~IPDF_VariableText() { } 439 const CPVT_WordPlace& place) const = 0;
440
441 virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const = 0;
442
443 virtual CPVT_WordPlace GetSectionBeginPlace(
444 const CPVT_WordPlace& place) const = 0;
445
446 virtual CPVT_WordPlace GetSectionEndPlace(
447 const CPVT_WordPlace& place) const = 0;
448
449 virtual void UpdateWordPlace(CPVT_WordPlace& place) const = 0;
450
451 virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace& place,
452 FX_BOOL bPrevOrNext) const = 0;
453
454 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0;
455
456 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0;
457
458 protected:
459 ~IPDF_VariableText() {}
451 }; 460 };
452 461
453 #endif // CORE_INCLUDE_FPDFDOC_FPDF_VT_H_ 462 #endif // CORE_INCLUDE_FPDFDOC_FPDF_VT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698