summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_barcode.h
blob: b309780f3743c86ade6380b231c2c8da2c91de3c (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2014 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 XFA_FWL_CORE_CFWL_BARCODE_H_
#define XFA_FWL_CORE_CFWL_BARCODE_H_

#include "xfa/fwl/core/cfwl_edit.h"
#include "xfa/fwl/core/fwl_error.h"
#include "xfa/fwl/core/ifwl_barcode.h"

class CFWL_Barcode : public CFWL_Edit, public IFWL_BarcodeDP {
 public:
  explicit CFWL_Barcode(const IFWL_App* pApp);
  ~CFWL_Barcode() override;

  void Initialize();

  // IFWL_DataProvider
  void GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override;

  // IFWL_BarcodeDP
  BC_CHAR_ENCODING GetCharEncoding() const override;
  int32_t GetModuleHeight() const override;
  int32_t GetModuleWidth() const override;
  int32_t GetDataLength() const override;
  bool GetCalChecksum() const override;
  bool GetPrintChecksum() const override;
  BC_TEXT_LOC GetTextLocation() const override;
  int32_t GetWideNarrowRatio() const override;
  FX_CHAR GetStartChar() const override;
  FX_CHAR GetEndChar() const override;
  int32_t GetVersion() const override;
  int32_t GetErrorCorrectionLevel() const override;
  bool GetTruncated() const override;
  uint32_t GetBarcodeAttributeMask() const override;

  void SetType(BC_TYPE type);
  bool IsProtectedType();

  void SetCharEncoding(BC_CHAR_ENCODING encoding);
  void SetModuleHeight(int32_t height);
  void SetModuleWidth(int32_t width);
  void SetDataLength(int32_t dataLength);
  void SetCalChecksum(bool calChecksum);
  void SetPrintChecksum(bool printChecksum);
  void SetTextLocation(BC_TEXT_LOC location);
  void SetWideNarrowRatio(int32_t ratio);
  void SetStartChar(FX_CHAR startChar);
  void SetEndChar(FX_CHAR endChar);
  void SetErrorCorrectionLevel(int32_t ecLevel);
  void SetTruncated(bool truncated);

 private:
  BC_CHAR_ENCODING m_eCharEncoding;
  int32_t m_nModuleHeight;
  int32_t m_nModuleWidth;
  int32_t m_nDataLength;
  bool m_bCalChecksum;
  bool m_bPrintChecksum;
  BC_TEXT_LOC m_eTextLocation;
  int32_t m_nWideNarrowRatio;
  FX_CHAR m_cStartChar;
  FX_CHAR m_cEndChar;
  int32_t m_nECLevel;
  bool m_bTruncated;
  uint32_t m_dwAttributeMask;
};

#endif  // XFA_FWL_CORE_CFWL_BARCODE_H_