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_AP_H_ | 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ |
8 #define CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ | 8 #define CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ |
9 | 9 |
10 #include "core/include/fpdfdoc/fpdf_vt.h" | 10 #include "core/include/fpdfdoc/fpdf_vt.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 FX_FLOAT fColor4; | 46 FX_FLOAT fColor4; |
47 }; | 47 }; |
48 | 48 |
49 class CPVT_Provider : public IPDF_VariableText_Provider { | 49 class CPVT_Provider : public IPDF_VariableText_Provider { |
50 public: | 50 public: |
51 CPVT_Provider(IPVT_FontMap* pFontMap); | 51 CPVT_Provider(IPVT_FontMap* pFontMap); |
52 ~CPVT_Provider() override; | 52 ~CPVT_Provider() override; |
53 | 53 |
54 // IPDF_VariableText_Provider | 54 // IPDF_VariableText_Provider |
55 int32_t GetCharWidth(int32_t nFontIndex, | 55 int32_t GetCharWidth(int32_t nFontIndex, |
56 FX_WORD word, | 56 uint16_t word, |
57 int32_t nWordStyle) override; | 57 int32_t nWordStyle) override; |
58 int32_t GetTypeAscent(int32_t nFontIndex) override; | 58 int32_t GetTypeAscent(int32_t nFontIndex) override; |
59 int32_t GetTypeDescent(int32_t nFontIndex) override; | 59 int32_t GetTypeDescent(int32_t nFontIndex) override; |
60 int32_t GetWordFontIndex(FX_WORD word, | 60 int32_t GetWordFontIndex(uint16_t word, |
61 int32_t charset, | 61 int32_t charset, |
62 int32_t nFontIndex) override; | 62 int32_t nFontIndex) override; |
63 FX_BOOL IsLatinWord(FX_WORD word) override; | 63 FX_BOOL IsLatinWord(uint16_t word) override; |
64 int32_t GetDefaultFontIndex() override; | 64 int32_t GetDefaultFontIndex() override; |
65 | 65 |
66 private: | 66 private: |
67 IPVT_FontMap* m_pFontMap; | 67 IPVT_FontMap* m_pFontMap; |
68 }; | 68 }; |
69 | 69 |
70 class CPVT_GenerateAP { | 70 class CPVT_GenerateAP { |
71 public: | 71 public: |
72 static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, | 72 static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, |
73 CPDF_Dictionary* pAnnotDict); | 73 CPDF_Dictionary* pAnnotDict); |
74 | 74 |
75 static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, | 75 static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, |
76 CPDF_Dictionary* pAnnotDict); | 76 CPDF_Dictionary* pAnnotDict); |
77 | 77 |
78 static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, | 78 static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, |
79 CPDF_Dictionary* pAnnotDict); | 79 CPDF_Dictionary* pAnnotDict); |
80 | 80 |
81 static CFX_ByteString GenerateEditAP(IPVT_FontMap* pFontMap, | 81 static CFX_ByteString GenerateEditAP(IPVT_FontMap* pFontMap, |
82 IPDF_VariableText_Iterator* pIterator, | 82 IPDF_VariableText_Iterator* pIterator, |
83 const CFX_FloatPoint& ptOffset, | 83 const CFX_FloatPoint& ptOffset, |
84 FX_BOOL bContinuous, | 84 FX_BOOL bContinuous, |
85 FX_WORD SubWord = 0, | 85 uint16_t SubWord = 0, |
86 const CPVT_WordRange* pVisible = NULL); | 86 const CPVT_WordRange* pVisible = NULL); |
87 | 87 |
88 static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect, | 88 static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect, |
89 FX_FLOAT fWidth, | 89 FX_FLOAT fWidth, |
90 const CPVT_Color& color, | 90 const CPVT_Color& color, |
91 const CPVT_Color& crLeftTop, | 91 const CPVT_Color& crLeftTop, |
92 const CPVT_Color& crRightBottom, | 92 const CPVT_Color& crRightBottom, |
93 int32_t nStyle, | 93 int32_t nStyle, |
94 const CPVT_Dash& dash); | 94 const CPVT_Dash& dash); |
95 | 95 |
96 static CFX_ByteString GenerateColorAP(const CPVT_Color& color, | 96 static CFX_ByteString GenerateColorAP(const CPVT_Color& color, |
97 const FX_BOOL& bFillOrStroke); | 97 const FX_BOOL& bFillOrStroke); |
98 }; | 98 }; |
99 | 99 |
100 #endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ | 100 #endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ |
OLD | NEW |