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 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 7 | #ifndef FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ |
| 8 | #define FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 10 | #include "core/fxcrt/fx_string.h" |
| 11 | #include "core/fxcrt/fx_system.h" |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 12 | #include "fxbarcode/BC_Library.h" |
| 13 | #include "fxbarcode/oned/BC_OneDimWriter.h" |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 14 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 15 | class CBC_OnedCodaBarWriter : public CBC_OneDimWriter { |
| 16 | public: |
| 17 | CBC_OnedCodaBarWriter(); |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 18 | ~CBC_OnedCodaBarWriter() override; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 19 | |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 20 | // CBC_OneDimWriter |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 21 | uint8_t* EncodeImpl(const CFX_ByteString& contents, |
| 22 | int32_t& outLength) override; |
| 23 | uint8_t* EncodeWithHint(const CFX_ByteString& contents, |
| 24 | BCFORMAT format, |
| 25 | int32_t& outWidth, |
| 26 | int32_t& outHeight, |
| 27 | int32_t hints) override; |
| 28 | bool RenderResult(const CFX_WideStringC& contents, |
| 29 | uint8_t* code, |
| 30 | int32_t codeLength, |
| 31 | bool isDevice) override; |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 32 | bool CheckContentValidity(const CFX_WideStringC& contents) override; |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 33 | CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 34 | void SetDataLength(int32_t length) override; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 35 | |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 36 | virtual bool SetStartChar(char start); |
| 37 | virtual bool SetEndChar(char end); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 38 | virtual bool SetTextLocation(BC_TEXT_LOC location); |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 39 | virtual bool SetWideNarrowRatio(int8_t ratio); |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 40 | virtual bool FindChar(wchar_t ch, bool isContent); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 41 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 42 | CFX_WideString encodedContents(const CFX_WideStringC& contents); |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 43 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 44 | private: |
Dan Sinclair | 812e96c | 2017-03-13 16:43:37 -0400 | [diff] [blame] | 45 | char m_chStart; |
| 46 | char m_chEnd; |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 47 | int8_t m_iWideNarrRatio; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 48 | }; |
| 49 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 50 | #endif // FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ |