• 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 CORE_FXCRT_CFX_CHAR_H_
8 #define CORE_FXCRT_CFX_CHAR_H_
9 
10 #include <stdint.h>
11 
12 #include "core/fxcrt/fx_unicode.h"
13 
14 enum class CFX_BreakType { None = 0, Piece, Line, Paragraph, Page };
15 
16 class CFX_Char {
17  public:
18   CFX_Char(uint16_t wCharCode, uint32_t dwCharProps);
19   CFX_Char(uint16_t wCharCode,
20            uint32_t dwCharProps,
21            int32_t iHorizontalScale,
22            int32_t iVerticalScale);
23   CFX_Char(const CFX_Char& other);
24   ~CFX_Char();
25 
26   FX_CHARTYPE GetCharType() const;
27 
char_code()28   uint16_t char_code() const { return m_wCharCode; }
char_props()29   uint32_t char_props() const { return m_dwCharProps; }
horizonal_scale()30   int16_t horizonal_scale() const { return m_iHorizontalScale; }
vertical_scale()31   int16_t vertical_scale() const { return m_iVerticalScale; }
32 
33   CFX_BreakType m_dwStatus;
34   uint8_t m_nBreakType;
35   uint32_t m_dwCharStyles;
36   int32_t m_iCharWidth;
37   int16_t m_iBidiClass;
38   int16_t m_iBidiLevel;
39   int16_t m_iBidiPos;
40   int16_t m_iBidiOrder;
41   int32_t m_iFontSize;
42   uint32_t m_dwIdentity;
43   RetainPtr<Retainable> m_pUserData;
44 
45  private:
46   uint16_t m_wCharCode;
47   uint32_t m_dwCharProps;
48   int32_t m_iHorizontalScale;
49   int32_t m_iVerticalScale;
50 };
51 
52 #endif  // CORE_FXCRT_CFX_CHAR_H_
53