1 // Copyright 2017 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_ 8 #define XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_ 9 10 #include <vector> 11 12 #include "core/fxcrt/cfx_char.h" 13 #include "core/fxcrt/fx_string.h" 14 #include "core/fxcrt/retain_ptr.h" 15 #include "core/fxcrt/unowned_ptr.h" 16 #include "xfa/fxfa/cxfa_textuserdata.h" 17 18 class CFX_BreakPiece { 19 public: 20 CFX_BreakPiece(); 21 CFX_BreakPiece(const CFX_BreakPiece& other); 22 ~CFX_BreakPiece(); 23 24 int32_t GetEndPos() const; GetLength()25 int32_t GetLength() const { return m_iChars; } 26 27 CFX_Char* GetChar(int32_t index) const; 28 WideString GetString() const; 29 std::vector<int32_t> GetWidths() const; 30 31 CFX_BreakType m_dwStatus; 32 int32_t m_iStartPos; 33 int32_t m_iWidth; 34 int32_t m_iStartChar; 35 int32_t m_iChars; 36 int32_t m_iBidiLevel; 37 int32_t m_iBidiPos; 38 int32_t m_iFontSize; 39 int32_t m_iHorizontalScale; 40 int32_t m_iVerticalScale; 41 uint32_t m_dwIdentity; 42 uint32_t m_dwCharStyles; 43 UnownedPtr<std::vector<CFX_Char>> m_pChars; 44 RetainPtr<CXFA_TextUserData> m_pUserData; 45 }; 46 47 #endif // XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_ 48