blob: ab354ef0a7d782d92b2867001145d0c30ca1db21 [file] [log] [blame]
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -07001// 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 FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_
8#define FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_
9
10#include "core/fxcrt/fx_string.h"
11#include "core/fxcrt/fx_system.h"
12#include "fxbarcode/BC_Library.h"
13#include "fxbarcode/oned/BC_OneDimWriter.h"
14
15class CBC_OnedCodaBarWriter : public CBC_OneDimWriter {
16 public:
17 CBC_OnedCodaBarWriter();
18 ~CBC_OnedCodaBarWriter() override;
19
20 // CBC_OneDimWriter
21 uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
22 uint8_t* EncodeWithHint(const ByteString& contents,
23 BCFORMAT format,
24 int32_t& outWidth,
25 int32_t& outHeight,
26 int32_t hints) override;
27 bool RenderResult(const WideStringView& contents,
28 uint8_t* code,
29 int32_t codeLength) override;
30 bool CheckContentValidity(const WideStringView& contents) override;
31 WideString FilterContents(const WideStringView& contents) override;
32 void SetDataLength(int32_t length) override;
33
34 virtual bool SetStartChar(char start);
35 virtual bool SetEndChar(char end);
36 virtual bool SetTextLocation(BC_TEXT_LOC location);
37 virtual bool SetWideNarrowRatio(int8_t ratio);
38 virtual bool FindChar(wchar_t ch, bool isContent);
39
40 WideString encodedContents(const WideStringView& contents);
41
42 private:
43 char m_chStart;
44 char m_chEnd;
45 int8_t m_iWideNarrRatio;
46};
47
48#endif // FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_