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/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 CBC_OnedEAN13Writer; | 14 class CBC_OnedEAN13Writer; |
15 class CFX_DIBitmap; | 15 class CFX_DIBitmap; |
16 class CFX_Matrix; | 16 class CFX_Matrix; |
17 class CFX_RenderDevice; | 17 class CFX_RenderDevice; |
18 | 18 |
19 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { | 19 class CBC_OnedUPCAWriter : public CBC_OneDimWriter { |
20 public: | 20 public: |
21 CBC_OnedUPCAWriter(); | 21 CBC_OnedUPCAWriter(); |
22 virtual ~CBC_OnedUPCAWriter(); | 22 ~CBC_OnedUPCAWriter() override; |
23 | 23 |
24 virtual void Init(); | 24 virtual void Init(); |
25 | 25 |
| 26 // CBC_OneDimWriter |
26 uint8_t* Encode(const CFX_ByteString& contents, | 27 uint8_t* Encode(const CFX_ByteString& contents, |
27 BCFORMAT format, | 28 BCFORMAT format, |
28 int32_t& outWidth, | 29 int32_t& outWidth, |
29 int32_t& outHeight, | 30 int32_t& outHeight, |
30 int32_t& e); | 31 int32_t& e) override; |
31 uint8_t* Encode(const CFX_ByteString& contents, | 32 uint8_t* Encode(const CFX_ByteString& contents, |
32 BCFORMAT format, | 33 BCFORMAT format, |
33 int32_t& outWidth, | 34 int32_t& outWidth, |
34 int32_t& outHeight, | 35 int32_t& outHeight, |
35 int32_t hints, | 36 int32_t hints, |
36 int32_t& e); | 37 int32_t& e) override; |
37 uint8_t* Encode(const CFX_ByteString& contents, | 38 uint8_t* Encode(const CFX_ByteString& contents, |
38 int32_t& outLength, | 39 int32_t& outLength, |
39 int32_t& e) { | 40 int32_t& e) override; |
40 return nullptr; | |
41 } | |
42 | 41 |
43 void RenderResult(const CFX_WideStringC& contents, | 42 void RenderResult(const CFX_WideStringC& contents, |
44 uint8_t* code, | 43 uint8_t* code, |
45 int32_t codeLength, | 44 int32_t codeLength, |
46 FX_BOOL isDevice, | 45 FX_BOOL isDevice, |
47 int32_t& e); | 46 int32_t& e) override; |
48 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 47 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
49 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 48 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
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; |
60 | 59 |
61 private: | 60 private: |
62 CBC_OnedEAN13Writer* m_subWriter; | 61 CBC_OnedEAN13Writer* m_subWriter; |
63 }; | 62 }; |
64 | 63 |
65 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ | 64 #endif // XFA_FXBARCODE_ONED_BC_ONEDUPCAWRITER_H_ |
OLD | NEW |