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_FWL_CORE_IFWL_BARCODE_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_BARCODE_H_ |
8 #define XFA_FWL_CORE_IFWL_BARCODE_H_ | 8 #define XFA_FWL_CORE_IFWL_BARCODE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "xfa/fwl/core/ifwl_dataprovider.h" | |
13 #include "xfa/fwl/core/ifwl_edit.h" | 12 #include "xfa/fwl/core/ifwl_edit.h" |
14 #include "xfa/fwl/core/ifwl_scrollbar.h" | 13 #include "xfa/fwl/core/ifwl_scrollbar.h" |
| 14 #include "xfa/fwl/core/ifwl_widget.h" |
15 #include "xfa/fxbarcode/BC_Library.h" | 15 #include "xfa/fxbarcode/BC_Library.h" |
16 | 16 |
17 class CFWL_WidgetProperties; | 17 class CFWL_WidgetProperties; |
18 class CFX_Barcode; | 18 class CFX_Barcode; |
19 class IFWL_Widget; | 19 class IFWL_Widget; |
20 | 20 |
21 #define XFA_BCS_NeedUpdate 0x0001 | 21 #define XFA_BCS_NeedUpdate 0x0001 |
22 #define XFA_BCS_EncodeSuccess 0x0002 | 22 #define XFA_BCS_EncodeSuccess 0x0002 |
23 | 23 |
24 enum FWL_BCDAttribute { | 24 enum FWL_BCDAttribute { |
25 FWL_BCDATTRIBUTE_NONE = 0, | 25 FWL_BCDATTRIBUTE_NONE = 0, |
26 FWL_BCDATTRIBUTE_CHARENCODING = 1 << 0, | 26 FWL_BCDATTRIBUTE_CHARENCODING = 1 << 0, |
27 FWL_BCDATTRIBUTE_MODULEHEIGHT = 1 << 1, | 27 FWL_BCDATTRIBUTE_MODULEHEIGHT = 1 << 1, |
28 FWL_BCDATTRIBUTE_MODULEWIDTH = 1 << 2, | 28 FWL_BCDATTRIBUTE_MODULEWIDTH = 1 << 2, |
29 FWL_BCDATTRIBUTE_DATALENGTH = 1 << 3, | 29 FWL_BCDATTRIBUTE_DATALENGTH = 1 << 3, |
30 FWL_BCDATTRIBUTE_CALCHECKSUM = 1 << 4, | 30 FWL_BCDATTRIBUTE_CALCHECKSUM = 1 << 4, |
31 FWL_BCDATTRIBUTE_PRINTCHECKSUM = 1 << 5, | 31 FWL_BCDATTRIBUTE_PRINTCHECKSUM = 1 << 5, |
32 FWL_BCDATTRIBUTE_TEXTLOCATION = 1 << 6, | 32 FWL_BCDATTRIBUTE_TEXTLOCATION = 1 << 6, |
33 FWL_BCDATTRIBUTE_WIDENARROWRATIO = 1 << 7, | 33 FWL_BCDATTRIBUTE_WIDENARROWRATIO = 1 << 7, |
34 FWL_BCDATTRIBUTE_STARTCHAR = 1 << 8, | 34 FWL_BCDATTRIBUTE_STARTCHAR = 1 << 8, |
35 FWL_BCDATTRIBUTE_ENDCHAR = 1 << 9, | 35 FWL_BCDATTRIBUTE_ENDCHAR = 1 << 9, |
36 FWL_BCDATTRIBUTE_VERSION = 1 << 10, | 36 FWL_BCDATTRIBUTE_VERSION = 1 << 10, |
37 FWL_BCDATTRIBUTE_ECLEVEL = 1 << 11, | 37 FWL_BCDATTRIBUTE_ECLEVEL = 1 << 11, |
38 FWL_BCDATTRIBUTE_TRUNCATED = 1 << 12 | 38 FWL_BCDATTRIBUTE_TRUNCATED = 1 << 12 |
39 }; | 39 }; |
40 | 40 |
41 class IFWL_BarcodeDP : public IFWL_DataProvider { | 41 class IFWL_BarcodeDP : public IFWL_Widget::DataProvider { |
42 public: | 42 public: |
43 virtual BC_CHAR_ENCODING GetCharEncoding() const = 0; | 43 virtual BC_CHAR_ENCODING GetCharEncoding() const = 0; |
44 virtual int32_t GetModuleHeight() const = 0; | 44 virtual int32_t GetModuleHeight() const = 0; |
45 virtual int32_t GetModuleWidth() const = 0; | 45 virtual int32_t GetModuleWidth() const = 0; |
46 virtual int32_t GetDataLength() const = 0; | 46 virtual int32_t GetDataLength() const = 0; |
47 virtual bool GetCalChecksum() const = 0; | 47 virtual bool GetCalChecksum() const = 0; |
48 virtual bool GetPrintChecksum() const = 0; | 48 virtual bool GetPrintChecksum() const = 0; |
49 virtual BC_TEXT_LOC GetTextLocation() const = 0; | 49 virtual BC_TEXT_LOC GetTextLocation() const = 0; |
50 virtual int32_t GetWideNarrowRatio() const = 0; | 50 virtual int32_t GetWideNarrowRatio() const = 0; |
51 virtual FX_CHAR GetStartChar() const = 0; | 51 virtual FX_CHAR GetStartChar() const = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
78 private: | 78 private: |
79 void GenerateBarcodeImageCache(); | 79 void GenerateBarcodeImageCache(); |
80 void CreateBarcodeEngine(); | 80 void CreateBarcodeEngine(); |
81 | 81 |
82 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; | 82 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; |
83 uint32_t m_dwStatus; | 83 uint32_t m_dwStatus; |
84 BC_TYPE m_type; | 84 BC_TYPE m_type; |
85 }; | 85 }; |
86 | 86 |
87 #endif // XFA_FWL_CORE_IFWL_BARCODE_H_ | 87 #endif // XFA_FWL_CORE_IFWL_BARCODE_H_ |
OLD | NEW |