First public contribution.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 #include <ecom/implementationproxy.h>
23 #include <charactersetconverter.h>
25 class CGB2312ConverterImpl : public CCharacterSetConverterPluginInterface
29 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
31 virtual TInt ConvertFromUnicode(
32 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
33 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
35 const TDesC16& aUnicode,
36 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters);
38 virtual TInt ConvertToUnicode(
39 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
41 const TDesC8& aForeign,
43 TInt& aNumberOfUnconvertibleCharacters,
44 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter);
46 virtual TBool IsInThisCharacterSetL(
48 TInt& aConfidenceLevel,
49 const TDesC8& aSample);
51 static CGB2312ConverterImpl* NewL();
52 virtual ~CGB2312ConverterImpl();
55 CGB2312ConverterImpl();
61 const TDesC8& CGB2312ConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
63 return CnvGb2312::ReplacementForUnconvertibleUnicodeCharacters();
66 TInt CGB2312ConverterImpl::ConvertFromUnicode(
67 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
68 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
70 const TDesC16& aUnicode,
71 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
73 return CCnvCharacterSetConverter::DoConvertFromUnicode(CnvGb2312::ConversionData(), aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
76 TInt CGB2312ConverterImpl::ConvertToUnicode(
77 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
79 const TDesC8& aForeign,
81 TInt& aNumberOfUnconvertibleCharacters,
82 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
84 return CCnvCharacterSetConverter::DoConvertToUnicode(CnvGb2312::ConversionData(), aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
87 TBool CGB2312ConverterImpl::IsInThisCharacterSetL(
89 TInt& aConfidenceLevel,
90 const TDesC8& aSample)
93 return CnvGb2312::IsCharGBBased(aConfidenceLevel, aSample);
96 CGB2312ConverterImpl* CGB2312ConverterImpl::NewL()
98 CGB2312ConverterImpl* self = new(ELeave) CGB2312ConverterImpl();
102 CGB2312ConverterImpl::~CGB2312ConverterImpl()
106 CGB2312ConverterImpl::CGB2312ConverterImpl()
110 const TImplementationProxy ImplementationTable[] =
112 IMPLEMENTATION_PROXY_ENTRY(0x10000FBE,CGB2312ConverterImpl::NewL)
115 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
117 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
119 return ImplementationTable;