| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 m_barcodeData.m_nVersion = version; | 67 m_barcodeData.m_nVersion = version; |
| 68 } | 68 } |
| 69 void SetErrorCorrectionLevel(int32_t ecLevel) { | 69 void SetErrorCorrectionLevel(int32_t ecLevel) { |
| 70 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; | 70 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; |
| 71 m_barcodeData.m_nECLevel = ecLevel; | 71 m_barcodeData.m_nECLevel = ecLevel; |
| 72 } | 72 } |
| 73 void SetTruncated(FX_BOOL truncated) { | 73 void SetTruncated(FX_BOOL truncated) { |
| 74 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; | 74 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; |
| 75 m_barcodeData.m_bTruncated = truncated; | 75 m_barcodeData.m_bTruncated = truncated; |
| 76 } | 76 } |
| 77 void ResetBarcodeAttributes() { m_barcodeData.m_dwAttributeMask = 0; } | 77 void ResetBarcodeAttributes() { |
| 78 m_barcodeData.m_dwAttributeMask = FWL_BCDATTRIBUTE_NONE; |
| 79 } |
| 78 | 80 |
| 79 protected: | 81 protected: |
| 80 CFWL_Barcode(); | 82 CFWL_Barcode(); |
| 81 virtual ~CFWL_Barcode(); | 83 virtual ~CFWL_Barcode(); |
| 82 | 84 |
| 83 class CFWL_BarcodeDP : public IFWL_BarcodeDP { | 85 class CFWL_BarcodeDP : public IFWL_BarcodeDP { |
| 84 public: | 86 public: |
| 85 virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); | 87 CFWL_BarcodeDP() : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} |
| 88 |
| 89 FWL_ERR GetCaption(IFWL_Widget* pWidget, |
| 90 CFX_WideString& wsCaption) override; |
| 91 BC_CHAR_ENCODING GetCharEncoding() override { return m_eCharEncoding; } |
| 92 int32_t GetModuleHeight() override { return m_nModuleHeight; } |
| 93 int32_t GetModuleWidth() override { return m_nModuleWidth; } |
| 94 int32_t GetDataLength() override { return m_nDataLength; } |
| 95 int32_t GetCalChecksum() override { return m_nCalChecksum; } |
| 96 FX_BOOL GetPrintChecksum() override { return m_bPrintChecksum; } |
| 97 BC_TEXT_LOC GetTextLocation() override { return m_eTextLocation; } |
| 98 int32_t GetWideNarrowRatio() override { return m_nWideNarrowRatio; } |
| 99 FX_CHAR GetStartChar() override { return m_cStartChar; } |
| 100 FX_CHAR GetEndChar() override { return m_cEndChar; } |
| 101 int32_t GetVersion() override { return m_nVersion; } |
| 102 int32_t GetErrorCorrectionLevel() override { return m_nECLevel; } |
| 103 FX_BOOL GetTruncated() override { return m_bTruncated; } |
| 104 uint32_t GetBarcodeAttributeMask() override { return m_dwAttributeMask; } |
| 105 |
| 86 BC_CHAR_ENCODING m_eCharEncoding; | 106 BC_CHAR_ENCODING m_eCharEncoding; |
| 87 virtual BC_CHAR_ENCODING GetCharEncoding() { return m_eCharEncoding; } | |
| 88 int32_t m_nModuleHeight, m_nModuleWidth; | 107 int32_t m_nModuleHeight, m_nModuleWidth; |
| 89 virtual int32_t GetModuleHeight() { return m_nModuleHeight; } | |
| 90 virtual int32_t GetModuleWidth() { return m_nModuleWidth; } | |
| 91 int32_t m_nDataLength; | 108 int32_t m_nDataLength; |
| 92 virtual int32_t GetDataLength() { return m_nDataLength; } | |
| 93 int32_t m_nCalChecksum; | 109 int32_t m_nCalChecksum; |
| 94 virtual int32_t GetCalChecksum() { return m_nCalChecksum; } | |
| 95 FX_BOOL m_bPrintChecksum; | 110 FX_BOOL m_bPrintChecksum; |
| 96 virtual FX_BOOL GetPrintChecksum() { return m_bPrintChecksum; } | 111 BC_TEXT_LOC m_eTextLocation; |
| 112 int32_t m_nWideNarrowRatio; |
| 113 FX_CHAR m_cStartChar, m_cEndChar; |
| 114 int32_t m_nVersion; |
| 115 int32_t m_nECLevel; |
| 116 FX_BOOL m_bTruncated; |
| 117 uint32_t m_dwAttributeMask; |
| 118 }; |
| 97 | 119 |
| 98 BC_TEXT_LOC m_eTextLocation; | |
| 99 virtual BC_TEXT_LOC GetTextLocation() { return m_eTextLocation; } | |
| 100 int32_t m_nWideNarrowRatio; | |
| 101 virtual int32_t GetWideNarrowRatio() { return m_nWideNarrowRatio; } | |
| 102 FX_CHAR m_cStartChar, m_cEndChar; | |
| 103 virtual FX_CHAR GetStartChar() { return m_cStartChar; } | |
| 104 virtual FX_CHAR GetEndChar() { return m_cEndChar; } | |
| 105 int32_t m_nVersion; | |
| 106 virtual int32_t GetVersion() { return m_nVersion; } | |
| 107 int32_t m_nECLevel; | |
| 108 virtual int32_t GetErrorCorrectionLevel() { return m_nECLevel; } | |
| 109 FX_BOOL m_bTruncated; | |
| 110 virtual FX_BOOL GetTruncated() { return m_bTruncated; } | |
| 111 uint32_t m_dwAttributeMask; | |
| 112 virtual uint32_t GetBarcodeAttributeMask() { return m_dwAttributeMask; } | |
| 113 | |
| 114 public: | |
| 115 CFWL_BarcodeDP() : m_dwAttributeMask(0) {} | |
| 116 }; | |
| 117 CFWL_BarcodeDP m_barcodeData; | 120 CFWL_BarcodeDP m_barcodeData; |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ | 123 #endif // XFA_FWL_LIGHTWIDGET_CFWL_BARCODE_H_ |
| OLD | NEW |