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_ONEDIMWRITER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ |
8 #define XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ |
9 | 9 |
10 #include "core/include/fxge/fx_ge.h" | 10 #include "core/include/fxge/fx_ge.h" |
11 #include "xfa/fxbarcode/BC_Writer.h" | 11 #include "xfa/fxbarcode/BC_Writer.h" |
12 #include "xfa/include/fxbarcode/BC_BarCode.h" | 12 #include "xfa/fxbarcode/include/BC_Library.h" |
13 | 13 |
14 class CBC_CommonBitMatrix; | 14 class CBC_CommonBitMatrix; |
15 class CFX_Font; | 15 class CFX_Font; |
16 class CFX_RenderDevice; | 16 class CFX_RenderDevice; |
17 | 17 |
18 class CBC_OneDimWriter : public CBC_Writer { | 18 class CBC_OneDimWriter : public CBC_Writer { |
19 public: | 19 public: |
20 CBC_OneDimWriter(); | 20 CBC_OneDimWriter(); |
21 virtual ~CBC_OneDimWriter(); | 21 virtual ~CBC_OneDimWriter(); |
| 22 |
22 uint8_t* Encode(const CFX_ByteString& contents, | 23 uint8_t* Encode(const CFX_ByteString& contents, |
23 BCFORMAT format, | 24 BCFORMAT format, |
24 int32_t& outWidth, | 25 int32_t& outWidth, |
25 int32_t& outHeight, | 26 int32_t& outHeight, |
26 int32_t& e); | 27 int32_t& e); |
27 uint8_t* Encode(const CFX_ByteString& contents, | 28 uint8_t* Encode(const CFX_ByteString& contents, |
28 BCFORMAT format, | 29 BCFORMAT format, |
29 int32_t& outWidth, | 30 int32_t& outWidth, |
30 int32_t& outHeight, | 31 int32_t& outHeight, |
31 int32_t hints, | 32 int32_t hints, |
32 int32_t& e); | 33 int32_t& e); |
33 virtual uint8_t* Encode(const CFX_ByteString& contents, | 34 virtual uint8_t* Encode(const CFX_ByteString& contents, |
34 int32_t& outLength, | 35 int32_t& outLength, |
35 int32_t& e) { | 36 int32_t& e) { |
36 return NULL; | 37 return NULL; |
37 } | 38 } |
| 39 |
38 virtual void RenderResult(const CFX_WideStringC& contents, | 40 virtual void RenderResult(const CFX_WideStringC& contents, |
39 uint8_t* code, | 41 uint8_t* code, |
40 int32_t codeLength, | 42 int32_t codeLength, |
41 FX_BOOL isDevice, | 43 FX_BOOL isDevice, |
42 int32_t& e); | 44 int32_t& e); |
43 virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, | 45 virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, |
44 const CFX_WideStringC& contents, | 46 const CFX_WideStringC& contents, |
45 int32_t& e); | 47 int32_t& e); |
46 virtual void RenderDeviceResult(CFX_RenderDevice* device, | 48 virtual void RenderDeviceResult(CFX_RenderDevice* device, |
47 const CFX_Matrix* matrix, | 49 const CFX_Matrix* matrix, |
(...skipping 10 matching lines...) Expand all Loading... |
58 } | 60 } |
59 virtual void SetPrintChecksum(FX_BOOL checksum); | 61 virtual void SetPrintChecksum(FX_BOOL checksum); |
60 virtual void SetDataLength(int32_t length); | 62 virtual void SetDataLength(int32_t length); |
61 virtual void SetCalcChecksum(int32_t state); | 63 virtual void SetCalcChecksum(int32_t state); |
62 virtual void SetFontSize(FX_FLOAT size); | 64 virtual void SetFontSize(FX_FLOAT size); |
63 virtual void SetFontStyle(int32_t style); | 65 virtual void SetFontStyle(int32_t style); |
64 virtual void SetFontColor(FX_ARGB color); | 66 virtual void SetFontColor(FX_ARGB color); |
65 virtual FX_BOOL SetFont(CFX_Font* cFont); | 67 virtual FX_BOOL SetFont(CFX_Font* cFont); |
66 | 68 |
67 protected: | 69 protected: |
68 FX_BOOL m_bPrintChecksum; | |
69 int32_t m_iDataLenth; | |
70 FX_BOOL m_bCalcChecksum; | |
71 CFX_Font* m_pFont; | |
72 FX_FLOAT m_fFontSize; | |
73 int32_t m_iFontStyle; | |
74 FX_DWORD m_fontColor; | |
75 BC_TEXT_LOC m_locTextLoc; | |
76 int32_t m_iContentLen; | |
77 FX_BOOL m_bLeftPadding; | |
78 FX_BOOL m_bRightPadding; | |
79 CBC_CommonBitMatrix* m_output; | |
80 int32_t m_barWidth; | |
81 int32_t m_multiple; | |
82 FX_FLOAT m_outputHScale; | |
83 void CalcTextInfo(const CFX_ByteString& text, | 70 void CalcTextInfo(const CFX_ByteString& text, |
84 FXTEXT_CHARPOS* charPos, | 71 FXTEXT_CHARPOS* charPos, |
85 CFX_Font* cFont, | 72 CFX_Font* cFont, |
86 FX_FLOAT geWidth, | 73 FX_FLOAT geWidth, |
87 int32_t fontSize, | 74 int32_t fontSize, |
88 FX_FLOAT& charsLen); | 75 FX_FLOAT& charsLen); |
89 virtual void ShowChars(const CFX_WideStringC& contents, | 76 virtual void ShowChars(const CFX_WideStringC& contents, |
90 CFX_DIBitmap* pOutBitmap, | 77 CFX_DIBitmap* pOutBitmap, |
91 CFX_RenderDevice* device, | 78 CFX_RenderDevice* device, |
92 const CFX_Matrix* matrix, | 79 const CFX_Matrix* matrix, |
(...skipping 15 matching lines...) Expand all Loading... |
108 FX_FLOAT locX, | 95 FX_FLOAT locX, |
109 FX_FLOAT locY, | 96 FX_FLOAT locY, |
110 int32_t barWidth); | 97 int32_t barWidth); |
111 int32_t AppendPattern(uint8_t* target, | 98 int32_t AppendPattern(uint8_t* target, |
112 int32_t pos, | 99 int32_t pos, |
113 const int32_t* pattern, | 100 const int32_t* pattern, |
114 int32_t patternLength, | 101 int32_t patternLength, |
115 int32_t startColor, | 102 int32_t startColor, |
116 int32_t& e); | 103 int32_t& e); |
117 FX_WCHAR Upper(FX_WCHAR ch); | 104 FX_WCHAR Upper(FX_WCHAR ch); |
| 105 |
| 106 FX_BOOL m_bPrintChecksum; |
| 107 int32_t m_iDataLenth; |
| 108 FX_BOOL m_bCalcChecksum; |
| 109 CFX_Font* m_pFont; |
| 110 FX_FLOAT m_fFontSize; |
| 111 int32_t m_iFontStyle; |
| 112 FX_DWORD m_fontColor; |
| 113 BC_TEXT_LOC m_locTextLoc; |
| 114 int32_t m_iContentLen; |
| 115 FX_BOOL m_bLeftPadding; |
| 116 FX_BOOL m_bRightPadding; |
| 117 CBC_CommonBitMatrix* m_output; |
| 118 int32_t m_barWidth; |
| 119 int32_t m_multiple; |
| 120 FX_FLOAT m_outputHScale; |
118 }; | 121 }; |
119 | 122 |
120 #endif // XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ | 123 #endif // XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ |
OLD | NEW |