Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 1 | // 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 | |
Tom Sepez | ae5d92a | 2020-01-07 23:41:49 +0000 | [diff] [blame] | 7 | #ifndef FXBARCODE_CFX_BARCODE_H_ |
| 8 | #define FXBARCODE_CFX_BARCODE_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
weili | 1b4f6b3 | 2016-08-04 16:37:48 -0700 | [diff] [blame] | 10 | #include <memory> |
| 11 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 12 | #include "core/fxcrt/fx_coordinates.h" |
| 13 | #include "core/fxcrt/fx_string.h" |
| 14 | #include "core/fxcrt/fx_system.h" |
Tom Sepez | cefb38d | 2020-10-20 19:08:33 +0000 | [diff] [blame] | 15 | #include "core/fxge/dib/fx_dib.h" |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 16 | #include "fxbarcode/BC_Library.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 17 | |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 18 | class CBC_CodeBase; |
dsinclair | eb9cf67 | 2016-04-13 10:14:26 -0700 | [diff] [blame] | 19 | class CFX_Font; |
| 20 | class CFX_RenderDevice; |
| 21 | class CFX_Matrix; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 22 | |
dsinclair | eb9cf67 | 2016-04-13 10:14:26 -0700 | [diff] [blame] | 23 | class CFX_Barcode { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 24 | public: |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 25 | ~CFX_Barcode(); |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 26 | |
Ryan Harrison | 4b9d698 | 2018-01-26 17:11:51 +0000 | [diff] [blame] | 27 | static std::unique_ptr<CFX_Barcode> Create(BC_TYPE type); |
dsinclair | eb9cf67 | 2016-04-13 10:14:26 -0700 | [diff] [blame] | 28 | BC_TYPE GetType(); |
Tom Sepez | 1ab2757 | 2018-12-14 20:31:31 +0000 | [diff] [blame] | 29 | bool Encode(WideStringView contents); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 30 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 31 | bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 32 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 33 | bool SetCharEncoding(BC_CHAR_ENCODING encoding); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 34 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 35 | bool SetModuleHeight(int32_t moduleHeight); |
| 36 | bool SetModuleWidth(int32_t moduleWidth); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 37 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 38 | bool SetHeight(int32_t height); |
| 39 | bool SetWidth(int32_t width); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 40 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 41 | bool SetPrintChecksum(bool checksum); |
| 42 | bool SetDataLength(int32_t length); |
| 43 | bool SetCalChecksum(bool state); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 44 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 45 | bool SetFont(CFX_Font* pFont); |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 46 | bool SetFontSize(float size); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 47 | bool SetFontColor(FX_ARGB color); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 48 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 49 | bool SetTextLocation(BC_TEXT_LOC location); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 50 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 51 | bool SetWideNarrowRatio(int8_t ratio); |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 52 | bool SetStartChar(char start); |
| 53 | bool SetEndChar(char end); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 54 | bool SetErrorCorrectionLevel(int32_t level); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 55 | |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 56 | private: |
Ryan Harrison | 4b9d698 | 2018-01-26 17:11:51 +0000 | [diff] [blame] | 57 | CFX_Barcode(); |
| 58 | |
weili | 1b4f6b3 | 2016-08-04 16:37:48 -0700 | [diff] [blame] | 59 | std::unique_ptr<CBC_CodeBase> m_pBCEngine; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 60 | }; |
| 61 | |
Tom Sepez | ae5d92a | 2020-01-07 23:41:49 +0000 | [diff] [blame] | 62 | #endif // FXBARCODE_CFX_BARCODE_H_ |