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