| 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 #ifndef XFA_FWL_BASEWIDGET_FWL_BARCODEIMP_H_ | |
| 8 #define XFA_FWL_BASEWIDGET_FWL_BARCODEIMP_H_ | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "xfa/fwl/basewidget/fwl_editimp.h" | |
| 13 #include "xfa/fwl/basewidget/ifwl_barcode.h" | |
| 14 #include "xfa/fwl/basewidget/ifwl_scrollbar.h" | |
| 15 | |
| 16 class CFWL_WidgetImpProperties; | |
| 17 class CFWL_BarcodeImpDelegate; | |
| 18 class CFX_Barcode; | |
| 19 class IFWL_Widget; | |
| 20 | |
| 21 #define XFA_BCS_NeedUpdate 0x0001 | |
| 22 #define XFA_BCS_EncodeSuccess 0x0002 | |
| 23 | |
| 24 class CFWL_BarcodeImp : public CFWL_EditImp { | |
| 25 public: | |
| 26 CFWL_BarcodeImp(const CFWL_WidgetImpProperties& properties, | |
| 27 IFWL_Widget* pOuter); | |
| 28 ~CFWL_BarcodeImp() override; | |
| 29 | |
| 30 // CFWL_WidgetImp | |
| 31 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
| 32 FWL_Type GetClassID() const override; | |
| 33 FWL_Error Initialize() override; | |
| 34 FWL_Error Finalize() override; | |
| 35 FWL_Error Update() override; | |
| 36 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | |
| 37 const CFX_Matrix* pMatrix = nullptr) override; | |
| 38 FWL_Error SetText(const CFX_WideString& wsText) override; | |
| 39 | |
| 40 void SetType(BC_TYPE type); | |
| 41 FX_BOOL IsProtectedType(); | |
| 42 | |
| 43 protected: | |
| 44 friend class CFWL_BarcodeImpDelegate; | |
| 45 | |
| 46 void GenerateBarcodeImageCache(); | |
| 47 void CreateBarcodeEngine(); | |
| 48 | |
| 49 std::unique_ptr<CFX_Barcode> m_pBarcodeEngine; | |
| 50 uint32_t m_dwStatus; | |
| 51 BC_TYPE m_type; | |
| 52 }; | |
| 53 | |
| 54 class CFWL_BarcodeImpDelegate : public CFWL_EditImpDelegate { | |
| 55 public: | |
| 56 explicit CFWL_BarcodeImpDelegate(CFWL_BarcodeImp* pOwner); | |
| 57 void OnProcessEvent(CFWL_Event* pEvent) override; | |
| 58 }; | |
| 59 | |
| 60 #endif // XFA_FWL_BASEWIDGET_FWL_BARCODEIMP_H_ | |
| OLD | NEW |