1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef _BC_ENCODERCONTEXT_H_ 8 #define _BC_ENCODERCONTEXT_H_ 9 class CBC_SymbolShapeHint; 10 class CBC_SymbolInfo; 11 class CBC_Dimension; 12 class CBC_EncoderContext; 13 class CBC_EncoderContext : public CBC_SymbolShapeHint { 14 public: 15 CBC_EncoderContext(const CFX_WideString msg, 16 CFX_WideString ecLevel, 17 int32_t& e); 18 virtual ~CBC_EncoderContext(); 19 void setSymbolShape(SymbolShapeHint shape); 20 void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize); 21 CFX_WideString getMessage(); 22 void setSkipAtEnd(int32_t count); 23 FX_WCHAR getCurrentChar(); 24 FX_WCHAR getCurrent(); 25 void writeCodewords(CFX_WideString codewords); 26 void writeCodeword(FX_WCHAR codeword); 27 int32_t getCodewordCount(); 28 void signalEncoderChange(int32_t encoding); 29 void resetEncoderSignal(); 30 FX_BOOL hasMoreCharacters(); 31 int32_t getRemainingCharacters(); 32 void updateSymbolInfo(int32_t& e); 33 void updateSymbolInfo(int32_t len, int32_t& e); 34 void resetSymbolInfo(); 35 36 public: 37 CFX_WideString m_msg; 38 CFX_WideString m_codewords; 39 int32_t m_pos; 40 int32_t m_newEncoding; 41 CBC_SymbolInfo* m_symbolInfo; 42 43 private: 44 int32_t getTotalMessageCharCount(); 45 46 private: 47 SymbolShapeHint m_shape; 48 CBC_Dimension* m_minSize; 49 CBC_Dimension* m_maxSize; 50 int32_t m_skipAtEnd; 51 }; 52 #endif 53