• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FXBARCODE_QRCODE_BC_QRCODERMODE_H_
8 #define 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_QRCoderMode {
17  public:
18   virtual ~CBC_QRCoderMode();
19 
20   static void Initialize();
21   static void Finalize();
22   static CBC_QRCoderMode* ForBits(int32_t bits, int32_t& e);
23   static void Destroy();
24 
25   int32_t GetCharacterCountBits(int32_t number, int32_t& e) const;
26   int32_t GetBits() const;
27   ByteString GetName() const;
28 
29   static CBC_QRCoderMode* sBYTE;
30   static CBC_QRCoderMode* sNUMERIC;
31   static CBC_QRCoderMode* sALPHANUMERIC;
32   static CBC_QRCoderMode* sKANJI;
33   static CBC_QRCoderMode* sECI;
34   static CBC_QRCoderMode* sGBK;
35   static CBC_QRCoderMode* sTERMINATOR;
36   static CBC_QRCoderMode* sFNC1_FIRST_POSITION;
37   static CBC_QRCoderMode* sFNC1_SECOND_POSITION;
38   static CBC_QRCoderMode* sSTRUCTURED_APPEND;
39 
40  private:
41   CBC_QRCoderMode();
42   CBC_QRCoderMode(std::vector<int32_t> charCountBits,
43                   int32_t bits,
44                   ByteString name);
45 
46   std::vector<int32_t> m_characterCountBitsForVersions;
47   const int32_t m_bits;
48   const ByteString m_name;
49 };
50 
51 #endif  // FXBARCODE_QRCODE_BC_QRCODERMODE_H_
52