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 24 matching lines...) Expand all Loading... |
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 FWL_ERR CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { | 41 FWL_ERR CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { |
42 wsClass = FWL_CLASS_Barcode; | 42 wsClass = FWL_CLASS_Barcode; |
43 return FWL_ERR_Succeeded; | 43 return FWL_ERR_Succeeded; |
44 } | 44 } |
45 uint32_t CFWL_BarcodeImp::GetClassID() const { | 45 |
46 return FWL_CLASSHASH_Barcode; | |
47 } | |
48 FWL_ERR CFWL_BarcodeImp::Initialize() { | 46 FWL_ERR CFWL_BarcodeImp::Initialize() { |
49 if (!m_pDelegate) { | 47 if (!m_pDelegate) { |
50 m_pDelegate = new CFWL_BarcodeImpDelegate(this); | 48 m_pDelegate = new CFWL_BarcodeImpDelegate(this); |
51 } | 49 } |
52 if (CFWL_EditImp::Initialize() != FWL_ERR_Succeeded) | 50 if (CFWL_EditImp::Initialize() != FWL_ERR_Succeeded) |
53 return FWL_ERR_Indefinite; | 51 return FWL_ERR_Indefinite; |
54 return FWL_ERR_Succeeded; | 52 return FWL_ERR_Succeeded; |
55 } | 53 } |
56 FWL_ERR CFWL_BarcodeImp::Finalize() { | 54 FWL_ERR CFWL_BarcodeImp::Finalize() { |
57 delete m_pDelegate; | 55 delete m_pDelegate; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 : CFWL_EditImpDelegate(pOwner) {} | 219 : CFWL_EditImpDelegate(pOwner) {} |
222 | 220 |
223 FWL_ERR CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 221 FWL_ERR CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
224 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { | 222 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { |
225 CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner); | 223 CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner); |
226 pOwner->ReleaseBarcodeEngine(); | 224 pOwner->ReleaseBarcodeEngine(); |
227 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; | 225 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; |
228 } | 226 } |
229 return CFWL_EditImpDelegate::OnProcessEvent(pEvent); | 227 return CFWL_EditImpDelegate::OnProcessEvent(pEvent); |
230 } | 228 } |
OLD | NEW |