Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_DataMatrixDecodedBitStreamParser.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_DATAMATRIXDECODEDBITSTREAMPARSER_H_\r
8 #define _BC_DATAMATRIXDECODEDBITSTREAMPARSER_H_\r
9 class CBC_CommonDecoderResult;\r
10 class CBC_CommonBitSource;\r
11 class CBC_DataMatrixDecodedBitStreamParser;\r
12 class CBC_DataMatrixDecodedBitStreamParser : public CFX_Object\r
13 {\r
14 public:\r
15     CBC_DataMatrixDecodedBitStreamParser();\r
16     virtual ~CBC_DataMatrixDecodedBitStreamParser();\r
17     static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, FX_INT32 &e);\r
18 \r
19 private:\r
20     static FX_INT32 DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e);\r
21     static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);\r
22     static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);\r
23     static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);\r
24     static void ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result);\r
25     static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);\r
26     static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e);\r
27     static FX_BYTE Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition);\r
28 \r
29     const static FX_CHAR C40_BASIC_SET_CHARS[];\r
30     const static FX_CHAR C40_SHIFT2_SET_CHARS[];\r
31 \r
32 \r
33     const static FX_CHAR TEXT_BASIC_SET_CHARS[];\r
34     const static FX_CHAR TEXT_SHIFT3_SET_CHARS[];\r
35     const static FX_INT32 PAD_ENCODE;\r
36     const static FX_INT32 ASCII_ENCODE;\r
37     const static FX_INT32 C40_ENCODE;\r
38     const static FX_INT32 TEXT_ENCODE;\r
39     const static FX_INT32 ANSIX12_ENCODE;\r
40     const static FX_INT32 EDIFACT_ENCODE;\r
41     const static FX_INT32 BASE256_ENCODE;\r
42 };\r
43 #endif\r