Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 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 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 7 | #ifndef FXBARCODE_QRCODE_BC_QRCODERMODE_H_ |
| 8 | #define FXBARCODE_QRCODE_BC_QRCODERMODE_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
| 10 | #include <stdint.h> |
| 11 | |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 12 | #include <vector> |
| 13 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 14 | #include "core/fxcrt/fx_string.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 15 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 16 | class CBC_QRCoderMode { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 17 | public: |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 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 | |
Lei Zhang | 8a24b25 | 2017-04-06 14:23:26 -0700 | [diff] [blame] | 25 | int32_t GetCharacterCountBits(int32_t number, int32_t& e) const; |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 26 | int32_t GetBits() const; |
| 27 | CFX_ByteString GetName() const; |
| 28 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 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; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 39 | |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 40 | private: |
| 41 | CBC_QRCoderMode(); |
| 42 | CBC_QRCoderMode(std::vector<int32_t> charCountBits, |
| 43 | int32_t bits, |
| 44 | CFX_ByteString name); |
| 45 | |
| 46 | std::vector<int32_t> m_characterCountBitsForVersions; |
| 47 | const int32_t m_bits; |
| 48 | const CFX_ByteString m_name; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 49 | }; |
| 50 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 51 | #endif // FXBARCODE_QRCODE_BC_QRCODERMODE_H_ |