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_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 "core/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 fWidth(0.0f), | 219 fWidth(0.0f), |
220 fFontSize(0), | 220 fFontSize(0), |
221 WordProps() {} | 221 WordProps() {} |
222 | 222 |
223 FX_WORD Word; | 223 FX_WORD Word; |
224 | 224 |
225 int32_t nCharset; | 225 int32_t nCharset; |
226 | 226 |
227 CPVT_WordPlace WordPlace; | 227 CPVT_WordPlace WordPlace; |
228 | 228 |
229 CPDF_Point ptWord; | 229 CFX_FloatPoint ptWord; |
230 | 230 |
231 FX_FLOAT fAscent; | 231 FX_FLOAT fAscent; |
232 | 232 |
233 FX_FLOAT fDescent; | 233 FX_FLOAT fDescent; |
234 | 234 |
235 FX_FLOAT fWidth; | 235 FX_FLOAT fWidth; |
236 | 236 |
237 int32_t nFontIndex; | 237 int32_t nFontIndex; |
238 | 238 |
239 FX_FLOAT fFontSize; | 239 FX_FLOAT fFontSize; |
240 | 240 |
241 CPVT_WordProps WordProps; | 241 CPVT_WordProps WordProps; |
242 }; | 242 }; |
243 struct CPVT_Line { | 243 struct CPVT_Line { |
244 CPVT_Line() | 244 CPVT_Line() |
245 : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {} | 245 : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {} |
246 | 246 |
247 CPVT_WordPlace lineplace; | 247 CPVT_WordPlace lineplace; |
248 | 248 |
249 CPVT_WordPlace lineEnd; | 249 CPVT_WordPlace lineEnd; |
250 | 250 |
251 CPDF_Point ptLine; | 251 CFX_FloatPoint ptLine; |
252 | 252 |
253 FX_FLOAT fLineWidth; | 253 FX_FLOAT fLineWidth; |
254 | 254 |
255 FX_FLOAT fLineAscent; | 255 FX_FLOAT fLineAscent; |
256 | 256 |
257 FX_FLOAT fLineDescent; | 257 FX_FLOAT fLineDescent; |
258 }; | 258 }; |
259 struct CPVT_Section { | 259 struct CPVT_Section { |
260 CPVT_WordPlace secplace; | 260 CPVT_WordPlace secplace; |
261 | 261 |
262 CPDF_Rect rcSection; | 262 CFX_FloatRect rcSection; |
263 | 263 |
264 CPVT_SecProps SecProps; | 264 CPVT_SecProps SecProps; |
265 | 265 |
266 CPVT_WordProps WordProps; | 266 CPVT_WordProps WordProps; |
267 }; | 267 }; |
268 class IPDF_VariableText_Provider { | 268 class IPDF_VariableText_Provider { |
269 public: | 269 public: |
270 virtual ~IPDF_VariableText_Provider() {} | 270 virtual ~IPDF_VariableText_Provider() {} |
271 | 271 |
272 virtual int32_t GetCharWidth(int32_t nFontIndex, | 272 virtual int32_t GetCharWidth(int32_t nFontIndex, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 public: | 321 public: |
322 static IPDF_VariableText* NewVariableText(); | 322 static IPDF_VariableText* NewVariableText(); |
323 | 323 |
324 static void DelVariableText(IPDF_VariableText* pVT); | 324 static void DelVariableText(IPDF_VariableText* pVT); |
325 | 325 |
326 virtual IPDF_VariableText_Provider* SetProvider( | 326 virtual IPDF_VariableText_Provider* SetProvider( |
327 IPDF_VariableText_Provider* pProvider) = 0; | 327 IPDF_VariableText_Provider* pProvider) = 0; |
328 | 328 |
329 virtual IPDF_VariableText_Iterator* GetIterator() = 0; | 329 virtual IPDF_VariableText_Iterator* GetIterator() = 0; |
330 | 330 |
331 virtual void SetPlateRect(const CPDF_Rect& rect) = 0; | 331 virtual void SetPlateRect(const CFX_FloatRect& rect) = 0; |
332 | 332 |
333 virtual void SetAlignment(int32_t nFormat = 0) = 0; | 333 virtual void SetAlignment(int32_t nFormat = 0) = 0; |
334 | 334 |
335 virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0; | 335 virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0; |
336 | 336 |
337 virtual void SetLimitChar(int32_t nLimitChar = 0) = 0; | 337 virtual void SetLimitChar(int32_t nLimitChar = 0) = 0; |
338 | 338 |
339 virtual void SetCharArray(int32_t nCharArray = 0) = 0; | 339 virtual void SetCharArray(int32_t nCharArray = 0) = 0; |
340 | 340 |
341 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0; | 341 virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 int32_t charset = 1, | 388 int32_t charset = 1, |
389 const CPVT_SecProps* pSecProps = NULL, | 389 const CPVT_SecProps* pSecProps = NULL, |
390 const CPVT_WordProps* pWordProps = NULL) = 0; | 390 const CPVT_WordProps* pWordProps = NULL) = 0; |
391 | 391 |
392 virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange) = 0; | 392 virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange) = 0; |
393 | 393 |
394 virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place) = 0; | 394 virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place) = 0; |
395 | 395 |
396 virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) = 0; | 396 virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place) = 0; |
397 | 397 |
398 virtual const CPDF_Rect& GetPlateRect() const = 0; | 398 virtual const CFX_FloatRect& GetPlateRect() const = 0; |
399 | 399 |
400 virtual CPDF_Rect GetContentRect() const = 0; | 400 virtual CFX_FloatRect GetContentRect() const = 0; |
401 | 401 |
402 virtual int32_t GetTotalWords() const = 0; | 402 virtual int32_t GetTotalWords() const = 0; |
403 | 403 |
404 virtual FX_FLOAT GetFontSize() const = 0; | 404 virtual FX_FLOAT GetFontSize() const = 0; |
405 | 405 |
406 virtual int32_t GetAlignment() const = 0; | 406 virtual int32_t GetAlignment() const = 0; |
407 | 407 |
408 virtual FX_WORD GetPasswordChar() const = 0; | 408 virtual FX_WORD GetPasswordChar() const = 0; |
409 | 409 |
410 virtual int32_t GetCharArray() const = 0; | 410 virtual int32_t GetCharArray() const = 0; |
411 | 411 |
412 virtual int32_t GetLimitChar() const = 0; | 412 virtual int32_t GetLimitChar() const = 0; |
413 | 413 |
414 virtual FX_BOOL IsMultiLine() const = 0; | 414 virtual FX_BOOL IsMultiLine() const = 0; |
415 | 415 |
416 virtual int32_t GetHorzScale() const = 0; | 416 virtual int32_t GetHorzScale() const = 0; |
417 | 417 |
418 virtual FX_FLOAT GetCharSpace() const = 0; | 418 virtual FX_FLOAT GetCharSpace() const = 0; |
419 | 419 |
420 virtual CPVT_WordPlace GetBeginWordPlace() const = 0; | 420 virtual CPVT_WordPlace GetBeginWordPlace() const = 0; |
421 | 421 |
422 virtual CPVT_WordPlace GetEndWordPlace() const = 0; | 422 virtual CPVT_WordPlace GetEndWordPlace() const = 0; |
423 | 423 |
424 virtual CPVT_WordPlace GetPrevWordPlace( | 424 virtual CPVT_WordPlace GetPrevWordPlace( |
425 const CPVT_WordPlace& place) const = 0; | 425 const CPVT_WordPlace& place) const = 0; |
426 | 426 |
427 virtual CPVT_WordPlace GetNextWordPlace( | 427 virtual CPVT_WordPlace GetNextWordPlace( |
428 const CPVT_WordPlace& place) const = 0; | 428 const CPVT_WordPlace& place) const = 0; |
429 | 429 |
430 virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0; | 430 virtual CPVT_WordPlace SearchWordPlace(const CFX_FloatPoint& point) const = 0; |
431 | 431 |
432 virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, | 432 virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace& place, |
433 const CPDF_Point& point) const = 0; | 433 const CFX_FloatPoint& point) const = 0; |
434 | 434 |
435 virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace& place, | 435 virtual CPVT_WordPlace GetDownWordPlace( |
436 const CPDF_Point& point) const = 0; | 436 const CPVT_WordPlace& place, |
| 437 const CFX_FloatPoint& point) const = 0; |
437 | 438 |
438 virtual CPVT_WordPlace GetLineBeginPlace( | 439 virtual CPVT_WordPlace GetLineBeginPlace( |
439 const CPVT_WordPlace& place) const = 0; | 440 const CPVT_WordPlace& place) const = 0; |
440 | 441 |
441 virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const = 0; | 442 virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace& place) const = 0; |
442 | 443 |
443 virtual CPVT_WordPlace GetSectionBeginPlace( | 444 virtual CPVT_WordPlace GetSectionBeginPlace( |
444 const CPVT_WordPlace& place) const = 0; | 445 const CPVT_WordPlace& place) const = 0; |
445 | 446 |
446 virtual CPVT_WordPlace GetSectionEndPlace( | 447 virtual CPVT_WordPlace GetSectionEndPlace( |
447 const CPVT_WordPlace& place) const = 0; | 448 const CPVT_WordPlace& place) const = 0; |
448 | 449 |
449 virtual void UpdateWordPlace(CPVT_WordPlace& place) const = 0; | 450 virtual void UpdateWordPlace(CPVT_WordPlace& place) const = 0; |
450 | 451 |
451 virtual CPVT_WordPlace AdjustLineHeader(const CPVT_WordPlace& place, | 452 virtual CPVT_WordPlace AdjustLineHeader(const CPVT_WordPlace& place, |
452 FX_BOOL bPrevOrNext) const = 0; | 453 FX_BOOL bPrevOrNext) const = 0; |
453 | 454 |
454 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0; | 455 virtual int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const = 0; |
455 | 456 |
456 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; | 457 virtual CPVT_WordPlace WordIndexToWordPlace(int32_t index) const = 0; |
457 | 458 |
458 protected: | 459 protected: |
459 ~IPDF_VariableText() {} | 460 ~IPDF_VariableText() {} |
460 }; | 461 }; |
461 | 462 |
462 #endif // CORE_INCLUDE_FPDFDOC_FPDF_VT_H_ | 463 #endif // CORE_INCLUDE_FPDFDOC_FPDF_VT_H_ |
OLD | NEW |