OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #include "xfa/fwl/lightwidget/cfwl_barcode.h" | |
8 | |
9 #include <memory> | |
10 | |
11 IFWL_Barcode* CFWL_Barcode::GetWidget() { | |
12 return static_cast<IFWL_Barcode*>(m_pIface.get()); | |
13 } | |
14 | |
15 const IFWL_Barcode* CFWL_Barcode::GetWidget() const { | |
16 return static_cast<IFWL_Barcode*>(m_pIface.get()); | |
17 } | |
18 | |
19 FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { | |
20 if (m_pIface) | |
21 return FWL_Error::Indefinite; | |
22 if (pProperties) { | |
23 *m_pProperties = *pProperties; | |
24 } | |
25 std::unique_ptr<IFWL_Barcode> pBarcode( | |
26 new IFWL_Barcode(m_pProperties->MakeWidgetImpProperties(&m_barcodeData))); | |
27 FWL_Error ret = pBarcode->Initialize(); | |
28 if (ret != FWL_Error::Succeeded) { | |
29 return ret; | |
30 } | |
31 m_pIface = std::move(pBarcode); | |
32 CFWL_Widget::Initialize(); | |
33 return FWL_Error::Succeeded; | |
34 } | |
35 | |
36 CFWL_Barcode::CFWL_Barcode() {} | |
37 | |
38 CFWL_Barcode::~CFWL_Barcode() {} | |
39 | |
40 void CFWL_Barcode::SetType(BC_TYPE type) { | |
41 if (GetWidget()) | |
42 GetWidget()->SetType(type); | |
43 } | |
44 | |
45 FX_BOOL CFWL_Barcode::IsProtectedType() { | |
46 return GetWidget() ? GetWidget()->IsProtectedType() : FALSE; | |
47 } | |
48 | |
49 CFWL_Barcode::CFWL_BarcodeDP::CFWL_BarcodeDP() | |
50 : m_dwAttributeMask(FWL_BCDATTRIBUTE_NONE) {} | |
51 | |
52 FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, | |
53 CFX_WideString& wsCaption) { | |
54 return FWL_Error::Succeeded; | |
55 } | |
56 | |
57 BC_CHAR_ENCODING CFWL_Barcode::CFWL_BarcodeDP::GetCharEncoding() { | |
58 return m_eCharEncoding; | |
59 } | |
60 | |
61 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleHeight() { | |
62 return m_nModuleHeight; | |
63 } | |
64 | |
65 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetModuleWidth() { | |
66 return m_nModuleWidth; | |
67 } | |
68 | |
69 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetDataLength() { | |
70 return m_nDataLength; | |
71 } | |
72 | |
73 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetCalChecksum() { | |
74 return m_nCalChecksum; | |
75 } | |
76 | |
77 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetPrintChecksum() { | |
78 return m_bPrintChecksum; | |
79 } | |
80 | |
81 BC_TEXT_LOC CFWL_Barcode::CFWL_BarcodeDP::GetTextLocation() { | |
82 return m_eTextLocation; | |
83 } | |
84 | |
85 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetWideNarrowRatio() { | |
86 return m_nWideNarrowRatio; | |
87 } | |
88 | |
89 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetStartChar() { | |
90 return m_cStartChar; | |
91 } | |
92 | |
93 FX_CHAR CFWL_Barcode::CFWL_BarcodeDP::GetEndChar() { | |
94 return m_cEndChar; | |
95 } | |
96 | |
97 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetVersion() { | |
98 return m_nVersion; | |
99 } | |
100 | |
101 int32_t CFWL_Barcode::CFWL_BarcodeDP::GetErrorCorrectionLevel() { | |
102 return m_nECLevel; | |
103 } | |
104 | |
105 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() { | |
106 return m_bTruncated; | |
107 } | |
108 | |
109 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() { | |
110 return m_dwAttributeMask; | |
111 } | |
OLD | NEW |