| 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 = new CPVT_WordProps(*other.pWordProps); | 116 pWordProps = 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 = new CPVT_WordProps(*word.pWordProps); | 172 pWordProps = 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 CLine* pLine = new CLine; | 261 CLine* pLine = new CLine; |
| 262 pLine->m_LineInfo = lineinfo; | 262 pLine->m_LineInfo = lineinfo; |
| 263 m_Lines.Add(pLine); | 263 m_Lines.Add(pLine); |
| 264 } else if (CLine* pLine = GetAt(m_nTotal)) { | 264 } else if (CLine* pLine = GetAt(m_nTotal)) { |
| 265 pLine->m_LineInfo = lineinfo; | 265 pLine->m_LineInfo = lineinfo; |
| 266 } | 266 } |
| 267 return m_nTotal++; | 267 return m_nTotal++; |
| 268 } | 268 } |
| 269 void
Clear() | 269 void
Clear() |
| 270 { | 270 { |
| 271 for (FX_INT32 i = GetSize() - 1; i >= m_nTotal; i--) { | 271 for (int32_t i = GetSize() - 1; i >= m_nTotal; i--) { |
| 272 delete GetAt(i); | 272 delete GetAt(i); |
| 273 m_Lines.RemoveAt(i); | 273 m_Lines.RemoveAt(i); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 private: | 276 private: |
| 277 CPVT_ArrayTemplate<CLine*> m_Lines; | 277 CPVT_ArrayTemplate<CLine*> m_Lines; |
| 278 FX_INT32» » » » » » » » m_nTotal
; | 278 int32_t» » » » » » » » m_nTotal
; |
| 279 }; | 279 }; |
| 280 class CSection | 280 class CSection |
| 281 { | 281 { |
| 282 friend class CTypeset; | 282 friend class CTypeset; |
| 283 public: | 283 public: |
| 284 CSection(CPDF_VariableText * pVT); | 284 CSection(CPDF_VariableText * pVT); |
| 285 virtual ~CSection(); | 285 virtual ~CSection(); |
| 286 void
ResetAll(); | 286 void
ResetAll(); |
| 287 void
ResetLineArray(); | 287 void
ResetLineArray(); |
| 288 void
ResetWordArray(); | 288 void
ResetWordArray(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 300 void
UpdateWordPlace(CPVT_WordPlace & place) const; | 300 void
UpdateWordPlace(CPVT_WordPlace & place) const; |
| 301 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; | 301 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; |
| 302 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const; | 302 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const; |
| 303 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordRange & range) const; | 303 CPVT_WordPlace SearchWo
rdPlace(FX_FLOAT fx, const CPVT_WordRange & range) const; |
| 304 public: | 304 public: |
| 305 CPVT_WordPlace SecPlace
; | 305 CPVT_WordPlace SecPlace
; |
| 306 CPVT_SectionInfo m_SecInfo; | 306 CPVT_SectionInfo m_SecInfo; |
| 307 CLines
m_LineArray; | 307 CLines
m_LineArray; |
| 308 CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; | 308 CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; |
| 309 private: | 309 private: |
| 310 void» » » » » » » » »
ClearLeftWords(FX_INT32 nWordIndex); | 310 void» » » » » » » » »
ClearLeftWords(int32_t nWordIndex); |
| 311 void» » » » » » » » »
ClearRightWords(FX_INT32 nWordIndex); | 311 void» » » » » » » » »
ClearRightWords(int32_t nWordIndex); |
| 312 void» » » » » » » » »
ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex); | 312 void» » » » » » » » »
ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex); |
| 313 | 313 |
| 314 CPDF_VariableText *m_pVT; | 314 CPDF_VariableText *m_pVT; |
| 315 }; | 315 }; |
| 316 class CTypeset | 316 class CTypeset |
| 317 { | 317 { |
| 318 public: | 318 public: |
| 319 CTypeset(CSection * pSection); | 319 CTypeset(CSection * pSection); |
| 320 virtual ~CTypeset(); | 320 virtual ~CTypeset(); |
| 321 CPVT_Size GetEditS
ize(FX_FLOAT fFontSize); | 321 CPVT_Size GetEditS
ize(FX_FLOAT fFontSize); |
| 322 CPVT_FloatRect Typeset(
); | 322 CPVT_FloatRect Typeset(
); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 friend class CPDF_VariableText_Iterator; | 402 friend class CPDF_VariableText_Iterator; |
| 403 public: | 403 public: |
| 404 CPDF_VariableText(); | 404 CPDF_VariableText(); |
| 405 virtual ~CPDF_VariableText(); | 405 virtual ~CPDF_VariableText(); |
| 406 IPDF_VariableText_Provider* SetProvider(IPDF_Variabl
eText_Provider * pProvider); | 406 IPDF_VariableText_Provider* SetProvider(IPDF_Variabl
eText_Provider * pProvider); |
| 407 IPDF_VariableText_Iterator* GetIterator(); | 407 IPDF_VariableText_Iterator* GetIterator(); |
| 408 void
SetPlateRect(const CPDF_Rect & rect) | 408 void
SetPlateRect(const CPDF_Rect & rect) |
| 409 { | 409 { |
| 410 CPDF_EditContainer::SetPlateRect(rect); | 410 CPDF_EditContainer::SetPlateRect(rect); |
| 411 } | 411 } |
| 412 void» » » » » » » » »
SetAlignment(FX_INT32 nFormat = 0) | 412 void» » » » » » » » »
SetAlignment(int32_t nFormat = 0) |
| 413 { | 413 { |
| 414 m_nAlignment = nFormat; | 414 m_nAlignment = nFormat; |
| 415 } | 415 } |
| 416 void
SetPasswordChar(FX_WORD wSubWord = '*') | 416 void
SetPasswordChar(FX_WORD wSubWord = '*') |
| 417 { | 417 { |
| 418 m_wSubWord = wSubWord; | 418 m_wSubWord = wSubWord; |
| 419 } | 419 } |
| 420 void» » » » » » » » »
SetLimitChar(FX_INT32 nLimitChar = 0) | 420 void» » » » » » » » »
SetLimitChar(int32_t nLimitChar = 0) |
| 421 { | 421 { |
| 422 m_nLimitChar = nLimitChar; | 422 m_nLimitChar = nLimitChar; |
| 423 } | 423 } |
| 424 void
SetCharSpace(FX_FLOAT fCharSpace = 0.0f) | 424 void
SetCharSpace(FX_FLOAT fCharSpace = 0.0f) |
| 425 { | 425 { |
| 426 m_fCharSpace = fCharSpace; | 426 m_fCharSpace = fCharSpace; |
| 427 } | 427 } |
| 428 void» » » » » » » » »
SetHorzScale(FX_INT32 nHorzScale = 100) | 428 void» » » » » » » » »
SetHorzScale(int32_t nHorzScale = 100) |
| 429 { | 429 { |
| 430 m_nHorzScale = nHorzScale; | 430 m_nHorzScale = nHorzScale; |
| 431 } | 431 } |
| 432 void
SetMultiLine(FX_BOOL bMultiLine = TRUE) | 432 void
SetMultiLine(FX_BOOL bMultiLine = TRUE) |
| 433 { | 433 { |
| 434 m_bMultiLine = bMultiLine; | 434 m_bMultiLine = bMultiLine; |
| 435 } | 435 } |
| 436 void
SetAutoReturn(FX_BOOL bAuto = TRUE) | 436 void
SetAutoReturn(FX_BOOL bAuto = TRUE) |
| 437 { | 437 { |
| 438 m_bLimitWidth = bAuto; | 438 m_bLimitWidth = bAuto; |
| 439 } | 439 } |
| 440 void
SetFontSize(FX_FLOAT fFontSize) | 440 void
SetFontSize(FX_FLOAT fFontSize) |
| 441 { | 441 { |
| 442 m_fFontSize = fFontSize; | 442 m_fFontSize = fFontSize; |
| 443 } | 443 } |
| 444 void» » » » » » » » »
SetCharArray(FX_INT32 nCharArray = 0) | 444 void» » » » » » » » »
SetCharArray(int32_t nCharArray = 0) |
| 445 { | 445 { |
| 446 m_nCharArray = nCharArray; | 446 m_nCharArray = nCharArray; |
| 447 } | 447 } |
| 448 void
SetAutoFontSize(FX_BOOL bAuto = TRUE) | 448 void
SetAutoFontSize(FX_BOOL bAuto = TRUE) |
| 449 { | 449 { |
| 450 m_bAutoFontSize = bAuto; | 450 m_bAutoFontSize = bAuto; |
| 451 } | 451 } |
| 452 void
SetRichText(FX_BOOL bRichText) | 452 void
SetRichText(FX_BOOL bRichText) |
| 453 { | 453 { |
| 454 m_bRichText = bRichText; | 454 m_bRichText = bRichText; |
| 455 } | 455 } |
| 456 void
SetLineLeading(FX_FLOAT fLineLeading) | 456 void
SetLineLeading(FX_FLOAT fLineLeading) |
| 457 { | 457 { |
| 458 m_fLineLeading = fLineLeading; | 458 m_fLineLeading = fLineLeading; |
| 459 } | 459 } |
| 460 void
Initialize(); | 460 void
Initialize(); |
| 461 FX_BOOL
IsValid() const | 461 FX_BOOL
IsValid() const |
| 462 { | 462 { |
| 463 return m_bInitial; | 463 return m_bInitial; |
| 464 } | 464 } |
| 465 FX_BOOL
IsRichText() const | 465 FX_BOOL
IsRichText() const |
| 466 { | 466 { |
| 467 return m_bRichText; | 467 return m_bRichText; |
| 468 } | 468 } |
| 469 void
RearrangeAll(); | 469 void
RearrangeAll(); |
| 470 void
RearrangePart(const CPVT_WordRange & PlaceRange); | 470 void
RearrangePart(const CPVT_WordRange & PlaceRange); |
| 471 void
ResetAll(); | 471 void
ResetAll(); |
| 472 void» » » » » » » » »
SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps =
NULL, | 472 void» » » » » » » » »
SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps =
NULL, |
| 473 const CPVT_WordProps * pWordProps = NULL); | 473 const CPVT_WordProps * pWordProps = NULL); |
| 474 CPVT_WordPlace» » » » » » » InsertWo
rd(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1, | 474 CPVT_WordPlace» » » » » » » InsertWo
rd(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1, |
| 475 const CPVT_WordProps * pWordProps = NULL); | 475 const CPVT_WordProps * pWordProps = NULL); |
| 476 CPVT_WordPlace InsertSe
ction(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, | 476 CPVT_WordPlace InsertSe
ction(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL, |
| 477 const CPVT_WordProps * pWordProps = NULL); | 477 const CPVT_WordProps * pWordProps = NULL); |
| 478 CPVT_WordPlace» » » » » » » InsertTe
xt(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1, | 478 CPVT_WordPlace» » » » » » » InsertTe
xt(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1, |
| 479 const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * p
WordProps = NULL); | 479 const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * p
WordProps = NULL); |
| 480 CPVT_WordPlace DeleteWo
rds(const CPVT_WordRange & PlaceRange); | 480 CPVT_WordPlace DeleteWo
rds(const CPVT_WordRange & PlaceRange); |
| 481 CPVT_WordPlace DeleteWo
rd(const CPVT_WordPlace & place); | 481 CPVT_WordPlace DeleteWo
rd(const CPVT_WordPlace & place); |
| 482 CPVT_WordPlace BackSpac
eWord(const CPVT_WordPlace & place); | 482 CPVT_WordPlace BackSpac
eWord(const CPVT_WordPlace & place); |
| 483 const CPDF_Rect & GetPlateRect() c
onst | 483 const CPDF_Rect & GetPlateRect() c
onst |
| 484 { | 484 { |
| 485 return CPDF_EditContainer::GetPlateRect(); | 485 return CPDF_EditContainer::GetPlateRect(); |
| 486 } | 486 } |
| 487 CPDF_Rect GetConte
ntRect() const; | 487 CPDF_Rect GetConte
ntRect() const; |
| 488 FX_INT32» » » » » » » » GetTotal
Words() const; | 488 int32_t» » » » » » » » GetTotal
Words() const; |
| 489 FX_FLOAT GetFontS
ize() const | 489 FX_FLOAT GetFontS
ize() const |
| 490 { | 490 { |
| 491 return m_fFontSize; | 491 return m_fFontSize; |
| 492 } | 492 } |
| 493 FX_INT32» » » » » » » » GetAlign
ment() const | 493 int32_t» » » » » » » » GetAlign
ment() const |
| 494 { | 494 { |
| 495 return m_nAlignment; | 495 return m_nAlignment; |
| 496 } | 496 } |
| 497 FX_INT32» » » » » » » » GetCharA
rray() const | 497 int32_t» » » » » » » » GetCharA
rray() const |
| 498 { | 498 { |
| 499 return m_nCharArray; | 499 return m_nCharArray; |
| 500 } | 500 } |
| 501 FX_INT32» » » » » » » » GetLimit
Char() const | 501 int32_t» » » » » » » » GetLimit
Char() const |
| 502 { | 502 { |
| 503 return m_nLimitChar; | 503 return m_nLimitChar; |
| 504 } | 504 } |
| 505 FX_BOOL
IsMultiLine() const | 505 FX_BOOL
IsMultiLine() const |
| 506 { | 506 { |
| 507 return m_bMultiLine; | 507 return m_bMultiLine; |
| 508 } | 508 } |
| 509 FX_INT32» » » » » » » » GetHorzS
cale() const | 509 int32_t» » » » » » » » GetHorzS
cale() const |
| 510 { | 510 { |
| 511 return m_nHorzScale; | 511 return m_nHorzScale; |
| 512 } | 512 } |
| 513 FX_FLOAT GetCharS
pace() const | 513 FX_FLOAT GetCharS
pace() const |
| 514 { | 514 { |
| 515 return m_fCharSpace; | 515 return m_fCharSpace; |
| 516 } | 516 } |
| 517 | 517 |
| 518 CPVT_WordPlace GetBegin
WordPlace() const; | 518 CPVT_WordPlace GetBegin
WordPlace() const; |
| 519 CPVT_WordPlace GetEndWo
rdPlace() const; | 519 CPVT_WordPlace GetEndWo
rdPlace() const; |
| 520 CPVT_WordPlace GetPrevW
ordPlace(const CPVT_WordPlace & place) const; | 520 CPVT_WordPlace GetPrevW
ordPlace(const CPVT_WordPlace & place) const; |
| 521 CPVT_WordPlace GetNextW
ordPlace(const CPVT_WordPlace & place) const; | 521 CPVT_WordPlace GetNextW
ordPlace(const CPVT_WordPlace & place) const; |
| 522 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; | 522 CPVT_WordPlace SearchWo
rdPlace(const CPDF_Point & point) const; |
| 523 CPVT_WordPlace GetUpWor
dPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; | 523 CPVT_WordPlace GetUpWor
dPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; |
| 524 CPVT_WordPlace GetDownW
ordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; | 524 CPVT_WordPlace GetDownW
ordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const; |
| 525 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; | 525 CPVT_WordPlace GetLineB
eginPlace(const CPVT_WordPlace & place) const; |
| 526 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; | 526 CPVT_WordPlace GetLineE
ndPlace(const CPVT_WordPlace & place) const; |
| 527 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; | 527 CPVT_WordPlace GetSecti
onBeginPlace(const CPVT_WordPlace & place) const; |
| 528 CPVT_WordPlace GetSecti
onEndPlace(const CPVT_WordPlace & place) const; | 528 CPVT_WordPlace GetSecti
onEndPlace(const CPVT_WordPlace & place) const; |
| 529 void
UpdateWordPlace(CPVT_WordPlace & place) const; | 529 void
UpdateWordPlace(CPVT_WordPlace & place) const; |
| 530 FX_INT32» » » » » » » » WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; | 530 int32_t» » » » » » » » WordPlac
eToWordIndex(const CPVT_WordPlace & place) const; |
| 531 CPVT_WordPlace» » » » » » » WordInde
xToWordPlace(FX_INT32 index) const; | 531 CPVT_WordPlace» » » » » » » WordInde
xToWordPlace(int32_t index) const; |
| 532 FX_WORD
GetPasswordChar() const | 532 FX_WORD
GetPasswordChar() const |
| 533 { | 533 { |
| 534 return GetSubWord(); | 534 return GetSubWord(); |
| 535 } | 535 } |
| 536 FX_WORD
GetSubWord() const | 536 FX_WORD
GetSubWord() const |
| 537 { | 537 { |
| 538 return m_wSubWord; | 538 return m_wSubWord; |
| 539 } | 539 } |
| 540 private: | 540 private: |
| 541 FX_INT32» » » » » » » » GetCharW
idth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle); | 541 int32_t» » » » » » » » GetCharW
idth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, int32_t nWordStyle); |
| 542 FX_INT32» » » » » » » » GetTypeA
scent(FX_INT32 nFontIndex); | 542 int32_t» » » » » » » » GetTypeA
scent(int32_t nFontIndex); |
| 543 FX_INT32» » » » » » » » GetTypeD
escent(FX_INT32 nFontIndex); | 543 int32_t» » » » » » » » GetTypeD
escent(int32_t nFontIndex); |
| 544 FX_INT32» » » » » » » » GetWordF
ontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex); | 544 int32_t» » » » » » » » GetWordF
ontIndex(FX_WORD word, int32_t charset, int32_t nFontIndex); |
| 545 FX_INT32» » » » » » » » GetDefau
ltFontIndex(); | 545 int32_t» » » » » » » » GetDefau
ltFontIndex(); |
| 546 FX_BOOL
IsLatinWord(FX_WORD word); | 546 FX_BOOL
IsLatinWord(FX_WORD word); |
| 547 private: | 547 private: |
| 548 | 548 |
| 549 CPVT_WordPlace AddSecti
on(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo); | 549 CPVT_WordPlace AddSecti
on(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo); |
| 550 CPVT_WordPlace AddLine(
const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo); | 550 CPVT_WordPlace AddLine(
const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo); |
| 551 CPVT_WordPlace AddWord(
const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); | 551 CPVT_WordPlace AddWord(
const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); |
| 552 FX_BOOL
GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); | 552 FX_BOOL
GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo); |
| 553 FX_BOOL
SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); | 553 FX_BOOL
SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo); |
| 554 FX_BOOL
GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); | 554 FX_BOOL
GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo); |
| 555 FX_BOOL
GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); | 555 FX_BOOL
GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo); |
| 556 FX_FLOAT GetWordF
ontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 556 FX_FLOAT GetWordF
ontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
| 557 FX_FLOAT» » » » » » » » GetWordW
idth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, | 557 FX_FLOAT» » » » » » » » GetWordW
idth(int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord, |
| 558 FX_FLOAT fCharSpace, FX_INT32 nHorzScale, | 558 FX_FLOAT fCharSpace, int32_t nHorzScale, |
| 559 FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle); | 559 FX_FLOAT fFontSize, FX_FLOAT fWordTail, int32_t nWordStyle); |
| 560 FX_FLOAT GetWordW
idth(const CPVT_WordInfo & WordInfo); | 560 FX_FLOAT GetWordW
idth(const CPVT_WordInfo & WordInfo); |
| 561 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); | 561 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); |
| 562 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); | 562 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize); |
| 563 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 563 FX_FLOAT GetWordA
scent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
| 564 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); | 564 FX_FLOAT GetWordD
escent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE); |
| 565 FX_FLOAT GetLineA
scent(const CPVT_SectionInfo & SecInfo); | 565 FX_FLOAT GetLineA
scent(const CPVT_SectionInfo & SecInfo); |
| 566 FX_FLOAT GetLineD
escent(const CPVT_SectionInfo & SecInfo); | 566 FX_FLOAT GetLineD
escent(const CPVT_SectionInfo & SecInfo); |
| 567 FX_FLOAT» » » » » » » » GetFontA
scent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); | 567 FX_FLOAT» » » » » » » » GetFontA
scent(int32_t nFontIndex, FX_FLOAT fFontSize); |
| 568 FX_FLOAT» » » » » » » » GetFontD
escent(FX_INT32 nFontIndex, FX_FLOAT fFontSize); | 568 FX_FLOAT» » » » » » » » GetFontD
escent(int32_t nFontIndex, FX_FLOAT fFontSize); |
| 569 FX_INT32» » » » » » » » GetWordF
ontIndex(const CPVT_WordInfo & WordInfo); | 569 int32_t» » » » » » » » GetWordF
ontIndex(const CPVT_WordInfo & WordInfo); |
| 570 FX_FLOAT GetCharS
pace(const CPVT_WordInfo & WordInfo); | 570 FX_FLOAT GetCharS
pace(const CPVT_WordInfo & WordInfo); |
| 571 FX_INT32» » » » » » » » GetHorzS
cale(const CPVT_WordInfo & WordInfo); | 571 int32_t» » » » » » » » GetHorzS
cale(const CPVT_WordInfo & WordInfo); |
| 572 FX_FLOAT GetLineL
eading(const CPVT_SectionInfo & SecInfo); | 572 FX_FLOAT GetLineL
eading(const CPVT_SectionInfo & SecInfo); |
| 573 FX_FLOAT GetLineI
ndent(const CPVT_SectionInfo & SecInfo); | 573 FX_FLOAT GetLineI
ndent(const CPVT_SectionInfo & SecInfo); |
| 574 FX_INT32» » » » » » » » GetAlign
ment(const CPVT_SectionInfo& SecInfo); | 574 int32_t» » » » » » » » GetAlign
ment(const CPVT_SectionInfo& SecInfo); |
| 575 | 575 |
| 576 void
ClearSectionRightWords(const CPVT_WordPlace & place); | 576 void
ClearSectionRightWords(const CPVT_WordPlace & place); |
| 577 CPVT_WordPlace AjustLin
eHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; | 577 CPVT_WordPlace AjustLin
eHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const; |
| 578 FX_BOOL
ClearEmptySection(const CPVT_WordPlace & place); | 578 FX_BOOL
ClearEmptySection(const CPVT_WordPlace & place); |
| 579 void
ClearEmptySections(const CPVT_WordRange & PlaceRange); | 579 void
ClearEmptySections(const CPVT_WordRange & PlaceRange); |
| 580 void
LinkLatterSection(const CPVT_WordPlace & place); | 580 void
LinkLatterSection(const CPVT_WordPlace & place); |
| 581 void
ClearWords(const CPVT_WordRange & PlaceRange); | 581 void
ClearWords(const CPVT_WordRange & PlaceRange); |
| 582 CPVT_WordPlace ClearLef
tWord(const CPVT_WordPlace & place); | 582 CPVT_WordPlace ClearLef
tWord(const CPVT_WordPlace & place); |
| 583 CPVT_WordPlace ClearRig
htWord(const CPVT_WordPlace & place); | 583 CPVT_WordPlace ClearRig
htWord(const CPVT_WordPlace & place); |
| 584 private: | 584 private: |
| 585 CPVT_FloatRect Rearrang
e(const CPVT_WordRange & PlaceRange); | 585 CPVT_FloatRect Rearrang
e(const CPVT_WordRange & PlaceRange); |
| 586 FX_FLOAT GetAutoF
ontSize(); | 586 FX_FLOAT GetAutoF
ontSize(); |
| 587 FX_BOOL
IsBigger(FX_FLOAT fFontSize); | 587 FX_BOOL
IsBigger(FX_FLOAT fFontSize); |
| 588 CPVT_FloatRect Rearrang
eSections(const CPVT_WordRange & PlaceRange); | 588 CPVT_FloatRect Rearrang
eSections(const CPVT_WordRange & PlaceRange); |
| 589 private: | 589 private: |
| 590 void
ResetSectionArray(); | 590 void
ResetSectionArray(); |
| 591 private: | 591 private: |
| 592 CPVT_ArrayTemplate<CSection*> m_SectionArray; | 592 CPVT_ArrayTemplate<CSection*> m_SectionArray; |
| 593 FX_INT32» » » » » » » » m_nLimit
Char; | 593 int32_t» » » » » » » » m_nLimit
Char; |
| 594 FX_INT32» » » » » » » » m_nCharA
rray; | 594 int32_t» » » » » » » » m_nCharA
rray; |
| 595 FX_BOOL
m_bMultiLine; | 595 FX_BOOL
m_bMultiLine; |
| 596 FX_BOOL
m_bLimitWidth; | 596 FX_BOOL
m_bLimitWidth; |
| 597 FX_BOOL
m_bAutoFontSize; | 597 FX_BOOL
m_bAutoFontSize; |
| 598 FX_INT32» » » » » » » » m_nAlign
ment; | 598 int32_t» » » » » » » » m_nAlign
ment; |
| 599 FX_FLOAT m_fLineL
eading; | 599 FX_FLOAT m_fLineL
eading; |
| 600 FX_FLOAT m_fCharS
pace; | 600 FX_FLOAT m_fCharS
pace; |
| 601 FX_INT32» » » » » » » » m_nHorzS
cale; | 601 int32_t» » » » » » » » m_nHorzS
cale; |
| 602 FX_WORD
m_wSubWord; | 602 FX_WORD
m_wSubWord; |
| 603 FX_FLOAT m_fFontS
ize; | 603 FX_FLOAT m_fFontS
ize; |
| 604 | 604 |
| 605 private: | 605 private: |
| 606 FX_BOOL
m_bInitial; | 606 FX_BOOL
m_bInitial; |
| 607 FX_BOOL
m_bRichText; | 607 FX_BOOL
m_bRichText; |
| 608 IPDF_VariableText_Provider * m_pVTProvider; | 608 IPDF_VariableText_Provider * m_pVTProvider; |
| 609 CPDF_VariableText_Iterator * m_pVTIterator; | 609 CPDF_VariableText_Iterator * m_pVTIterator; |
| 610 }; | 610 }; |
| 611 class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator | 611 class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator |
| 612 { | 612 { |
| 613 public: | 613 public: |
| 614 CPDF_VariableText_Iterator(CPDF_VariableText * pVT); | 614 CPDF_VariableText_Iterator(CPDF_VariableText * pVT); |
| 615 virtual ~CPDF_VariableText_Iterator(); | 615 virtual ~CPDF_VariableText_Iterator(); |
| 616 FX_BOOL
NextWord(); | 616 FX_BOOL
NextWord(); |
| 617 FX_BOOL
PrevWord(); | 617 FX_BOOL
PrevWord(); |
| 618 FX_BOOL
NextLine(); | 618 FX_BOOL
NextLine(); |
| 619 FX_BOOL
PrevLine(); | 619 FX_BOOL
PrevLine(); |
| 620 FX_BOOL
NextSection(); | 620 FX_BOOL
NextSection(); |
| 621 FX_BOOL
PrevSection(); | 621 FX_BOOL
PrevSection(); |
| 622 FX_BOOL
SetWord(const CPVT_Word & word); | 622 FX_BOOL
SetWord(const CPVT_Word & word); |
| 623 FX_BOOL
GetWord(CPVT_Word & word) const; | 623 FX_BOOL
GetWord(CPVT_Word & word) const; |
| 624 FX_BOOL
GetLine(CPVT_Line & line) const; | 624 FX_BOOL
GetLine(CPVT_Line & line) const; |
| 625 FX_BOOL
GetSection(CPVT_Section & section) const; | 625 FX_BOOL
GetSection(CPVT_Section & section) const; |
| 626 FX_BOOL
SetSection(const CPVT_Section & section); | 626 FX_BOOL
SetSection(const CPVT_Section & section); |
| 627 void» » » » » » » » »
SetAt(FX_INT32 nWordIndex); | 627 void» » » » » » » » »
SetAt(int32_t nWordIndex); |
| 628 void
SetAt(const CPVT_WordPlace & place); | 628 void
SetAt(const CPVT_WordPlace & place); |
| 629 const CPVT_WordPlace & GetAt() const | 629 const CPVT_WordPlace & GetAt() const |
| 630 { | 630 { |
| 631 return m_CurPos; | 631 return m_CurPos; |
| 632 }; | 632 }; |
| 633 private: | 633 private: |
| 634 CPVT_WordPlace m_CurPos
; | 634 CPVT_WordPlace m_CurPos
; |
| 635 CPDF_VariableText * m_pVT; | 635 CPDF_VariableText * m_pVT; |
| 636 }; | 636 }; |
| 637 | 637 |
| 638 #endif // CORE_SRC_FPDFDOC_PDF_VT_H_ | 638 #endif // CORE_SRC_FPDFDOC_PDF_VT_H_ |
| OLD | NEW |