Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: core/fpdfdoc/include/cpdf_variabletext.h

Issue 2146993002: Remove default params in CPDF_VariableText. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@ifx_cleanup_3
Patch Set: Fix calls to GetFont{Ascent|Descent} Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/ctypeset.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 10 #include <memory>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ~CPDF_VariableText() override; 85 ~CPDF_VariableText() override;
86 86
87 void SetProvider(CPDF_VariableText::Provider* pProvider); 87 void SetProvider(CPDF_VariableText::Provider* pProvider);
88 CPDF_VariableText::Iterator* GetIterator(); 88 CPDF_VariableText::Iterator* GetIterator();
89 89
90 // CPDF_EditContainer. 90 // CPDF_EditContainer.
91 void SetPlateRect(const CFX_FloatRect& rect) override; 91 void SetPlateRect(const CFX_FloatRect& rect) override;
92 CFX_FloatRect GetContentRect() const override; 92 CFX_FloatRect GetContentRect() const override;
93 const CFX_FloatRect& GetPlateRect() const override; 93 const CFX_FloatRect& GetPlateRect() const override;
94 94
95 void SetAlignment(int32_t nFormat = 0) { m_nAlignment = nFormat; } 95 void SetAlignment(int32_t nFormat) { m_nAlignment = nFormat; }
96 void SetPasswordChar(uint16_t wSubWord = '*') { m_wSubWord = wSubWord; } 96 void SetPasswordChar(uint16_t wSubWord) { m_wSubWord = wSubWord; }
97 void SetLimitChar(int32_t nLimitChar = 0) { m_nLimitChar = nLimitChar; } 97 void SetLimitChar(int32_t nLimitChar) { m_nLimitChar = nLimitChar; }
98 void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) { m_fCharSpace = fCharSpace; } 98 void SetCharSpace(FX_FLOAT fCharSpace) { m_fCharSpace = fCharSpace; }
99 void SetMultiLine(FX_BOOL bMultiLine = TRUE) { m_bMultiLine = bMultiLine; } 99 void SetMultiLine(FX_BOOL bMultiLine) { m_bMultiLine = bMultiLine; }
100 void SetAutoReturn(FX_BOOL bAuto = TRUE) { m_bLimitWidth = bAuto; } 100 void SetAutoReturn(FX_BOOL bAuto) { m_bLimitWidth = bAuto; }
101 void SetFontSize(FX_FLOAT fFontSize) { m_fFontSize = fFontSize; } 101 void SetFontSize(FX_FLOAT fFontSize) { m_fFontSize = fFontSize; }
102 void SetCharArray(int32_t nCharArray = 0) { m_nCharArray = nCharArray; } 102 void SetCharArray(int32_t nCharArray) { m_nCharArray = nCharArray; }
103 void SetAutoFontSize(FX_BOOL bAuto = TRUE) { m_bAutoFontSize = bAuto; } 103 void SetAutoFontSize(FX_BOOL bAuto) { m_bAutoFontSize = bAuto; }
104 void Initialize(); 104 void Initialize();
105 105
106 FX_BOOL IsValid() const { return m_bInitial; } 106 FX_BOOL IsValid() const { return m_bInitial; }
107 107
108 void RearrangeAll(); 108 void RearrangeAll();
109 void RearrangePart(const CPVT_WordRange& PlaceRange); 109 void RearrangePart(const CPVT_WordRange& PlaceRange);
110 void ResetAll(); 110 void ResetAll();
111 void SetText(const FX_WCHAR* text, 111 void SetText(const FX_WCHAR* text);
112 int32_t charset = FXFONT_DEFAULT_CHARSET,
113 const CPVT_SecProps* pSecProps = nullptr,
114 const CPVT_WordProps* pWordProps = nullptr);
115 CPVT_WordPlace InsertWord(const CPVT_WordPlace& place, 112 CPVT_WordPlace InsertWord(const CPVT_WordPlace& place,
116 uint16_t word, 113 uint16_t word,
117 int32_t charset = FXFONT_DEFAULT_CHARSET, 114 int32_t charset,
118 const CPVT_WordProps* pWordProps = nullptr); 115 const CPVT_WordProps* pWordProps);
119 CPVT_WordPlace InsertSection(const CPVT_WordPlace& place, 116 CPVT_WordPlace InsertSection(const CPVT_WordPlace& place,
120 const CPVT_SecProps* pSecProps = nullptr, 117 const CPVT_SecProps* pSecProps,
121 const CPVT_WordProps* pWordProps = nullptr); 118 const CPVT_WordProps* pWordProps);
122 CPVT_WordPlace InsertText(const CPVT_WordPlace& place, 119 CPVT_WordPlace InsertText(const CPVT_WordPlace& place, const FX_WCHAR* text);
123 const FX_WCHAR* text,
124 int32_t charset = FXFONT_DEFAULT_CHARSET,
125 const CPVT_SecProps* pSecProps = nullptr,
126 const CPVT_WordProps* pWordProps = nullptr);
127 CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange); 120 CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange);
128 CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place); 121 CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place);
129 CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place); 122 CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place);
130 123
131 int32_t GetTotalWords() const; 124 int32_t GetTotalWords() const;
132 FX_FLOAT GetFontSize() const { return m_fFontSize; } 125 FX_FLOAT GetFontSize() const { return m_fFontSize; }
133 int32_t GetAlignment() const { return m_nAlignment; } 126 int32_t GetAlignment() const { return m_nAlignment; }
134 uint16_t GetPasswordChar() const { return GetSubWord(); } 127 uint16_t GetPasswordChar() const { return GetSubWord(); }
135 int32_t GetCharArray() const { return m_nCharArray; } 128 int32_t GetCharArray() const { return m_nCharArray; }
136 int32_t GetLimitChar() const { return m_nLimitChar; } 129 int32_t GetLimitChar() const { return m_nLimitChar; }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 CPVT_WordPlace AddLine(const CPVT_WordPlace& place, 170 CPVT_WordPlace AddLine(const CPVT_WordPlace& place,
178 const CPVT_LineInfo& lineinfo); 171 const CPVT_LineInfo& lineinfo);
179 CPVT_WordPlace AddWord(const CPVT_WordPlace& place, 172 CPVT_WordPlace AddWord(const CPVT_WordPlace& place,
180 const CPVT_WordInfo& wordinfo); 173 const CPVT_WordInfo& wordinfo);
181 FX_BOOL GetWordInfo(const CPVT_WordPlace& place, CPVT_WordInfo& wordinfo); 174 FX_BOOL GetWordInfo(const CPVT_WordPlace& place, CPVT_WordInfo& wordinfo);
182 FX_BOOL SetWordInfo(const CPVT_WordPlace& place, 175 FX_BOOL SetWordInfo(const CPVT_WordPlace& place,
183 const CPVT_WordInfo& wordinfo); 176 const CPVT_WordInfo& wordinfo);
184 FX_BOOL GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo); 177 FX_BOOL GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo);
185 FX_BOOL GetSectionInfo(const CPVT_WordPlace& place, 178 FX_BOOL GetSectionInfo(const CPVT_WordPlace& place,
186 CPVT_SectionInfo& secinfo); 179 CPVT_SectionInfo& secinfo);
187 FX_FLOAT GetWordFontSize(const CPVT_WordInfo& WordInfo, 180 FX_FLOAT GetWordFontSize(const CPVT_WordInfo& WordInfo);
188 FX_BOOL bFactFontSize = FALSE);
189 FX_FLOAT GetWordWidth(int32_t nFontIndex, 181 FX_FLOAT GetWordWidth(int32_t nFontIndex,
190 uint16_t Word, 182 uint16_t Word,
191 uint16_t SubWord, 183 uint16_t SubWord,
192 FX_FLOAT fCharSpace, 184 FX_FLOAT fCharSpace,
193 int32_t nHorzScale, 185 int32_t nHorzScale,
194 FX_FLOAT fFontSize, 186 FX_FLOAT fFontSize,
195 FX_FLOAT fWordTail, 187 FX_FLOAT fWordTail,
196 int32_t nWordStyle); 188 int32_t nWordStyle);
197 FX_FLOAT GetWordWidth(const CPVT_WordInfo& WordInfo); 189 FX_FLOAT GetWordWidth(const CPVT_WordInfo& WordInfo);
198 FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); 190 FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize);
199 FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); 191 FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize);
200 FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, 192 FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo);
201 FX_BOOL bFactFontSize = FALSE); 193 FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo);
202 FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo,
203 FX_BOOL bFactFontSize = FALSE);
204 FX_FLOAT GetLineAscent(const CPVT_SectionInfo& SecInfo); 194 FX_FLOAT GetLineAscent(const CPVT_SectionInfo& SecInfo);
205 FX_FLOAT GetLineDescent(const CPVT_SectionInfo& SecInfo); 195 FX_FLOAT GetLineDescent(const CPVT_SectionInfo& SecInfo);
206 FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); 196 FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize);
207 FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize); 197 FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize);
208 int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo); 198 int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo);
209 FX_FLOAT GetCharSpace(const CPVT_WordInfo& WordInfo); 199 FX_FLOAT GetCharSpace(const CPVT_WordInfo& WordInfo);
210 int32_t GetHorzScale(const CPVT_WordInfo& WordInfo); 200 int32_t GetHorzScale(const CPVT_WordInfo& WordInfo);
211 FX_FLOAT GetLineLeading(const CPVT_SectionInfo& SecInfo); 201 FX_FLOAT GetLineLeading(const CPVT_SectionInfo& SecInfo);
212 FX_FLOAT GetLineIndent(const CPVT_SectionInfo& SecInfo); 202 FX_FLOAT GetLineIndent(const CPVT_SectionInfo& SecInfo);
213 int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); 203 int32_t GetAlignment(const CPVT_SectionInfo& SecInfo);
(...skipping 25 matching lines...) Expand all
239 FX_FLOAT m_fCharSpace; 229 FX_FLOAT m_fCharSpace;
240 int32_t m_nHorzScale; 230 int32_t m_nHorzScale;
241 uint16_t m_wSubWord; 231 uint16_t m_wSubWord;
242 FX_FLOAT m_fFontSize; 232 FX_FLOAT m_fFontSize;
243 FX_BOOL m_bInitial; 233 FX_BOOL m_bInitial;
244 CPDF_VariableText::Provider* m_pVTProvider; 234 CPDF_VariableText::Provider* m_pVTProvider;
245 std::unique_ptr<CPDF_VariableText::Iterator> m_pVTIterator; 235 std::unique_ptr<CPDF_VariableText::Iterator> m_pVTIterator;
246 }; 236 };
247 237
248 #endif // CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_ 238 #endif // CORE_FPDFDOC_INCLUDE_CPDF_VARIABLETEXT_H_
OLDNEW
« no previous file with comments | « core/fpdfdoc/ctypeset.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698