Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_PDF417HighLevelEncoder.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_PDF417HIGHLEVELENCODER_H_\r
8 #define _BC_PDF417HIGHLEVELENCODER_H_\r
9 class CBC_Compaction;\r
10 class CBC_PDF417HighLevelEncoder;\r
11 class CBC_PDF417HighLevelEncoder : public CFX_Object\r
12 {\r
13 public:\r
14     CBC_PDF417HighLevelEncoder();\r
15     virtual ~CBC_PDF417HighLevelEncoder();\r
16     static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, FX_INT32 &e);\r
17     static void Inverse();\r
18     static void Initialize();\r
19     static void Finalize();\r
20 private:\r
21     static FX_INT32 TEXT_COMPACTION;\r
22     static FX_INT32 BYTE_COMPACTION;\r
23     static FX_INT32 NUMERIC_COMPACTION;\r
24     static FX_INT32 SUBMODE_PUNCTUATION;\r
25     static FX_INT32 LATCH_TO_TEXT;\r
26     static FX_INT32 LATCH_TO_BYTE_PADDED;\r
27     static FX_INT32 LATCH_TO_NUMERIC;\r
28     static FX_INT32 SHIFT_TO_BYTE;\r
29     static FX_INT32 LATCH_TO_BYTE;\r
30     static FX_BYTE TEXT_MIXED_RAW[];\r
31     static FX_BYTE TEXT_PUNCTUATION_RAW[];\r
32     static FX_INT32 MIXED[128];\r
33     static FX_INT32 PUNCTUATION[128];\r
34     static CFX_ByteArray* getBytesForMessage(CFX_WideString msg);\r
35     static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode);\r
36     static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb);\r
37     static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb);\r
38     static FX_BOOL isDigit(FX_WCHAR ch);\r
39     static FX_BOOL isAlphaUpper(FX_WCHAR ch);\r
40     static FX_BOOL isAlphaLower(FX_WCHAR ch);\r
41     static FX_BOOL isMixed(FX_WCHAR ch);\r
42     static FX_BOOL isPunctuation(FX_WCHAR ch);\r
43     static FX_BOOL isText(FX_WCHAR ch);\r
44     static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos);\r
45     static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos);\r
46     static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e);\r
47 };\r
48 #endif\r