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_SRC_FPDFDOC_PDF_VT_H_ | 7 #ifndef CORE_SRC_FPDFDOC_PDF_VT_H_ |
8 #define CORE_SRC_FPDFDOC_PDF_VT_H_ | 8 #define CORE_SRC_FPDFDOC_PDF_VT_H_ |
9 | 9 |
10 class CPVT_Size; | 10 class CPVT_Size; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 if (other.pWordProps) { | 112 if (other.pWordProps) { |
113 if (pWordProps) { | 113 if (pWordProps) { |
114 *pWordProps = *other.pWordProps; | 114 *pWordProps = *other.pWordProps; |
115 } else { | 115 } else { |
116 pWordProps = FX_NEW CPVT_WordProps(*other.pWordProps); | 116 pWordProps = FX_NEW CPVT_WordProps(*other.pWordProps); |
117 } | 117 } |
118 } | 118 } |
119 } | 119 } |
120 CPVT_FloatRect rcSection; | 120 CPVT_FloatRect rcSection; |
121 FX_INT32» » » » » nTotalLine; | 121 int32_t» » » » » nTotalLine; |
122 CPVT_SecProps* pSecProps; | 122 CPVT_SecProps* pSecProps; |
123 CPVT_WordProps* pWordProps; | 123 CPVT_WordProps* pWordProps; |
124 }; | 124 }; |
125 struct CPVT_LineInfo { | 125 struct CPVT_LineInfo { |
126 CPVT_LineInfo() : nTotalWord(0), nBeginWordIndex(-1), nEndWordIndex(-1), | 126 CPVT_LineInfo() : nTotalWord(0), nBeginWordIndex(-1), nEndWordIndex(-1), |
127 fLineX(0.0f), fLineY(0.0f), fLineWidth(0.0f), fLineAscent(0.0f), fLineDe
scent(0.0f) | 127 fLineX(0.0f), fLineY(0.0f), fLineWidth(0.0f), fLineAscent(0.0f), fLineDe
scent(0.0f) |
128 { | 128 { |
129 } | 129 } |
130 FX_INT32» » » » » nTotalWord; | 130 int32_t» » » » » nTotalWord; |
131 FX_INT32» » » » » nBeginWordIndex; | 131 int32_t» » » » » nBeginWordIndex; |
132 FX_INT32» » » » » nEndWordIndex; | 132 int32_t» » » » » nEndWordIndex; |
133 FX_FLOAT fLineX; | 133 FX_FLOAT fLineX; |
134 FX_FLOAT fLineY; | 134 FX_FLOAT fLineY; |
135 FX_FLOAT fLineWidth; | 135 FX_FLOAT fLineWidth; |
136 FX_FLOAT fLineAscent; | 136 FX_FLOAT fLineAscent; |
137 FX_FLOAT fLineDescent; | 137 FX_FLOAT fLineDescent; |
138 }; | 138 }; |
139 struct CPVT_WordInfo { | 139 struct CPVT_WordInfo { |
140 CPVT_WordInfo() : Word(0), nCharset(0), | 140 CPVT_WordInfo() : Word(0), nCharset(0), |
141 fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(
NULL) | 141 fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(
NULL) |
142 { | 142 { |
143 } | 143 } |
144 CPVT_WordInfo(FX_WORD word, FX_INT32 charset, FX_INT32 fontIndex, CPVT_WordP
rops * pProps): | 144 CPVT_WordInfo(FX_WORD word, int32_t charset, int32_t fontIndex, CPVT_WordPro
ps * pProps): |
145 Word(word), nCharset(charset), fWordX(0.0f), fWordY(0.0f), fWordTail(0.0
f), | 145 Word(word), nCharset(charset), fWordX(0.0f), fWordY(0.0f), fWordTail(0.0
f), |
146 nFontIndex(fontIndex), pWordProps(pProps) | 146 nFontIndex(fontIndex), pWordProps(pProps) |
147 { | 147 { |
148 } | 148 } |
149 virtual ~CPVT_WordInfo() | 149 virtual ~CPVT_WordInfo() |
150 { | 150 { |
151 if (pWordProps) { | 151 if (pWordProps) { |
152 delete pWordProps; | 152 delete pWordProps; |
153 } | 153 } |
154 } | 154 } |
(...skipping 12 matching lines...) Expand all Loading... |
167 this->nFontIndex = word.nFontIndex; | 167 this->nFontIndex = word.nFontIndex; |
168 if (word.pWordProps) { | 168 if (word.pWordProps) { |
169 if (pWordProps) { | 169 if (pWordProps) { |
170 *pWordProps = *word.pWordProps; | 170 *pWordProps = *word.pWordProps; |
171 } else { | 171 } else { |
172 pWordProps = FX_NEW CPVT_WordProps(*word.pWordProps); | 172 pWordProps = FX_NEW CPVT_WordProps(*word.pWordProps); |
173 } | 173 } |
174 } | 174 } |
175 } | 175 } |
176 FX_WORD Word; | 176 FX_WORD Word; |
177 FX_INT32» » » » » nCharset; | 177 int32_t» » » » » nCharset; |
178 FX_FLOAT fWordX; | 178 FX_FLOAT fWordX; |
179 FX_FLOAT fWordY; | 179 FX_FLOAT fWordY; |
180 FX_FLOAT fWordTail; | 180 FX_FLOAT fWordTail; |
181 FX_INT32» » » » » nFontIndex; | 181 int32_t» » » » » nFontIndex; |
182 CPVT_WordProps* pWordProps; | 182 CPVT_WordProps* pWordProps; |
183 }; | 183 }; |
184 struct CPVT_FloatRange { | 184 struct CPVT_FloatRange { |
185 CPVT_FloatRange() : fMin(0.0f), fMax(0.0f) | 185 CPVT_FloatRange() : fMin(0.0f), fMax(0.0f) |
186 { | 186 { |
187 } | 187 } |
188 CPVT_FloatRange(FX_FLOAT min, FX_FLOAT max) : fMin(min), fMax(max) | 188 CPVT_FloatRange(FX_FLOAT min, FX_FLOAT max) : fMin(min), fMax(max) |
189 { | 189 { |
190 } | 190 } |
191 FX_FLOAT Range() const | 191 FX_FLOAT Range() const |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 CPVT_LineInfo m_LineIn
fo; | 228 CPVT_LineInfo m_LineIn
fo; |
229 }; | 229 }; |
230 class CLines | 230 class CLines |
231 { | 231 { |
232 public: | 232 public: |
233 CLines() : m_nTotal(0) {} | 233 CLines() : m_nTotal(0) {} |
234 virtual ~CLines() | 234 virtual ~CLines() |
235 { | 235 { |
236 RemoveAll(); | 236 RemoveAll(); |
237 } | 237 } |
238 FX_INT32» » » » » » » » GetSize(
) const | 238 int32_t» » » » » » » » GetSize(
) const |
239 { | 239 { |
240 return m_Lines.GetSize(); | 240 return m_Lines.GetSize(); |
241 } | 241 } |
242 CLine *» » » » » » » » »
GetAt(FX_INT32 nIndex) const | 242 CLine *» » » » » » » » »
GetAt(int32_t nIndex) const |
243 { | 243 { |
244 return m_Lines.GetAt(nIndex); | 244 return m_Lines.GetAt(nIndex); |
245 } | 245 } |
246 void
Empty() | 246 void
Empty() |
247 { | 247 { |
248 m_nTotal = 0; | 248 m_nTotal = 0; |
249 } | 249 } |
250 void
RemoveAll() | 250 void
RemoveAll() |
251 { | 251 { |
252 for (FX_INT32 i = 0, sz = GetSize(); i < sz; i++) { | 252 for (int32_t i = 0, sz = GetSize(); i < sz; i++) { |
253 delete GetAt(i); | 253 delete GetAt(i); |
254 } | 254 } |
255 m_Lines.RemoveAll(); | 255 m_Lines.RemoveAll(); |
256 m_nTotal = 0; | 256 m_nTotal = 0; |
257 } | 257 } |
258 FX_INT32» » » » » » » » Add(cons
t CPVT_LineInfo & lineinfo) | 258 int32_t» » » » » » » » Add(cons
t CPVT_LineInfo & lineinfo) |
259 { | 259 { |
260 if (m_nTotal >= GetSize()) { | 260 if (m_nTotal >= GetSize()) { |
261 if (CLine * pLine = FX_NEW CLine) { | 261 if (CLine * pLine = FX_NEW CLine) { |
262 pLine->m_LineInfo = lineinfo; | 262 pLine->m_LineInfo = lineinfo; |
263 m_Lines.Add(pLine); | 263 m_Lines.Add(pLine); |
264 return m_nTotal++; | 264 return m_nTotal++; |
265 } | 265 } |
266 return m_nTotal; | 266 return m_nTotal; |
267 } else { | 267 } else { |
268 if (CLine * pLine = GetAt(m_nTotal)) { | 268 if (CLine * pLine = GetAt(m_nTotal)) { |
269 pLine->m_LineInfo = lineinfo; | 269 pLine->m_LineInfo = lineinfo; |
270 } | 270 } |
271 return m_nTotal++; | 271 return m_nTotal++; |
272 } | 272 } |
273 } | 273 } |
274 void
Clear() | 274 void
Clear() |
275 { | 275 { |
276 for (FX_INT32 i = GetSize() - 1; i >= m_nTotal; i--) { | 276 for (int32_t i = GetSize() - 1; i >= m_nTotal; i--) { |
277 delete GetAt(i); | 277 delete GetAt(i); |
278 m_Lines.RemoveAt(i); | 278 m_Lines.RemoveAt(i); |
279 } | 279 } |
280 } | 280 } |
281 private: | 281 private: |
282 CPVT_ArrayTemplate<CLine*> m_Lines; | 282 CPVT_ArrayTemplate<CLine*> m_Lines; |
283 FX_INT32» » » » » » » » m_nTotal
; | 283 int32_t» » » » » » » » m_nTotal
; |
284 }; | 284 }; |
285 class CSection | 285 class CSection |
286 { | 286 { |
287 friend class CTypeset; | 287 friend class CTypeset; |
288 public: | 288 public: |
289 CSection(CPDF_VariableText * pVT); | 289 CSection(CPDF_VariableText * pVT); |
290 virtual ~CSection(); | 290 virtual ~CSection(); |
291 void
ResetAll(); | 291 void
ResetAll(); |
292 void
ResetLineArray(); | 292 void
ResetLineArray(); |
293 void
ResetWordArray(); | 293 void
ResetWordArray(); |
(...skipping 11 matching lines...) Expand all Loading... |
305 void
UpdateWordPlace(CPVT_WordPlace & place) const; | 305 void
UpdateWordPlace(CPVT_WordPlace & place) const; |
306 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; | 306 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; |
307 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const; | 307 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const; |
308 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordRange & range) const; | 308 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordRange & range) const; |
309 public: | 309 public: |
310 CPVT_WordPlace SecPlace
; | 310 CPVT_WordPlace SecPlace
; |
311 CPVT_SectionInfo m_SecInfo; | 311 CPVT_SectionInfo m_SecInfo; |
312 CLines
m_LineArray; | 312 CLines
m_LineArray; |
313 CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; | 313 CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; |
314 private: | 314 private: |
315 void» » » » » » » » »
ClearLeftWords(FX_INT32 nWordIndex); | 315 void» » » » » » » » »
ClearLeftWords(int32_t nWordIndex); |
316 void» » » » » » » » »
ClearRightWords(FX_INT32 nWordIndex); | 316 void» » » » » » » » »
ClearRightWords(int32_t nWordIndex); |
317 void» » » » » » » » »
ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); | 317 void» » » » » » » » »
ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex); |
318 | 318 |
319 CPDF_VariableText *m_pVT; | 319 CPDF_VariableText *m_pVT; |
320 }; | 320 }; |
321 class CTypeset | 321 class CTypeset |
322 { | 322 { |
323 public: | 323 public: |
324 CTypeset(CSection * pSection); | 324 CTypeset(CSection * pSection); |
325 virtual ~CTypeset(); | 325 virtual ~CTypeset(); |
326 CPVT_Size GetEditS
ize(FX_FLOAT fFontSize); | 326 CPVT_Size GetEditS
ize(FX_FLOAT fFontSize); |
327 CPVT_FloatRect Typeset(
); | 327 CPVT_FloatRect Typeset(
); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 friend class CPDF_VariableText_Iterator; | 407 friend class CPDF_VariableText_Iterator; |
408 public: | 408 public: |
409 CPDF_VariableText(); | 409 CPDF_VariableText(); |
410 virtual ~CPDF_VariableText(); | 410 virtual ~CPDF_VariableText(); |
411 IPDF_VariableText_Provider* SetProvider(IPDF_Variabl
eText_Provider * pProvider); | 411 IPDF_VariableText_Provider* SetProvider(IPDF_Variabl
eText_Provider * pProvider); |
412 IPDF_VariableText_Iterator* GetIterator(); | 412 IPDF_VariableText_Iterator* GetIterator(); |
413 void
SetPlateRect(const CPDF_Rect & rect) | 413 void
SetPlateRect(const CPDF_Rect & rect) |
414 { | 414 { |
415 CPDF_EditContainer::SetPlateRect(rect); | 415 CPDF_EditContainer::SetPlateRect(rect); |
416 } | 416 } |
417 void» » » » » » » » »
SetAlignment(FX_INT32 nFormat = 0) | 417 void» » » » » » » » »
SetAlignment(int32_t nFormat = 0) |
418 { | 418 { |
419 m_nAlignment = nFormat; | 419 m_nAlignment = nFormat; |
420 } | 420 } |
421 void
SetPasswordChar(FX_WORD wSubWord = '*') | 421 void
SetPasswordChar(FX_WORD wSubWord = '*') |
422 { | 422 { |
423 m_wSubWord = wSubWord; | 423 m_wSubWord = wSubWord; |
424 } | 424 } |
425 void» » » » » » » » »
SetLimitChar(FX_INT32 nLimitChar = 0) | 425 void» » » » » » » » »
SetLimitChar(int32_t nLimitChar = 0) |
426 { | 426 { |
427 m_nLimitChar = nLimitChar; | 427 m_nLimitChar = nLimitChar; |
428 } | 428 } |
429 void
SetCharSpace(FX_FLOAT fCharSpace = 0.0f) | 429 void
SetCharSpace(FX_FLOAT fCharSpace = 0.0f) |
430 { | 430 { |
431 m_fCharSpace = fCharSpace; | 431 m_fCharSpace = fCharSpace; |
432 } | 432 } |
433 void» » » » » » » » »
SetHorzScale(FX_INT32 nHorzScale = 100) | 433 void» » » » » » » » »
SetHorzScale(int32_t nHorzScale = 100) |
434 { | 434 { |
435 m_nHorzScale = nHorzScale; | 435 m_nHorzScale = nHorzScale; |
436 } | 436 } |
437 void
SetMultiLine(FX_BOOL bMultiLine = TRUE) | 437 void
SetMultiLine(FX_BOOL bMultiLine = TRUE) |
438 { | 438 { |
439 m_bMultiLine = bMultiLine; | 439 m_bMultiLine = bMultiLine; |
440 } | 440 } |
441 void
SetAutoReturn(FX_BOOL bAuto = TRUE) | 441 void
SetAutoReturn(FX_BOOL bAuto = TRUE) |
442 { | 442 { |
443 m_bLimitWidth = bAuto; | 443 m_bLimitWidth = bAuto; |
444 } | 444 } |
445 void
SetFontSize(FX_FLOAT fFontSize) | 445 void
SetFontSize(FX_FLOAT fFontSize) |
446 { | 446 { |
447 m_fFontSize = fFontSize; | 447 m_fFontSize = fFontSize; |
448 } | 448 } |
449 void» » » » » » » » »
SetCharArray(FX_INT32 nCharArray = 0) | 449 void» » » » » » » » »
SetCharArray(int32_t nCharArray = 0) |
450 { | 450 { |
451 m_nCharArray = nCharArray; | 451 m_nCharArray = nCharArray; |
452 } | 452 } |
453 void
SetAutoFontSize(FX_BOOL bAuto = TRUE) | 453 void
SetAutoFontSize(FX_BOOL bAuto = TRUE) |
454 { | 454 { |
455 m_bAutoFontSize = bAuto; | 455 m_bAutoFontSize = bAuto; |
456 } | 456 } |
457 void
SetRichText(FX_BOOL bRichText) | 457 void
SetRichText(FX_BOOL bRichText) |
458 { | 458 { |
459 m_bRichText = bRichText; | 459 m_bRichText = bRichText; |
460 } | 460 } |
461 void
SetLineLeading(FX_FLOAT fLineLeading) | 461 void
SetLineLeading(FX_FLOAT fLineLeading) |
462 { | 462 { |
463 m_fLineLeading = fLineLeading; | 463 m_fLineLeading = fLineLeading; |
464 } | 464 } |
465 void
Initialize(); | 465 void
Initialize(); |
466 FX_BOOL
IsValid() const | 466 FX_BOOL
IsValid() const |
467 { | 467 { |
468 return m_bInitial; | 468 return m_bInitial; |
469 } | 469 } |
470 FX_BOOL
IsRichText() const | 470 FX_BOOL
IsRichText() const |
471 { | 471 { |
472 return m_bRichText; | 472 return m_bRichText; |
473 } | 473 } |
474 void
RearrangeAll(); | 474 void
RearrangeAll(); |
475 void
RearrangePart(const CPVT_WordRange & PlaceRange); | 475 void
RearrangePart(const CPVT_WordRange & PlaceRange); |
476 void
ResetAll(); | 476 void
ResetAll(); |
477 void» » » » » » » » »
SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps =
NULL, | 477 void» » » » » » » » »
SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps =
NULL, |
478 const CPVT_WordProps * pWordProps = NULL); | 478 const CPVT_WordProps * pWordProps = NULL); |
479 CPVT_WordPlace» » » » » » » InsertWo
rd(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1, | 479 CPVT_WordPlace» » » » » » » InsertWo
rd(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1, |
480 const CPVT_WordProps * pWordProps = NULL); | 480 const CPVT_WordProps * pWordProps = NULL); |
481 CPVT_WordPlace InsertSe
ction(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, | 481 CPVT_WordPlace InsertSe
ction(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, |
482 const CPVT_WordProps * pWordProps = NULL); | 482 const CPVT_WordProps * pWordProps = NULL); |
483 CPVT_WordPlace» » » » » » » InsertTe
xt(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1, | 483 CPVT_WordPlace» » » » » » » InsertTe
xt(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1, |
484 const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * p
WordProps = NULL); | 484 const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * p
WordProps = NULL); |
485 CPVT_WordPlace DeleteWo
rds(const CPVT_WordRange & PlaceRange); | 485 CPVT_WordPlace DeleteWo
rds(const CPVT_WordRange & PlaceRange); |
486 CPVT_WordPlace DeleteWo
rd(const CPVT_WordPlace & place); | 486 CPVT_WordPlace DeleteWo
rd(const CPVT_WordPlace & place); |
487 CPVT_WordPlace BackSpac
eWord(const CPVT_WordPlace & place); | 487 CPVT_WordPlace BackSpac
eWord(const CPVT_WordPlace & place); |
488 const CPDF_Rect & GetPlateRect() c
onst | 488 const CPDF_Rect & GetPlateRect() c
onst |
489 { | 489 { |
490 return CPDF_EditContainer::GetPlateRect(); | 490 return CPDF_EditContainer::GetPlateRect(); |
491 } | 491 } |
492 CPDF_Rect GetConte
ntRect() const; | 492 CPDF_Rect GetConte
ntRect() const; |
493 FX_INT32» » » » » » » » GetTotal
Words() const; | 493 int32_t» » » » » » » » GetTotal
Words() const; |
494 FX_FLOAT GetFontS
ize() const | 494 FX_FLOAT GetFontS
ize() const |
495 { | 495 { |
496 return m_fFontSize; | 496 return m_fFontSize; |
497 } | 497 } |
498 FX_INT32» » » » » » » » GetAlign
ment() const | 498 int32_t» » » » » » » » GetAlign
ment() const |
499 { | 499 { |
500 return m_nAlignment; | 500 return m_nAlignment; |
501 } | 501 } |
502 FX_INT32» » » » » » » » GetCharA
rray() const | 502 int32_t» » » » » » » » GetCharA
rray() const |
503 { | 503 { |
504 return m_nCharArray; | 504 return m_nCharArray; |
505 } | 505 } |
506 FX_INT32» » » » » » » » GetLimit
Char() const | 506 int32_t» » » » » » » » GetLimit
Char() const |
507 { | 507 { |
508 return m_nLimitChar; | 508 return m_nLimitChar; |
509 } | 509 } |
510 FX_BOOL
IsMultiLine() const | 510 FX_BOOL
IsMultiLine() const |
511 { | 511 { |
512 return m_bMultiLine; | 512 return m_bMultiLine; |
513 } | 513 } |
514 FX_INT32» » » » » » » » GetHorzS
cale() const | 514 int32_t» » » » » » » » GetHorzS
cale() const |
515 { | 515 { |
516 return m_nHorzScale; | 516 return m_nHorzScale; |
517 } | 517 } |
518 FX_FLOAT GetCharS
pace() const | 518 FX_FLOAT GetCharS
pace() const |
519 { | 519 { |
520 return m_fCharSpace; | 520 return m_fCharSpace; |
521 } | 521 } |
522 | 522 |
523 CPVT_WordPlace GetBegin
WordPlace() const; | 523 CPVT_WordPlace GetBegin
WordPlace() const; |
524 CPVT_WordPlace GetEndWo
rdPlace() const; | 524 CPVT_WordPlace GetEndWo
rdPlace() const; |
525 CPVT_WordPlace GetPrevW
ordPlace(const CPVT_WordPlace & place) const; | 525 CPVT_WordPlace GetPrevW
ordPlace(const CPVT_WordPlace & place) const; |
526 CPVT_WordPlace GetNextW
ordPlace(const CPVT_WordPlace & place) const; | 526 CPVT_WordPlace GetNextW
ordPlace(const CPVT_WordPlace & place) const; |
527 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; | 527 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; |
528 CPVT_WordPlace GetUpWor
dPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; | 528 CPVT_WordPlace GetUpWor
dPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; |
529 CPVT_WordPlace GetDownW
ordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; | 529 CPVT_WordPlace GetDownW
ordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; |
530 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; | 530 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; |
531 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; | 531 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; |
532 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; | 532 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; |
533 CPVT_WordPlace GetSecti
onEndPlace(const CPVT_WordPlace & place) const; | 533 CPVT_WordPlace GetSecti
onEndPlace(const CPVT_WordPlace & place) const; |
534 void
UpdateWordPlace(CPVT_WordPlace & place) const; | 534 void
UpdateWordPlace(CPVT_WordPlace & place) const; |
535 FX_INT32» » » » » » » » WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; | 535 int32_t» » » » » » » » WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; |
536 CPVT_WordPlace» » » » » » » WordInde
xToWordPlace(FX_INT32 index) const; | 536 CPVT_WordPlace» » » » » » » WordInde
xToWordPlace(int32_t index) const; |
537 FX_WORD
GetPasswordChar() const | 537 FX_WORD
GetPasswordChar() const |
538 { | 538 { |
539 return GetSubWord(); | 539 return GetSubWord(); |
540 } | 540 } |
541 FX_WORD
GetSubWord() const | 541 FX_WORD
GetSubWord() const |
542 { | 542 { |
543 return m_wSubWord; | 543 return m_wSubWord; |
544 } | 544 } |
545 private: | 545 private: |
546 FX_INT32» » » » » » » » GetCharW
idth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle); | 546 int32_t» » » » » » » » GetCharW
idth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, int32_t nWordStyle); |
547 FX_INT32» » » » » » » » GetTypeA
scent(FX_INT32 nFontIndex); | 547 int32_t» » » » » » » » GetTypeA
scent(int32_t nFontIndex); |
548 FX_INT32» » » » » » » » GetTypeD
escent(FX_INT32 nFontIndex); | 548 int32_t» » » » » » » » GetTypeD
escent(int32_t nFontIndex); |
549 FX_INT32» » » » » » » » GetWordF
ontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); | 549 int32_t» » » » » » » » GetWordF
ontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); |
550 FX_INT32» » » » » » » » GetDefau
ltFontIndex(); | 550 int32_t» » » » » » » » GetDefau
ltFontIndex(); |
551 FX_BOOL
IsLatinWord(FX_WORD word); | 551 FX_BOOL
IsLatinWord(FX_WORD word); |
552 private: | 552 private: |
553 | 553 |
554 CPVT_WordPlace AddSecti
on(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo); | 554 CPVT_WordPlace AddSecti
on(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo); |
555 CPVT_WordPlace AddLine(
const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo); | 555 CPVT_WordPlace AddLine(
const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo); |
556 CPVT_WordPlace AddWord(
const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); | 556 CPVT_WordPlace AddWord(
const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); |
557 FX_BOOL
GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); | 557 FX_BOOL
GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); |
558 FX_BOOL
SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); | 558 FX_BOOL
SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); |
559 FX_BOOL
GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); | 559 FX_BOOL
GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); |
560 FX_BOOL
GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); | 560 FX_BOOL
GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); |
561 FX_FLOAT GetWordF
ontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 561 FX_FLOAT GetWordF
ontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
562 FX_FLOAT» » » » » » » » GetWordW
idth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, | 562 FX_FLOAT» » » » » » » » GetWordW
idth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, |
563 FX_FLOAT fCharSpace, FX_INT32 nHorzScale, | 563 FX_FLOAT fCharSpace, int32_t nHorzScale, |
564 FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle); | 564 FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle); |
565 FX_FLOAT GetWordW
idth(const CPVT_WordInfo & WordInfo); | 565 FX_FLOAT GetWordW
idth(const CPVT_WordInfo & WordInfo); |
566 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); | 566 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); |
567 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); | 567 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); |
568 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 568 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
569 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 569 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
570 FX_FLOAT GetLineA
scent(const CPVT_SectionInfo & SecInfo); | 570 FX_FLOAT GetLineA
scent(const CPVT_SectionInfo & SecInfo); |
571 FX_FLOAT GetLineD
escent(const CPVT_SectionInfo & SecInfo); | 571 FX_FLOAT GetLineD
escent(const CPVT_SectionInfo & SecInfo); |
572 FX_FLOAT» » » » » » » » GetFontA
scent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); | 572 FX_FLOAT» » » » » » » » GetFontA
scent(int32_t nFontIndex, FX_FLOAT fFontSize); |
573 FX_FLOAT» » » » » » » » GetFontD
escent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); | 573 FX_FLOAT» » » » » » » » GetFontD
escent(int32_t nFontIndex, FX_FLOAT fFontSize); |
574 FX_INT32» » » » » » » » GetWordF
ontIndex(const CPVT_WordInfo & WordInfo); | 574 int32_t» » » » » » » » GetWordF
ontIndex(const CPVT_WordInfo & WordInfo); |
575 FX_FLOAT GetCharS
pace(const CPVT_WordInfo & WordInfo); | 575 FX_FLOAT GetCharS
pace(const CPVT_WordInfo & WordInfo); |
576 FX_INT32» » » » » » » » GetHorzS
cale(const CPVT_WordInfo & WordInfo); | 576 int32_t» » » » » » » » GetHorzS
cale(const CPVT_WordInfo & WordInfo); |
577 FX_FLOAT GetLineL
eading(const CPVT_SectionInfo & SecInfo); | 577 FX_FLOAT GetLineL
eading(const CPVT_SectionInfo & SecInfo); |
578 FX_FLOAT GetLineI
ndent(const CPVT_SectionInfo & SecInfo); | 578 FX_FLOAT GetLineI
ndent(const CPVT_SectionInfo & SecInfo); |
579 FX_INT32» » » » » » » » GetAlign
ment(const CPVT_SectionInfo& SecInfo); | 579 int32_t» » » » » » » » GetAlign
ment(const CPVT_SectionInfo& SecInfo); |
580 | 580 |
581 void
ClearSectionRightWords(const CPVT_WordPlace & place); | 581 void
ClearSectionRightWords(const CPVT_WordPlace & place); |
582 CPVT_WordPlace AjustLin
eHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; | 582 CPVT_WordPlace AjustLin
eHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; |
583 FX_BOOL
ClearEmptySection(const CPVT_WordPlace & place); | 583 FX_BOOL
ClearEmptySection(const CPVT_WordPlace & place); |
584 void
ClearEmptySections(const CPVT_WordRange & PlaceRange); | 584 void
ClearEmptySections(const CPVT_WordRange & PlaceRange); |
585 void
LinkLatterSection(const CPVT_WordPlace & place); | 585 void
LinkLatterSection(const CPVT_WordPlace & place); |
586 void
ClearWords(const CPVT_WordRange & PlaceRange); | 586 void
ClearWords(const CPVT_WordRange & PlaceRange); |
587 CPVT_WordPlace ClearLef
tWord(const CPVT_WordPlace & place); | 587 CPVT_WordPlace ClearLef
tWord(const CPVT_WordPlace & place); |
588 CPVT_WordPlace ClearRig
htWord(const CPVT_WordPlace & place); | 588 CPVT_WordPlace ClearRig
htWord(const CPVT_WordPlace & place); |
589 private: | 589 private: |
590 CPVT_FloatRect Rearrang
e(const CPVT_WordRange & PlaceRange); | 590 CPVT_FloatRect Rearrang
e(const CPVT_WordRange & PlaceRange); |
591 FX_FLOAT GetAutoF
ontSize(); | 591 FX_FLOAT GetAutoF
ontSize(); |
592 FX_BOOL
IsBigger(FX_FLOAT fFontSize); | 592 FX_BOOL
IsBigger(FX_FLOAT fFontSize); |
593 CPVT_FloatRect Rearrang
eSections(const CPVT_WordRange & PlaceRange); | 593 CPVT_FloatRect Rearrang
eSections(const CPVT_WordRange & PlaceRange); |
594 private: | 594 private: |
595 void
ResetSectionArray(); | 595 void
ResetSectionArray(); |
596 private: | 596 private: |
597 CPVT_ArrayTemplate<CSection*> m_SectionArray; | 597 CPVT_ArrayTemplate<CSection*> m_SectionArray; |
598 FX_INT32» » » » » » » » m_nLimit
Char; | 598 int32_t» » » » » » » » m_nLimit
Char; |
599 FX_INT32» » » » » » » » m_nCharA
rray; | 599 int32_t» » » » » » » » m_nCharA
rray; |
600 FX_BOOL
m_bMultiLine; | 600 FX_BOOL
m_bMultiLine; |
601 FX_BOOL
m_bLimitWidth; | 601 FX_BOOL
m_bLimitWidth; |
602 FX_BOOL
m_bAutoFontSize; | 602 FX_BOOL
m_bAutoFontSize; |
603 FX_INT32» » » » » » » » m_nAlign
ment; | 603 int32_t» » » » » » » » m_nAlign
ment; |
604 FX_FLOAT m_fLineL
eading; | 604 FX_FLOAT m_fLineL
eading; |
605 FX_FLOAT m_fCharS
pace; | 605 FX_FLOAT m_fCharS
pace; |
606 FX_INT32» » » » » » » » m_nHorzS
cale; | 606 int32_t» » » » » » » » m_nHorzS
cale; |
607 FX_WORD
m_wSubWord; | 607 FX_WORD
m_wSubWord; |
608 FX_FLOAT m_fFontS
ize; | 608 FX_FLOAT m_fFontS
ize; |
609 | 609 |
610 private: | 610 private: |
611 FX_BOOL
m_bInitial; | 611 FX_BOOL
m_bInitial; |
612 FX_BOOL
m_bRichText; | 612 FX_BOOL
m_bRichText; |
613 IPDF_VariableText_Provider * m_pVTProvider; | 613 IPDF_VariableText_Provider * m_pVTProvider; |
614 CPDF_VariableText_Iterator * m_pVTIterator; | 614 CPDF_VariableText_Iterator * m_pVTIterator; |
615 }; | 615 }; |
616 class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator | 616 class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator |
617 { | 617 { |
618 public: | 618 public: |
619 CPDF_VariableText_Iterator(CPDF_VariableText * pVT); | 619 CPDF_VariableText_Iterator(CPDF_VariableText * pVT); |
620 virtual ~CPDF_VariableText_Iterator(); | 620 virtual ~CPDF_VariableText_Iterator(); |
621 FX_BOOL
NextWord(); | 621 FX_BOOL
NextWord(); |
622 FX_BOOL
PrevWord(); | 622 FX_BOOL
PrevWord(); |
623 FX_BOOL
NextLine(); | 623 FX_BOOL
NextLine(); |
624 FX_BOOL
PrevLine(); | 624 FX_BOOL
PrevLine(); |
625 FX_BOOL
NextSection(); | 625 FX_BOOL
NextSection(); |
626 FX_BOOL
PrevSection(); | 626 FX_BOOL
PrevSection(); |
627 FX_BOOL
SetWord(const CPVT_Word & word); | 627 FX_BOOL
SetWord(const CPVT_Word & word); |
628 FX_BOOL
GetWord(CPVT_Word & word) const; | 628 FX_BOOL
GetWord(CPVT_Word & word) const; |
629 FX_BOOL
GetLine(CPVT_Line & line) const; | 629 FX_BOOL
GetLine(CPVT_Line & line) const; |
630 FX_BOOL
GetSection(CPVT_Section & section) const; | 630 FX_BOOL
GetSection(CPVT_Section & section) const; |
631 FX_BOOL
SetSection(const CPVT_Section & section); | 631 FX_BOOL
SetSection(const CPVT_Section & section); |
632 void» » » » » » » » »
SetAt(FX_INT32 nWordIndex); | 632 void» » » » » » » » »
SetAt(int32_t nWordIndex); |
633 void
SetAt(const CPVT_WordPlace & place); | 633 void
SetAt(const CPVT_WordPlace & place); |
634 const CPVT_WordPlace & GetAt() const | 634 const CPVT_WordPlace & GetAt() const |
635 { | 635 { |
636 return m_CurPos; | 636 return m_CurPos; |
637 }; | 637 }; |
638 private: | 638 private: |
639 CPVT_WordPlace m_CurPos
; | 639 CPVT_WordPlace m_CurPos
; |
640 CPDF_VariableText * m_pVT; | 640 CPDF_VariableText * m_pVT; |
641 }; | 641 }; |
642 | 642 |
643 #endif // CORE_SRC_FPDFDOC_PDF_VT_H_ | 643 #endif // CORE_SRC_FPDFDOC_PDF_VT_H_ |
OLD | NEW |