blob: 83cb23437f10aad76fc5a4f019d5fb810533078f [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// Copyright 2014 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
dsinclair447b1f32016-12-08 10:06:32 -08007#ifndef XFA_FWL_CFX_BARCODE_H_
8#define XFA_FWL_CFX_BARCODE_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
weili1b4f6b32016-08-04 16:37:48 -070010#include <memory>
11
dsinclaira52ab742016-09-29 13:59:29 -070012#include "core/fxcrt/fx_coordinates.h"
13#include "core/fxcrt/fx_string.h"
14#include "core/fxcrt/fx_system.h"
dsinclair74a34fc2016-09-29 16:41:42 -070015#include "core/fxge/fx_dib.h"
Dan Sinclaire7786682017-03-29 15:18:41 -040016#include "fxbarcode/BC_Library.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040017
Dan Sinclaira98600a2016-03-21 15:15:56 -040018class CBC_CodeBase;
dsinclaireb9cf672016-04-13 10:14:26 -070019class CFX_Font;
20class CFX_RenderDevice;
21class CFX_Matrix;
Dan Sinclaira98600a2016-03-21 15:15:56 -040022
dsinclaireb9cf672016-04-13 10:14:26 -070023class CFX_Barcode {
Dan Sinclair1770c022016-03-14 14:14:16 -040024 public:
25 CFX_Barcode();
26 ~CFX_Barcode();
Dan Sinclaira98600a2016-03-21 15:15:56 -040027
tsepezd19e9122016-11-02 15:43:18 -070028 bool Create(BC_TYPE type);
dsinclaireb9cf672016-04-13 10:14:26 -070029 BC_TYPE GetType();
Lei Zhang1badb852017-04-20 15:58:56 -070030 bool Encode(const CFX_WideStringC& contents, bool isDevice);
dsinclair34398022016-11-14 15:13:11 -080031
Lei Zhang1badb852017-04-20 15:58:56 -070032 bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix);
dsinclair34398022016-11-14 15:13:11 -080033
tsepezd19e9122016-11-02 15:43:18 -070034 bool SetCharEncoding(BC_CHAR_ENCODING encoding);
dsinclair34398022016-11-14 15:13:11 -080035
tsepezd19e9122016-11-02 15:43:18 -070036 bool SetModuleHeight(int32_t moduleHeight);
37 bool SetModuleWidth(int32_t moduleWidth);
dsinclair34398022016-11-14 15:13:11 -080038
tsepezd19e9122016-11-02 15:43:18 -070039 bool SetHeight(int32_t height);
40 bool SetWidth(int32_t width);
dsinclair34398022016-11-14 15:13:11 -080041
tsepezd19e9122016-11-02 15:43:18 -070042 bool SetPrintChecksum(bool checksum);
43 bool SetDataLength(int32_t length);
44 bool SetCalChecksum(bool state);
dsinclair34398022016-11-14 15:13:11 -080045
tsepezd19e9122016-11-02 15:43:18 -070046 bool SetFont(CFX_Font* pFont);
Dan Sinclair05df0752017-03-14 14:43:42 -040047 bool SetFontSize(float size);
tsepezd19e9122016-11-02 15:43:18 -070048 bool SetFontColor(FX_ARGB color);
dsinclair34398022016-11-14 15:13:11 -080049
tsepezd19e9122016-11-02 15:43:18 -070050 bool SetTextLocation(BC_TEXT_LOC location);
dsinclair34398022016-11-14 15:13:11 -080051
Lei Zhang1badb852017-04-20 15:58:56 -070052 bool SetWideNarrowRatio(int8_t ratio);
Dan Sinclair812e96c2017-03-13 16:43:37 -040053 bool SetStartChar(char start);
54 bool SetEndChar(char end);
tsepezd19e9122016-11-02 15:43:18 -070055 bool SetErrorCorrectionLevel(int32_t level);
56 bool SetTruncated(bool truncated);
Dan Sinclair1770c022016-03-14 14:14:16 -040057
dsinclair34398022016-11-14 15:13:11 -080058 private:
weili1b4f6b32016-08-04 16:37:48 -070059 std::unique_ptr<CBC_CodeBase> m_pBCEngine;
Dan Sinclair1770c022016-03-14 14:14:16 -040060};
61
dsinclair447b1f32016-12-08 10:06:32 -080062#endif // XFA_FWL_CFX_BARCODE_H_