Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 1 | // Copyright 2016 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_CBC_CODEBASE_H_ |
| 8 | #define FXBARCODE_CBC_CODEBASE_H_ |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 9 | |
tsepez | 52d7856 | 2016-06-06 12:57:44 -0700 | [diff] [blame] | 10 | #include <memory> |
| 11 | |
Dan Sinclair | bcd1e70 | 2017-08-31 13:19:18 -0400 | [diff] [blame] | 12 | #include "core/fxcrt/fx_string.h" |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 13 | #include "core/fxcrt/fx_system.h" |
dsinclair | 74a34fc | 2016-09-29 16:41:42 -0700 | [diff] [blame] | 14 | #include "core/fxge/fx_dib.h" |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 15 | #include "fxbarcode/BC_Library.h" |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 16 | |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 17 | class CBC_Reader; |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 18 | class CBC_Writer; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 19 | class CFX_DIBitmap; |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 20 | class CFX_Matrix; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 21 | class CFX_RenderDevice; |
| 22 | |
| 23 | class CBC_CodeBase { |
| 24 | public: |
Tom Sepez | ea23e0a | 2017-05-01 14:24:19 -0700 | [diff] [blame] | 25 | explicit CBC_CodeBase(std::unique_ptr<CBC_Writer> pWriter); |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 26 | virtual ~CBC_CodeBase(); |
| 27 | |
| 28 | virtual BC_TYPE GetType() = 0; |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 29 | virtual bool Encode(const WideStringView& contents) = 0; |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 30 | virtual bool RenderDevice(CFX_RenderDevice* device, |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 31 | const CFX_Matrix* matrix) = 0; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 32 | |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 33 | bool SetCharEncoding(int32_t encoding); |
| 34 | bool SetModuleHeight(int32_t moduleHeight); |
| 35 | bool SetModuleWidth(int32_t moduleWidth); |
| 36 | bool SetHeight(int32_t height); |
| 37 | bool SetWidth(int32_t width); |
tsepez | 52d7856 | 2016-06-06 12:57:44 -0700 | [diff] [blame] | 38 | void SetBackgroundColor(FX_ARGB backgroundColor); |
| 39 | void SetBarcodeColor(FX_ARGB foregroundColor); |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 40 | |
| 41 | protected: |
tsepez | 52d7856 | 2016-06-06 12:57:44 -0700 | [diff] [blame] | 42 | std::unique_ptr<CBC_Writer> m_pBCWriter; |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 43 | }; |
| 44 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 45 | #endif // FXBARCODE_CBC_CODEBASE_H_ |