summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_char.h
blob: fb625ee038f9c141d278c5db86eee506ffd6e6be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2017 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef CORE_FXCRT_CFX_CHAR_H_
#define CORE_FXCRT_CFX_CHAR_H_

#include <stdint.h>

#include "core/fxcrt/fx_unicode.h"

enum class CFX_BreakType { None = 0, Piece, Line, Paragraph, Page };

class CFX_Char {
 public:
  CFX_Char(uint16_t wCharCode, uint32_t dwCharProps);
  CFX_Char(uint16_t wCharCode,
           uint32_t dwCharProps,
           int32_t iHorizontalScale,
           int32_t iVerticalScale);
  CFX_Char(const CFX_Char& other);
  ~CFX_Char();

  FX_CHARTYPE GetCharType() const;

  uint16_t char_code() const { return m_wCharCode; }
  uint32_t char_props() const { return m_dwCharProps; }
  int16_t horizonal_scale() const { return m_iHorizontalScale; }
  int16_t vertical_scale() const { return m_iVerticalScale; }

  CFX_BreakType m_dwStatus;
  uint8_t m_nBreakType;
  uint32_t m_dwCharStyles;
  int32_t m_iCharWidth;
  int16_t m_iBidiClass;
  int16_t m_iBidiLevel;
  int16_t m_iBidiPos;
  int16_t m_iBidiOrder;
  int32_t m_iFontSize;
  uint32_t m_dwIdentity;
  RetainPtr<Retainable> m_pUserData;

 private:
  uint16_t m_wCharCode;
  uint32_t m_dwCharProps;
  int32_t m_iHorizontalScale;
  int32_t m_iVerticalScale;
};

#endif  // CORE_FXCRT_CFX_CHAR_H_