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