OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ | 7 #ifndef CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ |
8 #define CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ | 8 #define CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ |
9 | 9 |
10 #include "core/fpdfdoc/cpvt_floatrect.h" | 10 #include "core/fpdfdoc/cpvt_floatrect.h" |
11 #include "core/fpdfdoc/cpvt_lineinfo.h" | 11 #include "core/fpdfdoc/cpvt_lineinfo.h" |
12 #include "core/fpdfdoc/doc_vt.h" | |
13 #include "core/fpdfdoc/include/cpvt_line.h" | 12 #include "core/fpdfdoc/include/cpvt_line.h" |
14 #include "core/fpdfdoc/include/cpvt_wordplace.h" | 13 #include "core/fpdfdoc/include/cpvt_wordplace.h" |
15 #include "core/fpdfdoc/include/cpvt_wordrange.h" | 14 #include "core/fpdfdoc/include/cpvt_wordrange.h" |
| 15 #include "core/fpdfdoc/pdf_vt.h" |
16 #include "core/fxcrt/include/fx_coordinates.h" | 16 #include "core/fxcrt/include/fx_coordinates.h" |
17 #include "core/fxcrt/include/fx_string.h" | 17 #include "core/fxcrt/include/fx_string.h" |
18 #include "core/fxcrt/include/fx_system.h" | 18 #include "core/fxcrt/include/fx_system.h" |
19 | 19 |
20 class CSection; | 20 class CSection; |
21 class IPVT_FontMap; | 21 class IPVT_FontMap; |
22 | 22 |
23 struct CPVT_SecProps; | 23 struct CPVT_SecProps; |
24 struct CPVT_Section; | 24 struct CPVT_Section; |
25 struct CPVT_SectionInfo; | 25 struct CPVT_SectionInfo; |
(...skipping 27 matching lines...) Expand all Loading... |
53 void SetAt(const CPVT_WordPlace& place); | 53 void SetAt(const CPVT_WordPlace& place); |
54 const CPVT_WordPlace& GetAt() const { return m_CurPos; } | 54 const CPVT_WordPlace& GetAt() const { return m_CurPos; } |
55 | 55 |
56 private: | 56 private: |
57 CPVT_WordPlace m_CurPos; | 57 CPVT_WordPlace m_CurPos; |
58 CPDF_VariableText* const m_pVT; | 58 CPDF_VariableText* const m_pVT; |
59 }; | 59 }; |
60 | 60 |
61 class Provider { | 61 class Provider { |
62 public: | 62 public: |
63 explicit Provider(IPVT_FontMap* pFontMap); | 63 Provider(IPVT_FontMap* pFontMap); |
64 virtual ~Provider(); | 64 virtual ~Provider(); |
65 | 65 |
66 virtual int32_t GetCharWidth(int32_t nFontIndex, | 66 virtual int32_t GetCharWidth(int32_t nFontIndex, |
67 uint16_t word, | 67 uint16_t word, |
68 int32_t nWordStyle); | 68 int32_t nWordStyle); |
69 virtual int32_t GetTypeAscent(int32_t nFontIndex); | 69 virtual int32_t GetTypeAscent(int32_t nFontIndex); |
70 virtual int32_t GetTypeDescent(int32_t nFontIndex); | 70 virtual int32_t GetTypeDescent(int32_t nFontIndex); |
71 virtual int32_t GetWordFontIndex(uint16_t word, | 71 virtual int32_t GetWordFontIndex(uint16_t word, |
72 int32_t charset, | 72 int32_t charset, |
73 int32_t nFontIndex); | 73 int32_t nFontIndex); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 FX_BOOL ClearEmptySection(const CPVT_WordPlace& place); | 221 FX_BOOL ClearEmptySection(const CPVT_WordPlace& place); |
222 void ClearEmptySections(const CPVT_WordRange& PlaceRange); | 222 void ClearEmptySections(const CPVT_WordRange& PlaceRange); |
223 void LinkLatterSection(const CPVT_WordPlace& place); | 223 void LinkLatterSection(const CPVT_WordPlace& place); |
224 void ClearWords(const CPVT_WordRange& PlaceRange); | 224 void ClearWords(const CPVT_WordRange& PlaceRange); |
225 CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace& place); | 225 CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace& place); |
226 CPVT_WordPlace ClearRightWord(const CPVT_WordPlace& place); | 226 CPVT_WordPlace ClearRightWord(const CPVT_WordPlace& place); |
227 | 227 |
228 CPVT_FloatRect Rearrange(const CPVT_WordRange& PlaceRange); | 228 CPVT_FloatRect Rearrange(const CPVT_WordRange& PlaceRange); |
229 FX_FLOAT GetAutoFontSize(); | 229 FX_FLOAT GetAutoFontSize(); |
230 bool IsBigger(FX_FLOAT fFontSize) const; | 230 FX_BOOL IsBigger(FX_FLOAT fFontSize); |
231 CPVT_FloatRect RearrangeSections(const CPVT_WordRange& PlaceRange); | 231 CPVT_FloatRect RearrangeSections(const CPVT_WordRange& PlaceRange); |
232 | 232 |
233 void ResetSectionArray(); | 233 void ResetSectionArray(); |
234 | 234 |
235 CFX_ArrayTemplate<CSection*> m_SectionArray; | 235 CPVT_ArrayTemplate<CSection*> m_SectionArray; |
236 int32_t m_nLimitChar; | 236 int32_t m_nLimitChar; |
237 int32_t m_nCharArray; | 237 int32_t m_nCharArray; |
238 FX_BOOL m_bMultiLine; | 238 FX_BOOL m_bMultiLine; |
239 FX_BOOL m_bLimitWidth; | 239 FX_BOOL m_bLimitWidth; |
240 FX_BOOL m_bAutoFontSize; | 240 FX_BOOL m_bAutoFontSize; |
241 int32_t m_nAlignment; | 241 int32_t m_nAlignment; |
242 FX_FLOAT m_fLineLeading; | 242 FX_FLOAT m_fLineLeading; |
243 FX_FLOAT m_fCharSpace; | 243 FX_FLOAT m_fCharSpace; |
244 int32_t m_nHorzScale; | 244 int32_t m_nHorzScale; |
245 uint16_t m_wSubWord; | 245 uint16_t m_wSubWord; |
246 FX_FLOAT m_fFontSize; | 246 FX_FLOAT m_fFontSize; |
247 FX_BOOL m_bInitial; | 247 FX_BOOL m_bInitial; |
248 FX_BOOL m_bRichText; | 248 FX_BOOL m_bRichText; |
249 CPDF_VariableText::Provider* m_pVTProvider; | 249 CPDF_VariableText::Provider* m_pVTProvider; |
250 CPDF_VariableText::Iterator* m_pVTIterator; | 250 CPDF_VariableText::Iterator* m_pVTIterator; |
251 }; | 251 }; |
252 | 252 |
253 #endif // CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ | 253 #endif // CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ |
OLD | NEW |