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