| // Copyright 2014 PDFium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| |
| #ifndef FXBARCODE_DATAMATRIX_BC_HIGHLEVELENCODER_H_ |
| #define FXBARCODE_DATAMATRIX_BC_HIGHLEVELENCODER_H_ |
| |
| #include <vector> |
| |
| #include "core/fxcrt/widestring.h" |
| |
| #define ASCII_ENCODATION 0 |
| #define C40_ENCODATION 1 |
| #define TEXT_ENCODATION 2 |
| #define X12_ENCODATION 3 |
| #define EDIFACT_ENCODATION 4 |
| #define BASE256_ENCODATION 5 |
| |
| class CBC_HighLevelEncoder { |
| public: |
| CBC_HighLevelEncoder() = delete; |
| ~CBC_HighLevelEncoder() = delete; |
| |
| // Returns an empty string on failure. |
| static WideString EncodeHighLevel(const WideString& msg, |
| bool bAllowRectangular); |
| |
| static int32_t LookAheadTest(const WideString& msg, |
| int32_t startpos, |
| int32_t currentMode); |
| static bool IsExtendedASCII(wchar_t ch); |
| |
| static const wchar_t LATCH_TO_C40 = 230; |
| static const wchar_t LATCH_TO_BASE256 = 231; |
| static const wchar_t UPPER_SHIFT = 235; |
| static const wchar_t LATCH_TO_ANSIX12 = 238; |
| static const wchar_t LATCH_TO_TEXT = 239; |
| static const wchar_t LATCH_TO_EDIFACT = 240; |
| static const wchar_t C40_UNLATCH = 254; |
| static const wchar_t X12_UNLATCH = 254; |
| }; |
| |
| #endif // FXBARCODE_DATAMATRIX_BC_HIGHLEVELENCODER_H_ |