| 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_ONEDCODE128WRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDCODE128WRITER_H_ |
| 8 #define XFA_FXBARCODE_ONED_BC_ONEDCODE128WRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDCODE128WRITER_H_ |
| 9 | 9 |
| 10 class CBC_OneDimWriter; | 10 #include "core/include/fxcrt/fx_string.h" |
| 11 #include "core/include/fxcrt/fx_system.h" |
| 12 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" |
| 13 |
| 11 class CBC_OnedCode128Writer : public CBC_OneDimWriter { | 14 class CBC_OnedCode128Writer : public CBC_OneDimWriter { |
| 12 public: | 15 public: |
| 13 CBC_OnedCode128Writer(); | 16 CBC_OnedCode128Writer(); |
| 14 CBC_OnedCode128Writer(BC_TYPE type); | 17 explicit CBC_OnedCode128Writer(BC_TYPE type); |
| 15 virtual ~CBC_OnedCode128Writer(); | 18 virtual ~CBC_OnedCode128Writer(); |
| 19 |
| 16 uint8_t* Encode(const CFX_ByteString& contents, | 20 uint8_t* Encode(const CFX_ByteString& contents, |
| 17 BCFORMAT format, | 21 BCFORMAT format, |
| 18 int32_t& outWidth, | 22 int32_t& outWidth, |
| 19 int32_t& outHeight, | 23 int32_t& outHeight, |
| 20 int32_t hints, | 24 int32_t hints, |
| 21 int32_t& e); | 25 int32_t& e); |
| 22 uint8_t* Encode(const CFX_ByteString& contents, | 26 uint8_t* Encode(const CFX_ByteString& contents, |
| 23 BCFORMAT format, | 27 BCFORMAT format, |
| 24 int32_t& outWidth, | 28 int32_t& outWidth, |
| 25 int32_t& outHeight, | 29 int32_t& outHeight, |
| 26 int32_t& e); | 30 int32_t& e); |
| 27 uint8_t* Encode(const CFX_ByteString& contents, | 31 uint8_t* Encode(const CFX_ByteString& contents, |
| 28 int32_t& outLength, | 32 int32_t& outLength, |
| 29 int32_t& e); | 33 int32_t& e); |
| 34 |
| 30 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 35 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); |
| 31 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 36 CFX_WideString FilterContents(const CFX_WideStringC& contents); |
| 32 FX_BOOL SetTextLocation(BC_TEXT_LOC location); | 37 FX_BOOL SetTextLocation(BC_TEXT_LOC location); |
| 33 BC_TYPE GetType(); | 38 BC_TYPE GetType(); |
| 34 | 39 |
| 35 private: | 40 private: |
| 41 static const int32_t CODE_CODE_B = 100; |
| 42 static const int32_t CODE_CODE_C = 99; |
| 43 static const int32_t CODE_START_B = 104; |
| 44 static const int32_t CODE_START_C = 105; |
| 45 static const int32_t CODE_STOP = 106; |
| 46 |
| 36 FX_BOOL IsDigits(const CFX_ByteString& contents, | 47 FX_BOOL IsDigits(const CFX_ByteString& contents, |
| 37 int32_t start, | 48 int32_t start, |
| 38 int32_t length); | 49 int32_t length); |
| 39 int32_t Encode128B(const CFX_ByteString& contents, CFX_PtrArray& patterns); | 50 int32_t Encode128B(const CFX_ByteString& contents, CFX_PtrArray& patterns); |
| 40 int32_t Encode128C(const CFX_ByteString& contents, CFX_PtrArray& patterns); | 51 int32_t Encode128C(const CFX_ByteString& contents, CFX_PtrArray& patterns); |
| 52 |
| 41 BC_TYPE m_codeFormat; | 53 BC_TYPE m_codeFormat; |
| 42 static const int32_t CODE_START_B; | |
| 43 static const int32_t CODE_START_C; | |
| 44 static const int32_t CODE_CODE_B; | |
| 45 static const int32_t CODE_CODE_C; | |
| 46 static const int32_t CODE_STOP; | |
| 47 }; | 54 }; |
| 48 | 55 |
| 49 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODE128WRITER_H_ | 56 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODE128WRITER_H_ |
| OLD | NEW |