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