• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/fx_string.h"
13 #include "core/fxcrt/retain_ptr.h"
14 #include "core/fxcrt/unowned_ptr.h"
15 #include "xfa/fgas/layout/cfx_char.h"
16 
17 class CFX_TextUserData;
18 
19 class CFX_BreakPiece {
20  public:
21   CFX_BreakPiece();
22   CFX_BreakPiece(const CFX_BreakPiece& other);
23   ~CFX_BreakPiece();
24 
25   int32_t GetEndPos() const;
GetLength()26   int32_t GetLength() const { return m_iChars; }
27 
28   CFX_Char* GetChar(int32_t index) const;
29   WideString GetString() const;
30   std::vector<int32_t> GetWidths() const;
31 
32   CFX_BreakType m_dwStatus;
33   int32_t m_iStartPos;
34   int32_t m_iWidth;
35   int32_t m_iStartChar;
36   int32_t m_iChars;
37   int32_t m_iBidiLevel;
38   int32_t m_iBidiPos;
39   int32_t m_iFontSize;
40   int32_t m_iHorizontalScale;
41   int32_t m_iVerticalScale;
42   uint32_t m_dwIdentity;
43   uint32_t m_dwCharStyles;
44   UnownedPtr<std::vector<CFX_Char>> m_pChars;
45   RetainPtr<CFX_TextUserData> m_pUserData;
46 };
47 
48 #endif  // XFA_FGAS_LAYOUT_CFX_BREAKPIECE_H_
49