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 #include "xfa/fwl/core/cfwl_barcode.h" | 7 #include "xfa/fwl/core/cfwl_barcode.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void CFWL_Barcode::SetStartChar(FX_CHAR startChar) { | 76 void CFWL_Barcode::SetStartChar(FX_CHAR startChar) { |
77 m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; | 77 m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; |
78 m_cStartChar = startChar; | 78 m_cStartChar = startChar; |
79 } | 79 } |
80 | 80 |
81 void CFWL_Barcode::SetEndChar(FX_CHAR endChar) { | 81 void CFWL_Barcode::SetEndChar(FX_CHAR endChar) { |
82 m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; | 82 m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; |
83 m_cEndChar = endChar; | 83 m_cEndChar = endChar; |
84 } | 84 } |
85 | 85 |
86 void CFWL_Barcode::SetVersion(int32_t version) { | |
87 m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION; | |
88 m_nVersion = version; | |
89 } | |
90 | |
91 void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) { | 86 void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) { |
92 m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; | 87 m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; |
93 m_nECLevel = ecLevel; | 88 m_nECLevel = ecLevel; |
94 } | 89 } |
95 | 90 |
96 void CFWL_Barcode::SetTruncated(bool truncated) { | 91 void CFWL_Barcode::SetTruncated(bool truncated) { |
97 m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; | 92 m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; |
98 m_bTruncated = truncated; | 93 m_bTruncated = truncated; |
99 } | 94 } |
100 | 95 |
101 void CFWL_Barcode::ResetBarcodeAttributes() { | |
102 m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; | |
103 } | |
104 | |
105 void CFWL_Barcode::SetType(BC_TYPE type) { | 96 void CFWL_Barcode::SetType(BC_TYPE type) { |
106 if (GetWidget()) | 97 if (GetWidget()) |
107 ToBarcode(GetWidget())->SetType(type); | 98 ToBarcode(GetWidget())->SetType(type); |
108 } | 99 } |
109 | 100 |
110 bool CFWL_Barcode::IsProtectedType() { | 101 bool CFWL_Barcode::IsProtectedType() { |
111 return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : false; | 102 return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : false; |
112 } | 103 } |
113 | 104 |
114 void CFWL_Barcode::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) { | 105 void CFWL_Barcode::GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 139 |
149 FX_CHAR CFWL_Barcode::GetStartChar() const { | 140 FX_CHAR CFWL_Barcode::GetStartChar() const { |
150 return m_cStartChar; | 141 return m_cStartChar; |
151 } | 142 } |
152 | 143 |
153 FX_CHAR CFWL_Barcode::GetEndChar() const { | 144 FX_CHAR CFWL_Barcode::GetEndChar() const { |
154 return m_cEndChar; | 145 return m_cEndChar; |
155 } | 146 } |
156 | 147 |
157 int32_t CFWL_Barcode::GetVersion() const { | 148 int32_t CFWL_Barcode::GetVersion() const { |
158 return m_nVersion; | 149 return 0; |
159 } | 150 } |
160 | 151 |
161 int32_t CFWL_Barcode::GetErrorCorrectionLevel() const { | 152 int32_t CFWL_Barcode::GetErrorCorrectionLevel() const { |
162 return m_nECLevel; | 153 return m_nECLevel; |
163 } | 154 } |
164 | 155 |
165 bool CFWL_Barcode::GetTruncated() const { | 156 bool CFWL_Barcode::GetTruncated() const { |
166 return m_bTruncated; | 157 return m_bTruncated; |
167 } | 158 } |
168 | 159 |
169 uint32_t CFWL_Barcode::GetBarcodeAttributeMask() const { | 160 uint32_t CFWL_Barcode::GetBarcodeAttributeMask() const { |
170 return m_dwAttributeMask; | 161 return m_dwAttributeMask; |
171 } | 162 } |
OLD | NEW |