Home | History | Annotate | Download | only in fxfa
      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_FXFA_CXFA_FFBARCODE_H_
      8 #define XFA_FXFA_CXFA_FFBARCODE_H_
      9 
     10 #include "fxbarcode/BC_Library.h"
     11 #include "xfa/fxfa/cxfa_ffpageview.h"
     12 #include "xfa/fxfa/cxfa_fftextedit.h"
     13 
     14 enum class BarcodeType {
     15   aztec,
     16   codabar,
     17   code11,
     18   code128,
     19   code128A,
     20   code128B,
     21   code128C,
     22   code128SSCC,
     23   code2Of5Industrial,
     24   code2Of5Interleaved,
     25   code2Of5Matrix,
     26   code2Of5Standard,
     27   code3Of9,
     28   code3Of9extended,
     29   code49,
     30   code93,
     31   dataMatrix,
     32   ean13,
     33   ean13add2,
     34   ean13add5,
     35   ean13pwcd,
     36   ean8,
     37   ean8add2,
     38   ean8add5,
     39   fim,
     40   logmars,
     41   maxicode,
     42   msi,
     43   pdf417,
     44   pdf417macro,
     45   plessey,
     46   postAUSCust2,
     47   postAUSCust3,
     48   postAUSReplyPaid,
     49   postAUSStandard,
     50   postUKRM4SCC,
     51   postUS5Zip,
     52   postUSDPBC,
     53   postUSIMB,
     54   postUSStandard,
     55   QRCode,
     56   rfid,
     57   rss14,
     58   rss14Expanded,
     59   rss14Limited,
     60   rss14Stacked,
     61   rss14StackedOmni,
     62   rss14Truncated,
     63   telepen,
     64   ucc128,
     65   ucc128random,
     66   ucc128sscc,
     67   upcA,
     68   upcAadd2,
     69   upcAadd5,
     70   upcApwcd,
     71   upcE,
     72   upcEadd2,
     73   upcEadd5,
     74   upcean2,
     75   upcean5,
     76   upsMaxicode
     77 };
     78 
     79 struct BarCodeInfo {
     80   uint32_t uHash;
     81   const wchar_t* pName;
     82   BarcodeType eName;
     83   BC_TYPE eBCType;
     84 };
     85 
     86 class CXFA_FFBarcode : public CXFA_FFTextEdit {
     87  public:
     88   static const BarCodeInfo* GetBarcodeTypeByName(const WideString& wsName);
     89 
     90   explicit CXFA_FFBarcode(CXFA_Node* pNode);
     91   ~CXFA_FFBarcode() override;
     92 
     93   // CXFA_FFTextEdit
     94   bool LoadWidget() override;
     95   void RenderWidget(CXFA_Graphics* pGS,
     96                     const CFX_Matrix& matrix,
     97                     uint32_t dwStatus) override;
     98   void UpdateWidgetProperty() override;
     99   bool OnLButtonDown(uint32_t dwFlags, const CFX_PointF& point) override;
    100   bool OnRButtonDown(uint32_t dwFlags, const CFX_PointF& point) override;
    101 };
    102 
    103 #endif  // XFA_FXFA_CXFA_FFBARCODE_H_
    104