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 | |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 7 | #ifndef XFA_FWL_CFX_BARCODE_H_ |
| 8 | #define XFA_FWL_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" |
dsinclair | 74a34fc | 2016-09-29 16:41:42 -0700 | [diff] [blame] | 15 | #include "core/fxge/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: |
| 25 | CFX_Barcode(); |
| 26 | ~CFX_Barcode(); |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 27 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 28 | bool Create(BC_TYPE type); |
dsinclair | eb9cf67 | 2016-04-13 10:14:26 -0700 | [diff] [blame] | 29 | BC_TYPE GetType(); |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame^] | 30 | bool Encode(const CFX_WideStringC& contents, bool isDevice); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 31 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame^] | 32 | bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 33 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 34 | bool SetCharEncoding(BC_CHAR_ENCODING encoding); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 35 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 36 | bool SetModuleHeight(int32_t moduleHeight); |
| 37 | bool SetModuleWidth(int32_t moduleWidth); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 38 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 39 | bool SetHeight(int32_t height); |
| 40 | bool SetWidth(int32_t width); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 41 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 42 | bool SetPrintChecksum(bool checksum); |
| 43 | bool SetDataLength(int32_t length); |
| 44 | bool SetCalChecksum(bool state); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 45 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 46 | bool SetFont(CFX_Font* pFont); |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 47 | bool SetFontSize(float size); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 48 | bool SetFontColor(FX_ARGB color); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 49 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 50 | bool SetTextLocation(BC_TEXT_LOC location); |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 51 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame^] | 52 | bool SetWideNarrowRatio(int8_t ratio); |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 53 | bool SetStartChar(char start); |
| 54 | bool SetEndChar(char end); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 55 | bool SetErrorCorrectionLevel(int32_t level); |
| 56 | bool SetTruncated(bool truncated); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 57 | |
dsinclair | 3439802 | 2016-11-14 15:13:11 -0800 | [diff] [blame] | 58 | private: |
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 | |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 62 | #endif // XFA_FWL_CFX_BARCODE_H_ |