| 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 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 void CFWL_Barcode::SetModuleWidth(int32_t width) { | 42 void CFWL_Barcode::SetModuleWidth(int32_t width) { |
| 43 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH; | 43 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH; |
| 44 m_barcodeData.m_nModuleWidth = width; | 44 m_barcodeData.m_nModuleWidth = width; |
| 45 } | 45 } |
| 46 void CFWL_Barcode::SetDataLength(int32_t dataLength) { | 46 void CFWL_Barcode::SetDataLength(int32_t dataLength) { |
| 47 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH; | 47 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH; |
| 48 m_barcodeData.m_nDataLength = dataLength; | 48 m_barcodeData.m_nDataLength = dataLength; |
| 49 ToBarcode(GetWidget())->SetLimit(dataLength); | 49 ToBarcode(GetWidget())->SetLimit(dataLength); |
| 50 } | 50 } |
| 51 void CFWL_Barcode::SetCalChecksum(FX_BOOL calChecksum) { | 51 void CFWL_Barcode::SetCalChecksum(bool calChecksum) { |
| 52 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM; | 52 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM; |
| 53 m_barcodeData.m_bCalChecksum = calChecksum; | 53 m_barcodeData.m_bCalChecksum = calChecksum; |
| 54 } | 54 } |
| 55 void CFWL_Barcode::SetPrintChecksum(FX_BOOL printChecksum) { | 55 void CFWL_Barcode::SetPrintChecksum(bool printChecksum) { |
| 56 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM; | 56 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM; |
| 57 m_barcodeData.m_bPrintChecksum = printChecksum; | 57 m_barcodeData.m_bPrintChecksum = printChecksum; |
| 58 } | 58 } |
| 59 void CFWL_Barcode::SetTextLocation(BC_TEXT_LOC location) { | 59 void CFWL_Barcode::SetTextLocation(BC_TEXT_LOC location) { |
| 60 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TEXTLOCATION; | 60 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TEXTLOCATION; |
| 61 m_barcodeData.m_eTextLocation = location; | 61 m_barcodeData.m_eTextLocation = location; |
| 62 } | 62 } |
| 63 void CFWL_Barcode::SetWideNarrowRatio(int32_t ratio) { | 63 void CFWL_Barcode::SetWideNarrowRatio(int32_t ratio) { |
| 64 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_WIDENARROWRATIO; | 64 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_WIDENARROWRATIO; |
| 65 m_barcodeData.m_nWideNarrowRatio = ratio; | 65 m_barcodeData.m_nWideNarrowRatio = ratio; |
| 66 } | 66 } |
| 67 void CFWL_Barcode::SetStartChar(FX_CHAR startChar) { | 67 void CFWL_Barcode::SetStartChar(FX_CHAR startChar) { |
| 68 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; | 68 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; |
| 69 m_barcodeData.m_cStartChar = startChar; | 69 m_barcodeData.m_cStartChar = startChar; |
| 70 } | 70 } |
| 71 void CFWL_Barcode::SetEndChar(FX_CHAR endChar) { | 71 void CFWL_Barcode::SetEndChar(FX_CHAR endChar) { |
| 72 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; | 72 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; |
| 73 m_barcodeData.m_cEndChar = endChar; | 73 m_barcodeData.m_cEndChar = endChar; |
| 74 } | 74 } |
| 75 void CFWL_Barcode::SetVersion(int32_t version) { | 75 void CFWL_Barcode::SetVersion(int32_t version) { |
| 76 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION; | 76 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION; |
| 77 m_barcodeData.m_nVersion = version; | 77 m_barcodeData.m_nVersion = version; |
| 78 } | 78 } |
| 79 void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) { | 79 void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) { |
| 80 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; | 80 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; |
| 81 m_barcodeData.m_nECLevel = ecLevel; | 81 m_barcodeData.m_nECLevel = ecLevel; |
| 82 } | 82 } |
| 83 void CFWL_Barcode::SetTruncated(FX_BOOL truncated) { | 83 void CFWL_Barcode::SetTruncated(bool truncated) { |
| 84 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; | 84 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; |
| 85 m_barcodeData.m_bTruncated = truncated; | 85 m_barcodeData.m_bTruncated = truncated; |
| 86 } | 86 } |
| 87 void CFWL_Barcode::ResetBarcodeAttributes() { | 87 void CFWL_Barcode::ResetBarcodeAttributes() { |
| 88 m_barcodeData.m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; | 88 m_barcodeData.m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CFWL_Barcode::SetType(BC_TYPE type) { | 91 void CFWL_Barcode::SetType(BC_TYPE type) { |
| 92 if (GetWidget()) | 92 if (GetWidget()) |
| 93 ToBarcode(GetWidget())->SetType(type); | 93 ToBarcode(GetWidget())->SetType(type); |
| 94 } | 94 } |
| 95 | 95 |
| 96 FX_BOOL CFWL_Barcode::IsProtectedType() { | 96 bool CFWL_Barcode::IsProtectedType() { |
| 97 return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : FALSE; | 97 return GetWidget() ? ToBarcode(GetWidget())->IsProtectedType() : false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 CFWL_Barcode::CFWL_BarcodeDP::CFWL_BarcodeDP() | 100 CFWL_Barcode::CFWL_BarcodeDP::CFWL_BarcodeDP() |
| 101 : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} | 101 : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} |
| 102 | 102 |
| 103 FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, | 103 FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, |
| 104 CFX_WideString& wsCaption) { | 104 CFX_WideString& wsCaption) { |
| 105 return FWL_Error::Succeeded; | 105 return FWL_Error::Succeeded; |
| 106 } | 106 } |
| 107 | 107 |
| 108 BC_CHAR_ENCODING CFWL_Barcode::CFWL_BarcodeDP::GetCharEncoding() const { | 108 BC_CHAR_ENCODING CFWL_Barcode::CFWL_BarcodeDP::GetCharEncoding() const { |
| 109 return m_eCharEncoding; | 109 return m_eCharEncoding; |
| 110 } | 110 } |
| 111 | 111 |
| 112 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleHeight() const { | 112 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleHeight() const { |
| 113 return m_nModuleHeight; | 113 return m_nModuleHeight; |
| 114 } | 114 } |
| 115 | 115 |
| 116 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleWidth() const { | 116 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleWidth() const { |
| 117 return m_nModuleWidth; | 117 return m_nModuleWidth; |
| 118 } | 118 } |
| 119 | 119 |
| 120 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetDataLength() const { | 120 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetDataLength() const { |
| 121 return m_nDataLength; | 121 return m_nDataLength; |
| 122 } | 122 } |
| 123 | 123 |
| 124 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() const { | 124 bool CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() const { |
| 125 return m_bCalChecksum; | 125 return m_bCalChecksum; |
| 126 } | 126 } |
| 127 | 127 |
| 128 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() const { | 128 bool CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() const { |
| 129 return m_bPrintChecksum; | 129 return m_bPrintChecksum; |
| 130 } | 130 } |
| 131 | 131 |
| 132 BC_TEXT_LOC CFWL_Barcode::CFWL_BarcodeDP::GetTextLocation() const { | 132 BC_TEXT_LOC CFWL_Barcode::CFWL_BarcodeDP::GetTextLocation() const { |
| 133 return m_eTextLocation; | 133 return m_eTextLocation; |
| 134 } | 134 } |
| 135 | 135 |
| 136 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetWideNarrowRatio() const { | 136 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetWideNarrowRatio() const { |
| 137 return m_nWideNarrowRatio; | 137 return m_nWideNarrowRatio; |
| 138 } | 138 } |
| 139 | 139 |
| 140 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetStartChar() const { | 140 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetStartChar() const { |
| 141 return m_cStartChar; | 141 return m_cStartChar; |
| 142 } | 142 } |
| 143 | 143 |
| 144 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetEndChar() const { | 144 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetEndChar() const { |
| 145 return m_cEndChar; | 145 return m_cEndChar; |
| 146 } | 146 } |
| 147 | 147 |
| 148 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetVersion() const { | 148 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetVersion() const { |
| 149 return m_nVersion; | 149 return m_nVersion; |
| 150 } | 150 } |
| 151 | 151 |
| 152 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetErrorCorrectionLevel() const { | 152 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetErrorCorrectionLevel() const { |
| 153 return m_nECLevel; | 153 return m_nECLevel; |
| 154 } | 154 } |
| 155 | 155 |
| 156 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const { | 156 bool CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const { |
| 157 return m_bTruncated; | 157 return m_bTruncated; |
| 158 } | 158 } |
| 159 | 159 |
| 160 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() const { | 160 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() const { |
| 161 return m_dwAttributeMask; | 161 return m_dwAttributeMask; |
| 162 } | 162 } |
| OLD | NEW |