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_ONEDCODABARWRITER_H_ 8 #define FXBARCODE_ONED_BC_ONEDCODABARWRITER_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_OneDimWriter.h" 15 16 class CBC_OnedCodaBarWriter final : public CBC_OneDimWriter { 17 public: 18 CBC_OnedCodaBarWriter(); 19 ~CBC_OnedCodaBarWriter() override; 20 21 // CBC_OneDimWriter: 22 DataVector<uint8_t> Encode(const ByteString& contents) override; 23 bool RenderResult(WideStringView contents, 24 pdfium::span<const uint8_t> code) override; 25 bool CheckContentValidity(WideStringView contents) override; 26 WideString FilterContents(WideStringView contents) override; 27 void SetDataLength(int32_t length) override; 28 void SetTextLocation(BC_TEXT_LOC location) override; 29 bool SetWideNarrowRatio(int8_t ratio) override; 30 bool SetStartChar(char start) override; 31 bool SetEndChar(char end) override; 32 33 WideString encodedContents(WideStringView contents); 34 35 private: 36 char m_chStart = 'A'; 37 char m_chEnd = 'B'; 38 int8_t m_iWideNarrRatio = 2; 39 }; 40 41 #endif // FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ 42