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 _BC_ONEDEAN8WRITER_H_ 8 #define _BC_ONEDEAN8WRITER_H_ 9 enum BC_TEXT_LOC; 10 class CBC_OneDimWriter; 11 class CBC_OnedEAN8Writer; 12 class CBC_OnedEAN8Writer : public CBC_OneDimWriter { 13 private: 14 int32_t m_codeWidth; 15 16 public: 17 CBC_OnedEAN8Writer(); 18 virtual ~CBC_OnedEAN8Writer(); 19 uint8_t* Encode(const CFX_ByteString& contents, 20 BCFORMAT format, 21 int32_t& outWidth, 22 int32_t& outHeight, 23 int32_t& e); 24 uint8_t* Encode(const CFX_ByteString& contents, 25 BCFORMAT format, 26 int32_t& outWidth, 27 int32_t& outHeight, 28 int32_t hints, 29 int32_t& e); 30 uint8_t* Encode(const CFX_ByteString& contents, 31 int32_t& outLength, 32 int32_t& e); 33 void RenderResult(const CFX_WideStringC& contents, 34 uint8_t* code, 35 int32_t codeLength, 36 FX_BOOL isDevice, 37 int32_t& e); 38 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); 39 CFX_WideString FilterContents(const CFX_WideStringC& contents); 40 void SetDataLength(int32_t length); 41 FX_BOOL SetTextLocation(BC_TEXT_LOC location); 42 int32_t CalcChecksum(const CFX_ByteString& contents); 43 44 protected: 45 void ShowChars(const CFX_WideStringC& contents, 46 CFX_DIBitmap* pOutBitmap, 47 CFX_RenderDevice* device, 48 const CFX_Matrix* matrix, 49 int32_t barWidth, 50 int32_t multiple, 51 int32_t& e); 52 }; 53 #endif 54