| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
| 8 #define XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fxcrt/include/fx_string.h" | 12 #include "core/fxcrt/include/fx_string.h" |
| 11 #include "core/fxcrt/include/fx_system.h" | 13 #include "core/fxcrt/include/fx_system.h" |
| 12 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" | 14 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" |
| 13 | 15 |
| 14 class CBC_OnedEAN13Writer; | 16 class CBC_OnedEAN13Writer; |
| 15 class CFX_DIBitmap; | 17 class CFX_DIBitmap; |
| 16 class CFX_Matrix; | 18 class CFX_Matrix; |
| 17 class CFX_RenderDevice; | 19 class CFX_RenderDevice; |
| 18 | 20 |
| 19 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { | 21 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { |
| 20 public: | 22 public: |
| 21 CBC_OnedUPCAWriter(); | 23 CBC_OnedUPCAWriter(); |
| 22 ~CBC_OnedUPCAWriter() override; | 24 ~CBC_OnedUPCAWriter() override; |
| 23 | 25 |
| 24 virtual void Init(); | |
| 25 | |
| 26 // CBC_OneDimWriter | 26 // CBC_OneDimWriter |
| 27 uint8_t* Encode(const CFX_ByteString& contents, | 27 uint8_t* Encode(const CFX_ByteString& contents, |
| 28 BCFORMAT format, | 28 BCFORMAT format, |
| 29 int32_t& outWidth, | 29 int32_t& outWidth, |
| 30 int32_t& outHeight, | 30 int32_t& outHeight, |
| 31 int32_t& e) override; | 31 int32_t& e) override; |
| 32 uint8_t* Encode(const CFX_ByteString& contents, | 32 uint8_t* Encode(const CFX_ByteString& contents, |
| 33 BCFORMAT format, | 33 BCFORMAT format, |
| 34 int32_t& outWidth, | 34 int32_t& outWidth, |
| 35 int32_t& outHeight, | 35 int32_t& outHeight, |
| 36 int32_t hints, | 36 int32_t hints, |
| 37 int32_t& e) override; | 37 int32_t& e) override; |
| 38 uint8_t* Encode(const CFX_ByteString& contents, | 38 uint8_t* Encode(const CFX_ByteString& contents, |
| 39 int32_t& outLength, | 39 int32_t& outLength, |
| 40 int32_t& e) override; | 40 int32_t& e) override; |
| 41 | 41 |
| 42 void RenderResult(const CFX_WideStringC& contents, | 42 void RenderResult(const CFX_WideStringC& contents, |
| 43 uint8_t* code, | 43 uint8_t* code, |
| 44 int32_t codeLength, | 44 int32_t codeLength, |
| 45 FX_BOOL isDevice, | 45 FX_BOOL isDevice, |
| 46 int32_t& e) override; | 46 int32_t& e) override; |
| 47 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; | 47 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
| 48 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; | 48 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 49 |
| 50 void Init(); |
| 49 int32_t CalcChecksum(const CFX_ByteString& contents); | 51 int32_t CalcChecksum(const CFX_ByteString& contents); |
| 50 | 52 |
| 51 protected: | 53 protected: |
| 52 void ShowChars(const CFX_WideStringC& contents, | 54 void ShowChars(const CFX_WideStringC& contents, |
| 53 CFX_DIBitmap* pOutBitmap, | 55 CFX_DIBitmap* pOutBitmap, |
| 54 CFX_RenderDevice* device, | 56 CFX_RenderDevice* device, |
| 55 const CFX_Matrix* matrix, | 57 const CFX_Matrix* matrix, |
| 56 int32_t barWidth, | 58 int32_t barWidth, |
| 57 int32_t multiple, | 59 int32_t multiple, |
| 58 int32_t& e) override; | 60 int32_t& e) override; |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 CBC_OnedEAN13Writer* m_subWriter; | 63 std::unique_ptr<CBC_OnedEAN13Writer> m_subWriter; |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 66 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
| OLD | NEW |