1 // Copyright 2014 The PDFium Authors 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 FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ 8 #define FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ 9 10 #include <stdint.h> 11 12 #include "core/fxcrt/fx_string.h" 13 #include "fxbarcode/BC_Library.h" 14 #include "fxbarcode/oned/BC_OnedEANWriter.h" 15 16 class CFX_RenderDevice; 17 18 class CBC_OnedEAN13Writer final : public CBC_OneDimEANWriter { 19 public: 20 CBC_OnedEAN13Writer(); 21 ~CBC_OnedEAN13Writer() override; 22 23 // CBC_OneDimEANWriter: 24 DataVector<uint8_t> Encode(const ByteString& contents) override; 25 bool CheckContentValidity(WideStringView contents) override; 26 WideString FilterContents(WideStringView contents) override; 27 int32_t CalcChecksum(const ByteString& contents) override; 28 29 private: 30 bool ShowChars(WideStringView contents, 31 CFX_RenderDevice* device, 32 const CFX_Matrix& matrix, 33 int32_t barWidth) override; 34 35 int32_t m_codeWidth; 36 }; 37 38 #endif // FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ 39