Update contrib.
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 CGBKConverterImpl : 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 CGBKConverterImpl* NewL();
52 virtual ~CGBKConverterImpl();
60 const TDesC8& CGBKConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
62 return CnvGbk::ReplacementForUnconvertibleUnicodeCharacters();
65 TInt CGBKConverterImpl::ConvertFromUnicode(
66 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
67 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
69 const TDesC16& aUnicode,
70 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
72 return CnvGbk::ConvertFromUnicode(aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
75 TInt CGBKConverterImpl::ConvertToUnicode(
76 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
78 const TDesC8& aForeign,
80 TInt& aNumberOfUnconvertibleCharacters,
81 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
83 return CnvGbk::ConvertToUnicode(aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
86 TBool CGBKConverterImpl::IsInThisCharacterSetL(
88 TInt& aConfidenceLevel,
89 const TDesC8& aSample)
92 return CnvGbk::IsCharGBBased(aConfidenceLevel, aSample);
95 CGBKConverterImpl* CGBKConverterImpl::NewL()
97 CGBKConverterImpl* self = new(ELeave) CGBKConverterImpl();
101 CGBKConverterImpl::~CGBKConverterImpl()
105 CGBKConverterImpl::CGBKConverterImpl()
110 const TImplementationProxy ImplementationTable[] =
112 IMPLEMENTATION_PROXY_ENTRY(0x10003ECB,CGBKConverterImpl::NewL)
115 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
117 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
119 return ImplementationTable;