Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_QRDecodedBitStreamParser.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _BC_QRDECODEDBITSTREAMPARSER_H_\r
8 #define _BC_QRDECODEDBITSTREAMPARSER_H_\r
9 class CBC_CommonDecoderResult;\r
10 class CBC_QRCoderErrorCorrectionLevel;\r
11 class CBC_CommonBitSource;\r
12 class CBC_QRCoderVersion;\r
13 class CBC_CommonCharacterSetECI;\r
14 class CBC_QRDecodedBitStreamParser;\r
15 class CBC_QRDecodedBitStreamParser  : public CFX_Object\r
16 {\r
17 private:\r
18     const static FX_CHAR ALPHANUMERIC_CHARS[45];\r
19     static FX_LPCSTR UTF_8;\r
20     CBC_QRDecodedBitStreamParser();\r
21 public:\r
22     virtual ~CBC_QRDecodedBitStreamParser();\r
23     static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version,\r
24                                            CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e);\r
25 \r
26     static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes);\r
27     static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e);\r
28     static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);\r
29     static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);\r
30     static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);\r
31     static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e);\r
32     static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI,\r
33                                   CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e);\r
34 };\r
35 #endif\r