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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 CFWL_Barcode* CFWL_Barcode::Create() { | 8 CFWL_Barcode* CFWL_Barcode::Create() { |
9 return new CFWL_Barcode; | 9 return new CFWL_Barcode; |
10 } | 10 } |
11 FWL_ERR CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { | 11 FWL_ERR CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { |
12 if (m_pIface) | 12 if (m_pIface) |
13 return FWL_ERR_Indefinite; | 13 return FWL_ERR_Indefinite; |
14 if (pProperties) { | 14 if (pProperties) { |
15 *m_pProperties = *pProperties; | 15 *m_pProperties = *pProperties; |
16 } | 16 } |
17 m_pIface = IFWL_Barcode::Create(); | 17 m_pIface = new IFWL_Barcode; |
18 FWL_ERR ret = | 18 FWL_ERR ret = |
19 ((IFWL_Barcode*)m_pIface) | 19 ((IFWL_Barcode*)m_pIface) |
20 ->Initialize(m_pProperties->MakeWidgetImpProperties(&m_barcodeData), | 20 ->Initialize(m_pProperties->MakeWidgetImpProperties(&m_barcodeData), |
21 nullptr); | 21 nullptr); |
22 if (ret == FWL_ERR_Succeeded) { | 22 if (ret == FWL_ERR_Succeeded) { |
23 CFWL_Widget::Initialize(); | 23 CFWL_Widget::Initialize(); |
24 } | 24 } |
25 return ret; | 25 return ret; |
26 } | 26 } |
27 CFWL_Barcode::CFWL_Barcode() {} | 27 CFWL_Barcode::CFWL_Barcode() {} |
28 CFWL_Barcode::~CFWL_Barcode() {} | 28 CFWL_Barcode::~CFWL_Barcode() {} |
29 void CFWL_Barcode::SetType(BC_TYPE type) { | 29 void CFWL_Barcode::SetType(BC_TYPE type) { |
30 if (!m_pIface) | 30 if (!m_pIface) |
31 return; | 31 return; |
32 ((IFWL_Barcode*)m_pIface)->SetType(type); | 32 ((IFWL_Barcode*)m_pIface)->SetType(type); |
33 } | 33 } |
34 FX_BOOL CFWL_Barcode::IsProtectedType() { | 34 FX_BOOL CFWL_Barcode::IsProtectedType() { |
35 if (!m_pIface) | 35 if (!m_pIface) |
36 return 0; | 36 return 0; |
37 return ((IFWL_Barcode*)m_pIface)->IsProtectedType(); | 37 return ((IFWL_Barcode*)m_pIface)->IsProtectedType(); |
38 } | 38 } |
39 FWL_ERR CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, | 39 FWL_ERR CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, |
40 CFX_WideString& wsCaption) { | 40 CFX_WideString& wsCaption) { |
41 return FWL_ERR_Succeeded; | 41 return FWL_ERR_Succeeded; |
42 } | 42 } |
OLD | NEW |