Home | History | Annotate | Download | only in qrcode
      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_FXBARCODE_QRCODE_BC_QRCODERMODE_H_
      8 #define XFA_FXBARCODE_QRCODE_BC_QRCODERMODE_H_
      9 
     10 #include <stdint.h>
     11 
     12 #include <vector>
     13 
     14 #include "core/fxcrt/fx_string.h"
     15 
     16 class CBC_QRCoderVersion;
     17 
     18 class CBC_QRCoderMode {
     19  public:
     20   virtual ~CBC_QRCoderMode();
     21 
     22   static void Initialize();
     23   static void Finalize();
     24   static CBC_QRCoderMode* ForBits(int32_t bits, int32_t& e);
     25   static void Destroy();
     26 
     27   int32_t GetCharacterCountBits(CBC_QRCoderVersion* version, int32_t& e) const;
     28   int32_t GetBits() const;
     29   CFX_ByteString GetName() const;
     30 
     31   static CBC_QRCoderMode* sBYTE;
     32   static CBC_QRCoderMode* sNUMERIC;
     33   static CBC_QRCoderMode* sALPHANUMERIC;
     34   static CBC_QRCoderMode* sKANJI;
     35   static CBC_QRCoderMode* sECI;
     36   static CBC_QRCoderMode* sGBK;
     37   static CBC_QRCoderMode* sTERMINATOR;
     38   static CBC_QRCoderMode* sFNC1_FIRST_POSITION;
     39   static CBC_QRCoderMode* sFNC1_SECOND_POSITION;
     40   static CBC_QRCoderMode* sSTRUCTURED_APPEND;
     41 
     42  private:
     43   CBC_QRCoderMode();
     44   CBC_QRCoderMode(std::vector<int32_t> charCountBits,
     45                   int32_t bits,
     46                   CFX_ByteString name);
     47 
     48   std::vector<int32_t> m_characterCountBitsForVersions;
     49   const int32_t m_bits;
     50   const CFX_ByteString m_name;
     51 };
     52 
     53 #endif  // XFA_FXBARCODE_QRCODE_BC_QRCODERMODE_H_
     54