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_ONEDEAN13WRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |
8 #define XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
11 #include "core/fxcrt/include/fx_system.h" | 11 #include "core/fxcrt/include/fx_system.h" |
12 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" | 12 #include "xfa/fxbarcode/oned/BC_OneDimWriter.h" |
13 | 13 |
14 class CFX_DIBitmap; | 14 class CFX_DIBitmap; |
15 class CFX_RenderDevice; | 15 class CFX_RenderDevice; |
16 | 16 |
17 class CBC_OnedEAN13Writer : public CBC_OneDimWriter { | 17 class CBC_OnedEAN13Writer : public CBC_OneDimWriter { |
18 public: | 18 public: |
19 CBC_OnedEAN13Writer(); | 19 CBC_OnedEAN13Writer(); |
20 virtual ~CBC_OnedEAN13Writer(); | 20 ~CBC_OnedEAN13Writer() override; |
21 | 21 |
| 22 // CBC_OneDimWriter |
22 uint8_t* Encode(const CFX_ByteString& contents, | 23 uint8_t* Encode(const CFX_ByteString& contents, |
23 BCFORMAT format, | 24 BCFORMAT format, |
24 int32_t& outWidth, | 25 int32_t& outWidth, |
25 int32_t& outHeight, | 26 int32_t& outHeight, |
26 int32_t& e); | 27 int32_t& e) override; |
27 uint8_t* Encode(const CFX_ByteString& contents, | 28 uint8_t* Encode(const CFX_ByteString& contents, |
28 BCFORMAT format, | 29 BCFORMAT format, |
29 int32_t& outWidth, | 30 int32_t& outWidth, |
30 int32_t& outHeight, | 31 int32_t& outHeight, |
31 int32_t hints, | 32 int32_t hints, |
32 int32_t& e); | 33 int32_t& e) override; |
33 uint8_t* Encode(const CFX_ByteString& contents, | 34 uint8_t* Encode(const CFX_ByteString& contents, |
34 int32_t& outLength, | 35 int32_t& outLength, |
35 int32_t& e); | 36 int32_t& e) override; |
36 | |
37 void RenderResult(const CFX_WideStringC& contents, | 37 void RenderResult(const CFX_WideStringC& contents, |
38 uint8_t* code, | 38 uint8_t* code, |
39 int32_t codeLength, | 39 int32_t codeLength, |
40 FX_BOOL isDevice, | 40 FX_BOOL isDevice, |
41 int32_t& e); | 41 int32_t& e) override; |
42 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 42 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
43 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 43 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 44 |
44 int32_t CalcChecksum(const CFX_ByteString& contents); | 45 int32_t CalcChecksum(const CFX_ByteString& contents); |
45 | 46 |
46 protected: | 47 protected: |
47 void ShowChars(const CFX_WideStringC& contents, | 48 void ShowChars(const CFX_WideStringC& contents, |
48 CFX_DIBitmap* pOutBitmap, | 49 CFX_DIBitmap* pOutBitmap, |
49 CFX_RenderDevice* device, | 50 CFX_RenderDevice* device, |
50 const CFX_Matrix* matrix, | 51 const CFX_Matrix* matrix, |
51 int32_t barWidth, | 52 int32_t barWidth, |
52 int32_t multiple, | 53 int32_t multiple, |
53 int32_t& e); | 54 int32_t& e) override; |
54 | 55 |
55 private: | 56 private: |
56 int32_t m_codeWidth; | 57 int32_t m_codeWidth; |
57 }; | 58 }; |
58 | 59 |
59 #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ | 60 #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN13WRITER_H_ |
OLD | NEW |