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_ONEDUPCAWRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
8 #define XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
9 | 9 |
| 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 |
10 class CBC_OnedEAN13Writer; | 14 class CBC_OnedEAN13Writer; |
11 class CBC_OnedUPCAWriter; | 15 class CFX_DIBitmap; |
| 16 class CFX_Matrix; |
| 17 class CFX_RenderDevice; |
| 18 |
12 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { | 19 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { |
13 private: | |
14 CBC_OnedEAN13Writer* m_subWriter; | |
15 | |
16 public: | 20 public: |
17 CBC_OnedUPCAWriter(); | 21 CBC_OnedUPCAWriter(); |
18 virtual ~CBC_OnedUPCAWriter(); | 22 virtual ~CBC_OnedUPCAWriter(); |
| 23 |
19 virtual void Init(); | 24 virtual void Init(); |
| 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) { |
34 return nullptr; | 40 return nullptr; |
35 } | 41 } |
| 42 |
36 void RenderResult(const CFX_WideStringC& contents, | 43 void RenderResult(const CFX_WideStringC& contents, |
37 uint8_t* code, | 44 uint8_t* code, |
38 int32_t codeLength, | 45 int32_t codeLength, |
39 FX_BOOL isDevice, | 46 FX_BOOL isDevice, |
40 int32_t& e); | 47 int32_t& e); |
41 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 48 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); |
42 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 49 CFX_WideString FilterContents(const CFX_WideStringC& contents); |
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); |
| 60 |
| 61 private: |
| 62 CBC_OnedEAN13Writer* m_subWriter; |
53 }; | 63 }; |
54 | 64 |
55 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 65 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
OLD | NEW |