Home | History | Annotate | Download | only in basewidget
      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_H
      8 #define _FWL_BARCODE_H
      9 #include "fwl_edit.h"
     10 class CFWL_WidgetImpProperties;
     11 class IFWL_Widget;
     12 class IFWL_BarcodeDP;
     13 class IFWL_Barcode;
     14 #define FWL_CLASS_Barcode L"FWL_BARCODE"
     15 #define FWL_CLASSHASH_Barcode 366886968
     16 #define FWL_BCDATTRIBUTE_CHARENCODING (1L << 0)
     17 #define FWL_BCDATTRIBUTE_MODULEHEIGHT (1L << 1)
     18 #define FWL_BCDATTRIBUTE_MODULEWIDTH (1L << 2)
     19 #define FWL_BCDATTRIBUTE_DATALENGTH (1L << 3)
     20 #define FWL_BCDATTRIBUTE_CALCHECKSUM (1L << 4)
     21 #define FWL_BCDATTRIBUTE_PRINTCHECKSUM (1L << 5)
     22 #define FWL_BCDATTRIBUTE_TEXTLOCATION (1L << 6)
     23 #define FWL_BCDATTRIBUTE_WIDENARROWRATIO (1L << 7)
     24 #define FWL_BCDATTRIBUTE_STARTCHAR (1L << 8)
     25 #define FWL_BCDATTRIBUTE_ENDCHAR (1L << 9)
     26 #define FWL_BCDATTRIBUTE_VERSION (1L << 10)
     27 #define FWL_BCDATTRIBUTE_ECLEVEL (1L << 11)
     28 #define FWL_BCDATTRIBUTE_TRUNCATED (1L << 12)
     29 #define FWL_PART_BCD_Border 1
     30 #define FWL_PART_BCD_Edge 2
     31 #define FWL_PART_BCD_Background 3
     32 #define FWL_BCUPDATECMD_Data FWL_WGTUPDATECMD_User
     33 class IFWL_BarcodeDP : public IFWL_EditDP {
     34  public:
     35   virtual BC_CHAR_ENCODING GetCharEncoding() = 0;
     36   virtual int32_t GetModuleHeight() = 0;
     37   virtual int32_t GetModuleWidth() = 0;
     38   virtual int32_t GetDataLength() = 0;
     39   virtual int32_t GetCalChecksum() = 0;
     40   virtual FX_BOOL GetPrintChecksum() = 0;
     41   virtual BC_TEXT_LOC GetTextLocation() = 0;
     42   virtual int32_t GetWideNarrowRatio() = 0;
     43   virtual FX_CHAR GetStartChar() = 0;
     44   virtual FX_CHAR GetEndChar() = 0;
     45   virtual int32_t GetVersion() = 0;
     46   virtual int32_t GetErrorCorrectionLevel() = 0;
     47   virtual FX_BOOL GetTruncated() = 0;
     48   virtual FX_DWORD GetBarcodeAttributeMask() = 0;
     49 };
     50 
     51 class IFWL_Barcode : public IFWL_Edit {
     52  public:
     53   static IFWL_Barcode* Create(const CFWL_WidgetImpProperties& properties);
     54   void SetType(BC_TYPE type);
     55   FX_BOOL IsProtectedType();
     56 
     57  protected:
     58   IFWL_Barcode();
     59 };
     60 #endif
     61