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_ONEDCODABARWRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ |
8 #define XFA_FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDCODABARWRITER_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 CBC_OnedCodaBarWriter : public CBC_OneDimWriter { | 15 class CBC_OnedCodaBarWriter : public CBC_OneDimWriter { |
16 public: | 16 public: |
17 CBC_OnedCodaBarWriter(); | 17 CBC_OnedCodaBarWriter(); |
18 virtual ~CBC_OnedCodaBarWriter(); | 18 ~CBC_OnedCodaBarWriter() override; |
19 | 19 |
| 20 // CBC_OneDimWriter |
20 uint8_t* Encode(const CFX_ByteString& contents, | 21 uint8_t* Encode(const CFX_ByteString& contents, |
21 int32_t& outLength, | 22 int32_t& outLength, |
22 int32_t& e); | 23 int32_t& e) override; |
23 uint8_t* Encode(const CFX_ByteString& contents, | 24 uint8_t* Encode(const CFX_ByteString& contents, |
24 BCFORMAT format, | 25 BCFORMAT format, |
25 int32_t& outWidth, | 26 int32_t& outWidth, |
26 int32_t& outHeight, | 27 int32_t& outHeight, |
27 int32_t& e); | 28 int32_t& e) override; |
28 uint8_t* Encode(const CFX_ByteString& contents, | 29 uint8_t* Encode(const CFX_ByteString& contents, |
29 BCFORMAT format, | 30 BCFORMAT format, |
30 int32_t& outWidth, | 31 int32_t& outWidth, |
31 int32_t& outHeight, | 32 int32_t& outHeight, |
32 int32_t hints, | 33 int32_t hints, |
33 int32_t& e); | 34 int32_t& e) override; |
| 35 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; |
| 36 CFX_WideString FilterContents(const CFX_WideStringC& contents) override; |
| 37 void SetDataLength(int32_t length) override; |
34 | 38 |
35 CFX_WideString encodedContents(const CFX_WideStringC& contents); | 39 virtual CFX_WideString encodedContents(const CFX_WideStringC& contents); |
36 FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); | 40 virtual FX_BOOL SetStartChar(FX_CHAR start); |
37 CFX_WideString FilterContents(const CFX_WideStringC& contents); | 41 virtual FX_BOOL SetEndChar(FX_CHAR end); |
38 FX_BOOL SetStartChar(FX_CHAR start); | 42 virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location); |
39 FX_BOOL SetEndChar(FX_CHAR end); | 43 virtual FX_BOOL SetWideNarrowRatio(int32_t ratio); |
40 void SetDataLength(int32_t length); | 44 virtual FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent); |
41 FX_BOOL SetTextLocation(BC_TEXT_LOC location); | |
42 FX_BOOL SetWideNarrowRatio(int32_t ratio); | |
43 FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent); | |
44 | 45 |
45 private: | 46 private: |
46 static const FX_CHAR START_END_CHARS[]; | 47 static const FX_CHAR START_END_CHARS[]; |
47 static const FX_CHAR CONTENT_CHARS[]; | 48 static const FX_CHAR CONTENT_CHARS[]; |
48 | 49 |
49 void RenderResult(const CFX_WideStringC& contents, | 50 void RenderResult(const CFX_WideStringC& contents, |
50 uint8_t* code, | 51 uint8_t* code, |
51 int32_t codeLength, | 52 int32_t codeLength, |
52 FX_BOOL isDevice, | 53 FX_BOOL isDevice, |
53 int32_t& e); | 54 int32_t& e) override; |
54 | 55 |
55 FX_CHAR m_chStart; | 56 FX_CHAR m_chStart; |
56 FX_CHAR m_chEnd; | 57 FX_CHAR m_chEnd; |
57 int32_t m_iWideNarrRatio; | 58 int32_t m_iWideNarrRatio; |
58 }; | 59 }; |
59 | 60 |
60 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ | 61 #endif // XFA_FXBARCODE_ONED_BC_ONEDCODABARWRITER_H_ |
OLD | NEW |