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> |
(...skipping 25 matching lines...) Expand all Loading... |
36 FWL_BCDATTRIBUTE_ECLEVEL = 1 << 11, | 36 FWL_BCDATTRIBUTE_ECLEVEL = 1 << 11, |
37 FWL_BCDATTRIBUTE_TRUNCATED = 1 << 12 | 37 FWL_BCDATTRIBUTE_TRUNCATED = 1 << 12 |
38 }; | 38 }; |
39 | 39 |
40 class IFWL_BarcodeDP : public IFWL_EditDP { | 40 class IFWL_BarcodeDP : public IFWL_EditDP { |
41 public: | 41 public: |
42 virtual BC_CHAR_ENCODING GetCharEncoding() const = 0; | 42 virtual BC_CHAR_ENCODING GetCharEncoding() const = 0; |
43 virtual int32_t GetModuleHeight() const = 0; | 43 virtual int32_t GetModuleHeight() const = 0; |
44 virtual int32_t GetModuleWidth() const = 0; | 44 virtual int32_t GetModuleWidth() const = 0; |
45 virtual int32_t GetDataLength() const = 0; | 45 virtual int32_t GetDataLength() const = 0; |
46 virtual FX_BOOL GetCalChecksum() const = 0; | 46 virtual bool GetCalChecksum() const = 0; |
47 virtual FX_BOOL GetPrintChecksum() const = 0; | 47 virtual bool GetPrintChecksum() const = 0; |
48 virtual BC_TEXT_LOC GetTextLocation() const = 0; | 48 virtual BC_TEXT_LOC GetTextLocation() const = 0; |
49 virtual int32_t GetWideNarrowRatio() const = 0; | 49 virtual int32_t GetWideNarrowRatio() const = 0; |
50 virtual FX_CHAR GetStartChar() const = 0; | 50 virtual FX_CHAR GetStartChar() const = 0; |
51 virtual FX_CHAR GetEndChar() const = 0; | 51 virtual FX_CHAR GetEndChar() const = 0; |
52 virtual int32_t GetVersion() const = 0; | 52 virtual int32_t GetVersion() const = 0; |
53 virtual int32_t GetErrorCorrectionLevel() const = 0; | 53 virtual int32_t GetErrorCorrectionLevel() const = 0; |
54 virtual FX_BOOL GetTruncated() const = 0; | 54 virtual bool GetTruncated() const = 0; |
55 virtual uint32_t GetBarcodeAttributeMask() const = 0; | 55 virtual uint32_t GetBarcodeAttributeMask() const = 0; |
56 }; | 56 }; |
57 | 57 |
58 class IFWL_Barcode : public IFWL_Edit { | 58 class IFWL_Barcode : public IFWL_Edit { |
59 public: | 59 public: |
60 explicit IFWL_Barcode(const IFWL_App* app, | 60 explicit IFWL_Barcode(const IFWL_App* app, |
61 const CFWL_WidgetImpProperties& properties); | 61 const CFWL_WidgetImpProperties& properties); |
62 ~IFWL_Barcode() override; | 62 ~IFWL_Barcode() override; |
63 | 63 |
64 // IFWL_Widget | 64 // IFWL_Widget |
65 FWL_Type GetClassID() const override; | 65 FWL_Type GetClassID() const override; |
66 FWL_Error Update() override; | 66 FWL_Error Update() override; |
67 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 67 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
68 const CFX_Matrix* pMatrix = nullptr) override; | 68 const CFX_Matrix* pMatrix = nullptr) override; |
69 FWL_Error SetText(const CFX_WideString& wsText) override; | 69 FWL_Error SetText(const CFX_WideString& wsText) override; |
70 void OnProcessEvent(CFWL_Event* pEvent) override; | 70 void OnProcessEvent(CFWL_Event* pEvent) override; |
71 | 71 |
72 void SetType(BC_TYPE type); | 72 void SetType(BC_TYPE type); |
73 FX_BOOL IsProtectedType(); | 73 bool IsProtectedType(); |
74 | 74 |
75 protected: | 75 protected: |
76 void GenerateBarcodeImageCache(); | 76 void GenerateBarcodeImageCache(); |
77 void CreateBarcodeEngine(); | 77 void CreateBarcodeEngine(); |
78 | 78 |
79 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; | 79 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; |
80 uint32_t m_dwStatus; | 80 uint32_t m_dwStatus; |
81 BC_TYPE m_type; | 81 BC_TYPE m_type; |
82 }; | 82 }; |
83 | 83 |
84 #endif // XFA_FWL_CORE_IFWL_BARCODE_H_ | 84 #endif // XFA_FWL_CORE_IFWL_BARCODE_H_ |
OLD | NEW |