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_LIGHTWIDGET_CFWL_BARCODE_H_ | 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ |
8 #define XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ | 8 #define XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ |
9 | 9 |
10 #include "xfa/fwl/basewidget/ifwl_barcode.h" | 10 #include "xfa/fwl/basewidget/ifwl_barcode.h" |
11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
12 #include "xfa/fwl/lightwidget/cfwl_edit.h" | 12 #include "xfa/fwl/lightwidget/cfwl_edit.h" |
13 | 13 |
14 class CFWL_Widget; | 14 class CFWL_Widget; |
15 class CFWL_WidgetProperties; | 15 class CFWL_WidgetProperties; |
16 | 16 |
17 class CFWL_Barcode : public CFWL_Edit { | 17 class CFWL_Barcode : public CFWL_Edit { |
18 public: | 18 public: |
19 static CFWL_Barcode* Create(); | 19 CFWL_Barcode(); |
| 20 ~CFWL_Barcode() override; |
20 | 21 |
21 IFWL_Barcode* GetWidget() override; | 22 IFWL_Barcode* GetWidget() override; |
22 const IFWL_Barcode* GetWidget() const override; | 23 const IFWL_Barcode* GetWidget() const override; |
23 | 24 |
24 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); | 25 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); |
25 void SetType(BC_TYPE type); | 26 void SetType(BC_TYPE type); |
26 FX_BOOL IsProtectedType(); | 27 FX_BOOL IsProtectedType(); |
27 | 28 |
28 void SetCharEncoding(BC_CHAR_ENCODING encoding) { | 29 void SetCharEncoding(BC_CHAR_ENCODING encoding) { |
29 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; | 30 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 77 } |
77 void SetTruncated(FX_BOOL truncated) { | 78 void SetTruncated(FX_BOOL truncated) { |
78 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; | 79 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; |
79 m_barcodeData.m_bTruncated = truncated; | 80 m_barcodeData.m_bTruncated = truncated; |
80 } | 81 } |
81 void ResetBarcodeAttributes() { | 82 void ResetBarcodeAttributes() { |
82 m_barcodeData.m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; | 83 m_barcodeData.m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; |
83 } | 84 } |
84 | 85 |
85 protected: | 86 protected: |
86 CFWL_Barcode(); | |
87 ~CFWL_Barcode() override; | |
88 | |
89 class CFWL_BarcodeDP : public IFWL_BarcodeDP { | 87 class CFWL_BarcodeDP : public IFWL_BarcodeDP { |
90 public: | 88 public: |
91 CFWL_BarcodeDP(); | 89 CFWL_BarcodeDP(); |
92 | 90 |
93 // IFWL_DataProvider | 91 // IFWL_DataProvider |
94 FWL_Error GetCaption(IFWL_Widget* pWidget, | 92 FWL_Error GetCaption(IFWL_Widget* pWidget, |
95 CFX_WideString& wsCaption) override; | 93 CFX_WideString& wsCaption) override; |
96 | 94 |
97 // IFWL_BarcodeDP | 95 // IFWL_BarcodeDP |
98 BC_CHAR_ENCODING GetCharEncoding() override; | 96 BC_CHAR_ENCODING GetCharEncoding() override; |
(...skipping 22 matching lines...) Expand all Loading... |
121 int32_t m_nVersion; | 119 int32_t m_nVersion; |
122 int32_t m_nECLevel; | 120 int32_t m_nECLevel; |
123 FX_BOOL m_bTruncated; | 121 FX_BOOL m_bTruncated; |
124 uint32_t m_dwAttributeMask; | 122 uint32_t m_dwAttributeMask; |
125 }; | 123 }; |
126 | 124 |
127 CFWL_BarcodeDP m_barcodeData; | 125 CFWL_BarcodeDP m_barcodeData; |
128 }; | 126 }; |
129 | 127 |
130 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ | 128 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ |
OLD | NEW |