xref: /aosp_15_r20/external/pdfium/xfa/fxfa/cxfa_texttabstopscontext.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 The PDFium Authors
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_FXFA_CXFA_TEXTTABSTOPSCONTEXT_H_
8 #define XFA_FXFA_CXFA_TEXTTABSTOPSCONTEXT_H_
9 
10 #include <stdint.h>
11 
12 #include <vector>
13 
14 struct XFA_TABSTOPS {
15   uint32_t dwAlign;
16   float fTabstops;
17 
18   bool operator<(const XFA_TABSTOPS& that) const {
19     return fTabstops < that.fTabstops;
20   }
21 };
22 
23 class CXFA_TextTabstopsContext {
24  public:
25   CXFA_TextTabstopsContext();
26   ~CXFA_TextTabstopsContext();
27 
28   void Append(uint32_t dwAlign, float fTabstops);
29   void RemoveAll();
30   void Reset();
31 
32   int32_t m_iTabIndex = -1;
33   bool m_bHasTabstops = false;
34   float m_fTabWidth = 0.0f;
35   float m_fLeft = 0.0f;
36   std::vector<XFA_TABSTOPS> m_tabstops;
37 };
38 
39 #endif  // XFA_FXFA_CXFA_TEXTTABSTOPSCONTEXT_H_
40