| 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 XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ | 7 #ifndef XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ |
| 8 #define XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ | 8 #define XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 FX_FLOAT GetLayoutHeight(); | 259 FX_FLOAT GetLayoutHeight(); |
| 260 FX_FLOAT StartLayout(FX_FLOAT fWidth = -1); | 260 FX_FLOAT StartLayout(FX_FLOAT fWidth = -1); |
| 261 FX_BOOL DoLayout(int32_t iBlockIndex, | 261 FX_BOOL DoLayout(int32_t iBlockIndex, |
| 262 FX_FLOAT& fCalcHeight, | 262 FX_FLOAT& fCalcHeight, |
| 263 FX_FLOAT fContentAreaHeight = -1, | 263 FX_FLOAT fContentAreaHeight = -1, |
| 264 FX_FLOAT fTextHeight = -1); | 264 FX_FLOAT fTextHeight = -1); |
| 265 | 265 |
| 266 FX_BOOL CalcSize(const CFX_SizeF& minSize, | 266 FX_BOOL CalcSize(const CFX_SizeF& minSize, |
| 267 const CFX_SizeF& maxSize, | 267 const CFX_SizeF& maxSize, |
| 268 CFX_SizeF& defaultSize); | 268 CFX_SizeF& defaultSize); |
| 269 FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = NULL); | 269 FX_BOOL Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr); |
| 270 void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex); | 270 void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex); |
| 271 FX_BOOL DrawString(CFX_RenderDevice* pFxDevice, | 271 FX_BOOL DrawString(CFX_RenderDevice* pFxDevice, |
| 272 const CFX_Matrix& tmDoc2Device, | 272 const CFX_Matrix& tmDoc2Device, |
| 273 const CFX_RectF& rtClip, | 273 const CFX_RectF& rtClip, |
| 274 int32_t iBlock = 0); | 274 int32_t iBlock = 0); |
| 275 FX_BOOL IsLoaded() const { return m_pieceLines.GetSize() > 0; } | 275 FX_BOOL IsLoaded() const { return m_pieceLines.GetSize() > 0; } |
| 276 void Unload(); | 276 void Unload(); |
| 277 const CXFA_PieceLineArray* GetPieceLines(); | 277 const CXFA_PieceLineArray* GetPieceLines(); |
| 278 | 278 |
| 279 FX_BOOL m_bHasBlock; | 279 FX_BOOL m_bHasBlock; |
| 280 CFX_Int32Array m_Blocks; | 280 CFX_Int32Array m_Blocks; |
| 281 | 281 |
| 282 private: | 282 private: |
| 283 void GetTextDataNode(); | 283 void GetTextDataNode(); |
| 284 CFDE_XMLNode* GetXMLContainerNode(); | 284 CFDE_XMLNode* GetXMLContainerNode(); |
| 285 CFX_RTFBreak* CreateBreak(FX_BOOL bDefault); | 285 CFX_RTFBreak* CreateBreak(FX_BOOL bDefault); |
| 286 void InitBreak(FX_FLOAT fLineWidth); | 286 void InitBreak(FX_FLOAT fLineWidth); |
| 287 void InitBreak(IFDE_CSSComputedStyle* pStyle, | 287 void InitBreak(IFDE_CSSComputedStyle* pStyle, |
| 288 FDE_CSSDISPLAY eDisplay, | 288 FDE_CSSDISPLAY eDisplay, |
| 289 FX_FLOAT fLineWidth, | 289 FX_FLOAT fLineWidth, |
| 290 CFDE_XMLNode* pXMLNode, | 290 CFDE_XMLNode* pXMLNode, |
| 291 IFDE_CSSComputedStyle* pParentStyle = NULL); | 291 IFDE_CSSComputedStyle* pParentStyle = nullptr); |
| 292 FX_BOOL Loader(const CFX_SizeF& szText, | 292 FX_BOOL Loader(const CFX_SizeF& szText, |
| 293 FX_FLOAT& fLinePos, | 293 FX_FLOAT& fLinePos, |
| 294 FX_BOOL bSavePieces = TRUE); | 294 FX_BOOL bSavePieces = TRUE); |
| 295 void LoadText(CXFA_Node* pNode, | 295 void LoadText(CXFA_Node* pNode, |
| 296 const CFX_SizeF& szText, | 296 const CFX_SizeF& szText, |
| 297 FX_FLOAT& fLinePos, | 297 FX_FLOAT& fLinePos, |
| 298 FX_BOOL bSavePieces); | 298 FX_BOOL bSavePieces); |
| 299 FX_BOOL LoadRichText(CFDE_XMLNode* pXMLNode, | 299 FX_BOOL LoadRichText(CFDE_XMLNode* pXMLNode, |
| 300 const CFX_SizeF& szText, | 300 const CFX_SizeF& szText, |
| 301 FX_FLOAT& fLinePos, | 301 FX_FLOAT& fLinePos, |
| 302 IFDE_CSSComputedStyle* pParentStyle, | 302 IFDE_CSSComputedStyle* pParentStyle, |
| 303 FX_BOOL bSavePieces, | 303 FX_BOOL bSavePieces, |
| 304 CXFA_LinkUserData* pLinkData = NULL, | 304 CXFA_LinkUserData* pLinkData = nullptr, |
| 305 FX_BOOL bEndBreak = TRUE, | 305 FX_BOOL bEndBreak = TRUE, |
| 306 FX_BOOL bIsOl = FALSE, | 306 FX_BOOL bIsOl = FALSE, |
| 307 int32_t iLiCount = 0); | 307 int32_t iLiCount = 0); |
| 308 FX_BOOL AppendChar(const CFX_WideString& wsText, | 308 FX_BOOL AppendChar(const CFX_WideString& wsText, |
| 309 FX_FLOAT& fLinePos, | 309 FX_FLOAT& fLinePos, |
| 310 FX_FLOAT fSpaceAbove, | 310 FX_FLOAT fSpaceAbove, |
| 311 FX_BOOL bSavePieces); | 311 FX_BOOL bSavePieces); |
| 312 void AppendTextLine(uint32_t dwStatus, | 312 void AppendTextLine(uint32_t dwStatus, |
| 313 FX_FLOAT& fLinePos, | 313 FX_FLOAT& fLinePos, |
| 314 FX_BOOL bSavePieces, | 314 FX_BOOL bSavePieces, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 345 std::unique_ptr<CXFA_LoaderContext> m_pLoader; | 345 std::unique_ptr<CXFA_LoaderContext> m_pLoader; |
| 346 int32_t m_iLines; | 346 int32_t m_iLines; |
| 347 FX_FLOAT m_fMaxWidth; | 347 FX_FLOAT m_fMaxWidth; |
| 348 CXFA_TextParser m_textParser; | 348 CXFA_TextParser m_textParser; |
| 349 CXFA_PieceLineArray m_pieceLines; | 349 CXFA_PieceLineArray m_pieceLines; |
| 350 std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext; | 350 std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext; |
| 351 FX_BOOL m_bBlockContinue; | 351 FX_BOOL m_bBlockContinue; |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 #endif // XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ | 354 #endif // XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ |
| OLD | NEW |