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