blob: c874610a6426cfabbeff5dd06a622bb5dbebcc79 [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// 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
Dan Sinclaire7786682017-03-29 15:18:41 -04007#ifndef FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_
8#define FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
dsinclaira52ab742016-09-29 13:59:29 -070010#include "core/fxcrt/fx_string.h"
11#include "core/fxcrt/fx_system.h"
Dan Sinclaire7786682017-03-29 15:18:41 -040012#include "fxbarcode/oned/BC_OneDimWriter.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040013
Dan Sinclaira98600a2016-03-21 15:15:56 -040014class CFX_DIBitmap;
15class CFX_RenderDevice;
16
17class CBC_OnedEAN13Writer : public CBC_OneDimWriter {
Dan Sinclair1770c022016-03-14 14:14:16 -040018 public:
19 CBC_OnedEAN13Writer();
weili29b8ad02016-06-14 18:20:04 -070020 ~CBC_OnedEAN13Writer() override;
Dan Sinclair1770c022016-03-14 14:14:16 -040021
weili29b8ad02016-06-14 18:20:04 -070022 // CBC_OneDimWriter
Ryan Harrison275e2602017-09-18 14:23:18 -040023 uint8_t* EncodeWithHint(const ByteString& contents,
Lei Zhang1badb852017-04-20 15:58:56 -070024 BCFORMAT format,
25 int32_t& outWidth,
26 int32_t& outHeight,
27 int32_t hints) override;
Ryan Harrison275e2602017-09-18 14:23:18 -040028 uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
29 bool CheckContentValidity(const WideStringView& contents) override;
30 WideString FilterContents(const WideStringView& contents) override;
weili29b8ad02016-06-14 18:20:04 -070031
Ryan Harrison275e2602017-09-18 14:23:18 -040032 int32_t CalcChecksum(const ByteString& contents);
Dan Sinclair1770c022016-03-14 14:14:16 -040033
34 protected:
Ryan Harrison275e2602017-09-18 14:23:18 -040035 bool ShowChars(const WideStringView& contents,
Dan Sinclair1770c022016-03-14 14:14:16 -040036 CFX_RenderDevice* device,
37 const CFX_Matrix* matrix,
38 int32_t barWidth,
Lei Zhang1badb852017-04-20 15:58:56 -070039 int32_t multiple) override;
Dan Sinclaira98600a2016-03-21 15:15:56 -040040
41 private:
42 int32_t m_codeWidth;
Dan Sinclair1770c022016-03-14 14:14:16 -040043};
44
Dan Sinclaire7786682017-03-29 15:18:41 -040045#endif // FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_