| 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/basewidget/fwl_barcodeimp.h" | 7 #include "xfa/fwl/basewidget/fwl_barcodeimp.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/basewidget/fwl_editimp.h" | 9 #include "xfa/fwl/basewidget/fwl_editimp.h" |
| 10 #include "xfa/fwl/basewidget/fxmath_barcodeimp.h" | 10 #include "xfa/fwl/basewidget/fxmath_barcodeimp.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 CFWL_BarcodeImp::CFWL_BarcodeImp(const CFWL_WidgetImpProperties& properties, | 32 CFWL_BarcodeImp::CFWL_BarcodeImp(const CFWL_WidgetImpProperties& properties, |
| 33 IFWL_Widget* pOuter) | 33 IFWL_Widget* pOuter) |
| 34 : CFWL_EditImp(properties, pOuter), | 34 : CFWL_EditImp(properties, pOuter), |
| 35 m_pBarcodeEngine(NULL), | 35 m_pBarcodeEngine(NULL), |
| 36 m_dwStatus(0), | 36 m_dwStatus(0), |
| 37 m_type(BC_UNKNOWN) {} | 37 m_type(BC_UNKNOWN) {} |
| 38 CFWL_BarcodeImp::~CFWL_BarcodeImp() { | 38 CFWL_BarcodeImp::~CFWL_BarcodeImp() { |
| 39 ReleaseBarcodeEngine(); | 39 ReleaseBarcodeEngine(); |
| 40 } | 40 } |
| 41 |
| 41 FWL_Error CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { | 42 FWL_Error CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { |
| 42 wsClass = FWL_CLASS_Barcode; | 43 wsClass = FWL_CLASS_Barcode; |
| 43 return FWL_Error::Succeeded; | 44 return FWL_Error::Succeeded; |
| 44 } | 45 } |
| 45 uint32_t CFWL_BarcodeImp::GetClassID() const { | 46 |
| 46 return FWL_CLASSHASH_Barcode; | 47 FWL_Type CFWL_BarcodeImp::GetClassID() const { |
| 48 return FWL_Type::Barcode; |
| 47 } | 49 } |
| 50 |
| 48 FWL_Error CFWL_BarcodeImp::Initialize() { | 51 FWL_Error CFWL_BarcodeImp::Initialize() { |
| 49 if (!m_pDelegate) { | 52 if (!m_pDelegate) { |
| 50 m_pDelegate = new CFWL_BarcodeImpDelegate(this); | 53 m_pDelegate = new CFWL_BarcodeImpDelegate(this); |
| 51 } | 54 } |
| 52 if (CFWL_EditImp::Initialize() != FWL_Error::Succeeded) | 55 if (CFWL_EditImp::Initialize() != FWL_Error::Succeeded) |
| 53 return FWL_Error::Indefinite; | 56 return FWL_Error::Indefinite; |
| 54 return FWL_Error::Succeeded; | 57 return FWL_Error::Succeeded; |
| 55 } | 58 } |
| 56 FWL_Error CFWL_BarcodeImp::Finalize() { | 59 FWL_Error CFWL_BarcodeImp::Finalize() { |
| 57 delete m_pDelegate; | 60 delete m_pDelegate; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 : CFWL_EditImpDelegate(pOwner) {} | 224 : CFWL_EditImpDelegate(pOwner) {} |
| 222 | 225 |
| 223 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 226 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 224 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { | 227 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { |
| 225 CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner); | 228 CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner); |
| 226 pOwner->ReleaseBarcodeEngine(); | 229 pOwner->ReleaseBarcodeEngine(); |
| 227 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; | 230 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; |
| 228 } | 231 } |
| 229 CFWL_EditImpDelegate::OnProcessEvent(pEvent); | 232 CFWL_EditImpDelegate::OnProcessEvent(pEvent); |
| 230 } | 233 } |
| OLD | NEW |