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 | |
| 7 | #ifndef XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |
| 8 | #define XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |
| 9 | |
Dan Sinclair | a8a28e0 | 2016-03-23 15:41:39 -0400 | [diff] [blame] | 10 | #include "core/fxcrt/include/fx_string.h" |
| 11 | #include "core/fxcrt/include/fx_system.h" |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 12 | #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 13 | |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 14 | class CFX_DIBitmap; |
| 15 | class CFX_RenderDevice; |
| 16 | |
| 17 | class CBC_OnedEAN13Writer : public CBC_OneDimWriter { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 18 | public: |
| 19 | CBC_OnedEAN13Writer(); |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 20 | ~CBC_OnedEAN13Writer() override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 21 | |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 22 | // CBC_OneDimWriter |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 23 | uint8_t* Encode(const CFX_ByteString& contents, |
| 24 | BCFORMAT format, |
| 25 | int32_t& outWidth, |
| 26 | int32_t& outHeight, |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 27 | int32_t& e) override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 28 | uint8_t* Encode(const CFX_ByteString& contents, |
| 29 | BCFORMAT format, |
| 30 | int32_t& outWidth, |
| 31 | int32_t& outHeight, |
| 32 | int32_t hints, |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 33 | int32_t& e) override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 34 | uint8_t* Encode(const CFX_ByteString& contents, |
| 35 | int32_t& outLength, |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 36 | int32_t& e) override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 37 | void RenderResult(const CFX_WideStringC& contents, |
| 38 | uint8_t* code, |
| 39 | int32_t codeLength, |
| 40 | FX_BOOL isDevice, |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 41 | int32_t& e) override; |
| 42 | FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
| 43 | CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 44 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 45 | int32_t CalcChecksum(const CFX_ByteString& contents); |
| 46 | |
| 47 | protected: |
| 48 | void ShowChars(const CFX_WideStringC& contents, |
| 49 | CFX_DIBitmap* pOutBitmap, |
| 50 | CFX_RenderDevice* device, |
| 51 | const CFX_Matrix* matrix, |
| 52 | int32_t barWidth, |
| 53 | int32_t multiple, |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame^] | 54 | int32_t& e) override; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 55 | |
| 56 | private: |
| 57 | int32_t m_codeWidth; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |