Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fxbarcode / pdf417 / 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 \r
10 #include "BC_PDF417Compaction.h"\r
11 \r
12 class CBC_PDF417HighLevelEncoder\r
13 {\r
14 public:\r
15     static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, int32_t &e);\r
16     static void Inverse();\r
17     static void Initialize();\r
18     static void Finalize();\r
19 private:\r
20     static int32_t TEXT_COMPACTION;\r
21     static int32_t BYTE_COMPACTION;\r
22     static int32_t NUMERIC_COMPACTION;\r
23     static int32_t SUBMODE_PUNCTUATION;\r
24     static int32_t LATCH_TO_TEXT;\r
25     static int32_t LATCH_TO_BYTE_PADDED;\r
26     static int32_t LATCH_TO_NUMERIC;\r
27     static int32_t SHIFT_TO_BYTE;\r
28     static int32_t LATCH_TO_BYTE;\r
29     static uint8_t TEXT_MIXED_RAW[];\r
30     static uint8_t TEXT_PUNCTUATION_RAW[];\r
31     static int32_t MIXED[128];\r
32     static int32_t PUNCTUATION[128];\r
33     static int32_t encodeText(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb, int32_t initialSubmode);\r
34     static void encodeBinary(CFX_ByteArray* bytes, int32_t startpos, int32_t count, int32_t startmode, CFX_WideString &sb);\r
35     static void encodeNumeric(CFX_WideString msg, int32_t startpos, int32_t count, CFX_WideString &sb);\r
36     static FX_BOOL isDigit(FX_WCHAR ch);\r
37     static FX_BOOL isAlphaUpper(FX_WCHAR ch);\r
38     static FX_BOOL isAlphaLower(FX_WCHAR ch);\r
39     static FX_BOOL isMixed(FX_WCHAR ch);\r
40     static FX_BOOL isPunctuation(FX_WCHAR ch);\r
41     static FX_BOOL isText(FX_WCHAR ch);\r
42     static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos);\r
43     static int32_t determineConsecutiveTextCount(CFX_WideString msg, int32_t startpos);\r
44     static int32_t determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, int32_t startpos, int32_t &e);\r
45 \r
46     friend class PDF417HighLevelEncoder_EncodeNumeric_Test;\r
47     friend class PDF417HighLevelEncoder_EncodeBinary_Test;\r
48     friend class PDF417HighLevelEncoder_EncodeText_Test;\r
49     friend class PDF417HighLevelEncoder_ConsecutiveDigitCount_Test;\r
50     friend class PDF417HighLevelEncoder_ConsecutiveTextCount_Test;\r
51     friend class PDF417HighLevelEncoder_ConsecutiveBinaryCount_Test;\r
52 };\r
53 \r
54 #endif\r