| 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_ONEDCODE39WRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ |
| 8 #define XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ |
| 9 | 9 |
| 10 #include "xfa/fxbarcode/include/BC_Library.h" | 10 #include "xfa/fxbarcode/include/BC_Library.h" |
| 11 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" | 11 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" |
| 12 | 12 |
| 13 class CBC_OnedCode39Writer : public CBC_OneDimWriter { | 13 class CBC_OnedCode39Writer : public CBC_OneDimWriter { |
| 14 public: | 14 public: |
| 15 CBC_OnedCode39Writer(); | 15 CBC_OnedCode39Writer(); |
| 16 explicit CBC_OnedCode39Writer(FX_BOOL extendedMode); | 16 explicit CBC_OnedCode39Writer(FX_BOOL extendedMode); |
| 17 virtual ~CBC_OnedCode39Writer(); | 17 ~CBC_OnedCode39Writer() override; |
| 18 | 18 |
| 19 // CBC_OneDimWriter |
| 19 uint8_t* Encode(const CFX_ByteString& contents, | 20 uint8_t* Encode(const CFX_ByteString& contents, |
| 20 BCFORMAT format, | 21 BCFORMAT format, |
| 21 int32_t& outWidth, | 22 int32_t& outWidth, |
| 22 int32_t& outHeight, | 23 int32_t& outHeight, |
| 23 int32_t& e); | 24 int32_t& e) override; |
| 24 uint8_t* Encode(const CFX_ByteString& contents, | 25 uint8_t* Encode(const CFX_ByteString& contents, |
| 25 BCFORMAT format, | 26 BCFORMAT format, |
| 26 int32_t& outWidth, | 27 int32_t& outWidth, |
| 27 int32_t& outHeight, | 28 int32_t& outHeight, |
| 28 int32_t hints, | 29 int32_t hints, |
| 29 int32_t& e); | 30 int32_t& e) override; |
| 30 uint8_t* Encode(const CFX_ByteString& contents, | 31 uint8_t* Encode(const CFX_ByteString& contents, |
| 31 int32_t& outLength, | 32 int32_t& outLength, |
| 32 int32_t& e); | 33 int32_t& e) override; |
| 33 void RenderResult(const CFX_WideStringC& contents, | 34 void RenderResult(const CFX_WideStringC& contents, |
| 34 uint8_t* code, | 35 uint8_t* code, |
| 35 int32_t codeLength, | 36 int32_t codeLength, |
| 36 FX_BOOL isDevice, | 37 FX_BOOL isDevice, |
| 37 int32_t& e); | 38 int32_t& e) override; |
| 39 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
| 40 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 41 CFX_WideString RenderTextContents(const CFX_WideStringC& contents) override; |
| 38 | 42 |
| 39 CFX_WideString encodedContents(const CFX_WideStringC& contents, int32_t& e); | 43 virtual CFX_WideString encodedContents(const CFX_WideStringC& contents, |
| 40 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 44 int32_t& e); |
| 41 FX_BOOL CheckExtendedContentValidity(const CFX_WideStringC& contents); | 45 virtual FX_BOOL CheckExtendedContentValidity(const CFX_WideStringC& contents); |
| 42 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 46 virtual CFX_WideString FilterExtendedContents( |
| 43 CFX_WideString FilterExtendedContents(const CFX_WideStringC& contents); | 47 const CFX_WideStringC& contents); |
| 44 CFX_WideString RenderTextContents(const CFX_WideStringC& contents); | 48 virtual CFX_WideString RenderExtendedTextContents( |
| 45 CFX_WideString RenderExtendedTextContents(const CFX_WideStringC& contents); | 49 const CFX_WideStringC& contents); |
| 46 FX_BOOL SetTextLocation(BC_TEXT_LOC loction); | 50 virtual FX_BOOL SetTextLocation(BC_TEXT_LOC loction); |
| 47 FX_BOOL SetWideNarrowRatio(int32_t ratio); | 51 virtual FX_BOOL SetWideNarrowRatio(int32_t ratio); |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 void ToIntArray(int32_t a, int32_t* toReturn); | 54 void ToIntArray(int32_t a, int32_t* toReturn); |
| 51 FX_CHAR CalcCheckSum(const CFX_ByteString& contents, int32_t& e); | 55 FX_CHAR CalcCheckSum(const CFX_ByteString& contents, int32_t& e); |
| 52 | 56 |
| 53 int32_t m_iWideNarrRatio; | 57 int32_t m_iWideNarrRatio; |
| 54 FX_BOOL m_extendedMode; | 58 FX_BOOL m_extendedMode; |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ | 61 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODE39WRITER_H_ |
| OLD | NEW |