sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #if !defined(__SHIFTJIS_H__) sl@0: #define __SHIFTJIS_H__ sl@0: sl@0: #if !defined(__E32STD_H__) sl@0: #include sl@0: #endif sl@0: sl@0: #if !defined(__CHARCONV_H__) sl@0: #include sl@0: #endif sl@0: sl@0: #if !defined(__CONVUTILS_H__) sl@0: #include sl@0: #endif sl@0: sl@0: class CnvShiftJis sl@0: /** sl@0: only to be used by CHARCONV plug-in DLLs and by locale-DLLs (Locl::FatUtilityFunctions) sl@0: @internalComponent sl@0: */ sl@0: { sl@0: public: sl@0: IMPORT_C static const TDesC8& ReplacementForUnconvertibleUnicodeCharacters(); sl@0: IMPORT_C static TInt ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, sl@0: TDes8& aForeign, const TDesC16& aUnicode, sl@0: CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters); sl@0: sl@0: IMPORT_C static TInt ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, sl@0: TDes8& aForeign, const TDesC16& aUnicode, sl@0: CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters, sl@0: const TArray& aArrayOfAdditionalCharacterSets); sl@0: sl@0: IMPORT_C static TInt ConvertToUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: TDes16& aUnicode, const TDesC8& aForeign, sl@0: TInt& aNumberOfUnconvertibleCharacters, sl@0: TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter); sl@0: sl@0: IMPORT_C static TInt ConvertToUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: TDes16& aUnicode, const TDesC8& aForeign, sl@0: TInt& aNumberOfUnconvertibleCharacters, sl@0: TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, sl@0: const TArray& aArrayOfAdditionalMethods); sl@0: sl@0: private: sl@0: //static TInt DoConvertToUnicode(TDes16& aUnicode, const TDesC8& aForeign, sl@0: // TInt& aNumberOfUnconvertibleCharacters, sl@0: // TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter) ; sl@0: // sl@0: //static TInt DoConvertFromUnicode(const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, sl@0: // TDes8& aForeign, const TDesC16& aUnicode, CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters) ; sl@0: sl@0: static TInt DoConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, sl@0: TDes8& aForeign, sl@0: const TDesC16& aUnicode, sl@0: CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters, sl@0: const TArray* aArrayOfAdditionalCharacterSets); sl@0: static TInt DoConvertToUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, sl@0: TDes16& aUnicode, sl@0: const TDesC8& aForeign, sl@0: TInt& aNumberOfUnconvertibleCharacters, sl@0: TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, sl@0: const TArray* aArrayOfAdditionalMethods); sl@0: static void DummyConvertFromIntermediateBufferInPlace(TInt aStartPositionInDescriptor, sl@0: TDes8& aDescriptor, sl@0: TInt& aNumberOfCharactersThatDroppedOut); sl@0: static void ConvertFromJisX0208ToShiftJisInPlace(TInt aStartPositionInDescriptor, sl@0: TDes8& aDescriptor, sl@0: TInt& aNumberOfCharactersThatDroppedOut); sl@0: static TInt NumberOfBytesAbleToConvertToJisX0201(const TDesC8& aDescriptor); sl@0: static TInt NumberOfBytesAbleToConvertToJisX0208(const TDesC8& aDescriptor); sl@0: static void DummyConvertToIntermediateBufferInPlace(TDes8& aDescriptor); sl@0: static void ConvertToJisX0208FromShiftJisInPlace(TDes8& aDescriptor); sl@0: private: sl@0: friend class TCombinedArrayOfCharacterSets; sl@0: friend class TCombinedArrayOfMethods; sl@0: }; sl@0: sl@0: #endif sl@0: