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_CFWL_BARCODE_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_BARCODE_H_ |
8 #define XFA_FWL_CORE_CFWL_BARCODE_H_ | 8 #define XFA_FWL_CORE_CFWL_BARCODE_H_ |
9 | 9 |
10 #include "xfa/fwl/core/cfwl_edit.h" | 10 #include "xfa/fwl/core/cfwl_edit.h" |
11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
12 #include "xfa/fwl/core/ifwl_barcode.h" | 12 #include "xfa/fwl/core/ifwl_barcode.h" |
13 | 13 |
14 class CFWL_Barcode : public CFWL_Edit, public IFWL_BarcodeDP { | 14 class CFWL_Barcode : public CFWL_Edit, public IFWL_BarcodeDP { |
15 public: | 15 public: |
16 CFWL_Barcode(const IFWL_App*); | 16 CFWL_Barcode(const IFWL_App*); |
17 ~CFWL_Barcode() override; | 17 ~CFWL_Barcode() override; |
18 | 18 |
19 void Initialize(); | 19 void Initialize(); |
20 | 20 |
21 void SetType(BC_TYPE type); | |
22 bool IsProtectedType(); | |
23 | |
24 void SetCharEncoding(BC_CHAR_ENCODING encoding); | |
25 void SetModuleHeight(int32_t height); | |
26 void SetModuleWidth(int32_t width); | |
27 void SetDataLength(int32_t dataLength); | |
28 void SetCalChecksum(bool calChecksum); | |
29 void SetPrintChecksum(bool printChecksum); | |
30 void SetTextLocation(BC_TEXT_LOC location); | |
31 void SetWideNarrowRatio(int32_t ratio); | |
32 void SetStartChar(FX_CHAR startChar); | |
33 void SetEndChar(FX_CHAR endChar); | |
34 void SetVersion(int32_t version); | |
35 void SetErrorCorrectionLevel(int32_t ecLevel); | |
36 void SetTruncated(bool truncated); | |
37 void ResetBarcodeAttributes(); | |
38 | |
39 // IFWL_DataProvider | 21 // IFWL_DataProvider |
40 void GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override; | 22 void GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) override; |
41 | 23 |
42 // IFWL_BarcodeDP | 24 // IFWL_BarcodeDP |
43 BC_CHAR_ENCODING GetCharEncoding() const override; | 25 BC_CHAR_ENCODING GetCharEncoding() const override; |
44 int32_t GetModuleHeight() const override; | 26 int32_t GetModuleHeight() const override; |
45 int32_t GetModuleWidth() const override; | 27 int32_t GetModuleWidth() const override; |
46 int32_t GetDataLength() const override; | 28 int32_t GetDataLength() const override; |
47 bool GetCalChecksum() const override; | 29 bool GetCalChecksum() const override; |
48 bool GetPrintChecksum() const override; | 30 bool GetPrintChecksum() const override; |
49 BC_TEXT_LOC GetTextLocation() const override; | 31 BC_TEXT_LOC GetTextLocation() const override; |
50 int32_t GetWideNarrowRatio() const override; | 32 int32_t GetWideNarrowRatio() const override; |
51 FX_CHAR GetStartChar() const override; | 33 FX_CHAR GetStartChar() const override; |
52 FX_CHAR GetEndChar() const override; | 34 FX_CHAR GetEndChar() const override; |
53 int32_t GetVersion() const override; | 35 int32_t GetVersion() const override; |
54 int32_t GetErrorCorrectionLevel() const override; | 36 int32_t GetErrorCorrectionLevel() const override; |
55 bool GetTruncated() const override; | 37 bool GetTruncated() const override; |
56 uint32_t GetBarcodeAttributeMask() const override; | 38 uint32_t GetBarcodeAttributeMask() const override; |
57 | 39 |
| 40 void SetType(BC_TYPE type); |
| 41 bool IsProtectedType(); |
| 42 |
| 43 void SetCharEncoding(BC_CHAR_ENCODING encoding); |
| 44 void SetModuleHeight(int32_t height); |
| 45 void SetModuleWidth(int32_t width); |
| 46 void SetDataLength(int32_t dataLength); |
| 47 void SetCalChecksum(bool calChecksum); |
| 48 void SetPrintChecksum(bool printChecksum); |
| 49 void SetTextLocation(BC_TEXT_LOC location); |
| 50 void SetWideNarrowRatio(int32_t ratio); |
| 51 void SetStartChar(FX_CHAR startChar); |
| 52 void SetEndChar(FX_CHAR endChar); |
| 53 void SetErrorCorrectionLevel(int32_t ecLevel); |
| 54 void SetTruncated(bool truncated); |
| 55 |
58 private: | 56 private: |
59 BC_CHAR_ENCODING m_eCharEncoding; | 57 BC_CHAR_ENCODING m_eCharEncoding; |
60 int32_t m_nModuleHeight; | 58 int32_t m_nModuleHeight; |
61 int32_t m_nModuleWidth; | 59 int32_t m_nModuleWidth; |
62 int32_t m_nDataLength; | 60 int32_t m_nDataLength; |
63 bool m_bCalChecksum; | 61 bool m_bCalChecksum; |
64 bool m_bPrintChecksum; | 62 bool m_bPrintChecksum; |
65 BC_TEXT_LOC m_eTextLocation; | 63 BC_TEXT_LOC m_eTextLocation; |
66 int32_t m_nWideNarrowRatio; | 64 int32_t m_nWideNarrowRatio; |
67 FX_CHAR m_cStartChar; | 65 FX_CHAR m_cStartChar; |
68 FX_CHAR m_cEndChar; | 66 FX_CHAR m_cEndChar; |
69 int32_t m_nVersion; | |
70 int32_t m_nECLevel; | 67 int32_t m_nECLevel; |
71 bool m_bTruncated; | 68 bool m_bTruncated; |
72 uint32_t m_dwAttributeMask; | 69 uint32_t m_dwAttributeMask; |
73 }; | 70 }; |
74 | 71 |
75 #endif // XFA_FWL_CORE_CFWL_BARCODE_H_ | 72 #endif // XFA_FWL_CORE_CFWL_BARCODE_H_ |
OLD | NEW |