1*3ac0a46fSAndroid Build Coastguard Worker // Copyright 2016 The PDFium Authors 2*3ac0a46fSAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*3ac0a46fSAndroid Build Coastguard Worker // found in the LICENSE file. 4*3ac0a46fSAndroid Build Coastguard Worker 5*3ac0a46fSAndroid Build Coastguard Worker // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6*3ac0a46fSAndroid Build Coastguard Worker 7*3ac0a46fSAndroid Build Coastguard Worker #ifndef FXBARCODE_CBC_CODEBASE_H_ 8*3ac0a46fSAndroid Build Coastguard Worker #define FXBARCODE_CBC_CODEBASE_H_ 9*3ac0a46fSAndroid Build Coastguard Worker 10*3ac0a46fSAndroid Build Coastguard Worker #include <stdint.h> 11*3ac0a46fSAndroid Build Coastguard Worker 12*3ac0a46fSAndroid Build Coastguard Worker #include <memory> 13*3ac0a46fSAndroid Build Coastguard Worker 14*3ac0a46fSAndroid Build Coastguard Worker #include "core/fxcrt/widestring.h" 15*3ac0a46fSAndroid Build Coastguard Worker #include "core/fxge/dib/fx_dib.h" 16*3ac0a46fSAndroid Build Coastguard Worker #include "fxbarcode/BC_Library.h" 17*3ac0a46fSAndroid Build Coastguard Worker 18*3ac0a46fSAndroid Build Coastguard Worker class CBC_Writer; 19*3ac0a46fSAndroid Build Coastguard Worker class CFX_Matrix; 20*3ac0a46fSAndroid Build Coastguard Worker class CFX_RenderDevice; 21*3ac0a46fSAndroid Build Coastguard Worker 22*3ac0a46fSAndroid Build Coastguard Worker class CBC_CodeBase { 23*3ac0a46fSAndroid Build Coastguard Worker public: 24*3ac0a46fSAndroid Build Coastguard Worker explicit CBC_CodeBase(std::unique_ptr<CBC_Writer> pWriter); 25*3ac0a46fSAndroid Build Coastguard Worker virtual ~CBC_CodeBase(); 26*3ac0a46fSAndroid Build Coastguard Worker 27*3ac0a46fSAndroid Build Coastguard Worker virtual BC_TYPE GetType() = 0; 28*3ac0a46fSAndroid Build Coastguard Worker virtual bool Encode(WideStringView contents) = 0; 29*3ac0a46fSAndroid Build Coastguard Worker virtual bool RenderDevice(CFX_RenderDevice* device, 30*3ac0a46fSAndroid Build Coastguard Worker const CFX_Matrix& matrix) = 0; 31*3ac0a46fSAndroid Build Coastguard Worker 32*3ac0a46fSAndroid Build Coastguard Worker void SetTextLocation(BC_TEXT_LOC location); 33*3ac0a46fSAndroid Build Coastguard Worker bool SetWideNarrowRatio(int8_t ratio); 34*3ac0a46fSAndroid Build Coastguard Worker bool SetStartChar(char start); 35*3ac0a46fSAndroid Build Coastguard Worker bool SetEndChar(char end); 36*3ac0a46fSAndroid Build Coastguard Worker bool SetErrorCorrectionLevel(int32_t level); 37*3ac0a46fSAndroid Build Coastguard Worker void SetCharEncoding(BC_CHAR_ENCODING encoding); 38*3ac0a46fSAndroid Build Coastguard Worker bool SetModuleHeight(int32_t moduleHeight); 39*3ac0a46fSAndroid Build Coastguard Worker bool SetModuleWidth(int32_t moduleWidth); 40*3ac0a46fSAndroid Build Coastguard Worker void SetHeight(int32_t height); 41*3ac0a46fSAndroid Build Coastguard Worker void SetWidth(int32_t width); 42*3ac0a46fSAndroid Build Coastguard Worker 43*3ac0a46fSAndroid Build Coastguard Worker protected: 44*3ac0a46fSAndroid Build Coastguard Worker std::unique_ptr<CBC_Writer> m_pBCWriter; 45*3ac0a46fSAndroid Build Coastguard Worker }; 46*3ac0a46fSAndroid Build Coastguard Worker 47*3ac0a46fSAndroid Build Coastguard Worker #endif // FXBARCODE_CBC_CODEBASE_H_ 48