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 _FWL_BARCODE_IMP_H
8 #define _FWL_BARCODE_IMP_H
9 class CFWL_WidgetImp;
10 class CFWL_WidgetImpProperties;
11 class CFWL_WidgetImpDelegate;
12 class CFWL_EditImp;
13 class CFWL_EditImpDelegate;
14 class IFWL_Widget;
15 class CFWL_BarcodeEdit;
16 class CFWL_BarcodeEditDelegate;
17 class CFWL_BarcodeImp;
18 class CFWL_BarcodeImpDelegate;
19 #define XFA_BCS_NeedUpdate 0x0001
20 #define XFA_BCS_EncodeSuccess 0x0002
21 class CFWL_BarcodeImp : public CFWL_EditImp {
22  public:
23   CFWL_BarcodeImp(const CFWL_WidgetImpProperties& properties,
24                   IFWL_Widget* pOuter);
25   virtual ~CFWL_BarcodeImp();
26   virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const;
27   virtual FX_DWORD GetClassID() const;
28   virtual FWL_ERR Initialize();
29   virtual FWL_ERR Finalize();
30   virtual FWL_ERR Update();
31   virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics,
32                              const CFX_Matrix* pMatrix = NULL);
33   virtual FWL_ERR SetText(const CFX_WideString& wsText);
34   virtual void SetType(BC_TYPE type);
35   FX_BOOL IsProtectedType();
36 
37  protected:
38   void GenerateBarcodeImageCache();
39   void CreateBarcodeEngine();
40   void ReleaseBarcodeEngine();
41   IFX_Barcode* m_pBarcodeEngine;
42   FX_DWORD m_dwStatus;
43   BC_TYPE m_type;
44   friend class CFWL_BarcodeImpDelegate;
45 };
46 class CFWL_BarcodeImpDelegate : public CFWL_EditImpDelegate {
47  public:
48   CFWL_BarcodeImpDelegate(CFWL_BarcodeImp* pOwner);
49   FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override;
50 };
51 #endif
52