First public contribution.
2 * Copyright (c) 1251 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.
25 #include <convgeneratedcpp.h>
26 #include <ecom/implementationproxy.h>
27 #include <charactersetconverter.h>
28 // New Interface class
29 class CWin1251Implementation : public CCharacterSetConverterPluginInterface
32 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
34 virtual TInt ConvertFromUnicode(
35 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
36 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
38 const TDesC16& aUnicode,
39 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
41 virtual TInt ConvertToUnicode(
42 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
44 const TDesC8& aForeign,
46 TInt& aNumberOfUnconvertibleCharacters,
47 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
49 virtual TBool IsInThisCharacterSetL(
51 TInt& aConfidenceLevel,
54 static CWin1251Implementation* NewL();
56 virtual ~CWin1251Implementation();
58 CWin1251Implementation();
61 const TDesC8& CWin1251Implementation::ReplacementForUnconvertibleUnicodeCharacters()
63 return ReplacementForUnconvertibleUnicodeCharacters_internal();
66 TInt CWin1251Implementation::ConvertFromUnicode(
67 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
68 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
70 const TDesC16& aUnicode,
71 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters )
73 return CCnvCharacterSetConverter::DoConvertFromUnicode(
75 aDefaultEndiannessOfForeignCharacters,
76 aReplacementForUnconvertibleUnicodeCharacters,
79 aIndicesOfUnconvertibleCharacters );
82 TInt CWin1251Implementation::ConvertToUnicode(
83 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
85 const TDesC8& aForeign,
87 TInt& aNumberOfUnconvertibleCharacters,
88 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter )
90 return CCnvCharacterSetConverter::DoConvertToUnicode(
92 aDefaultEndiannessOfForeignCharacters,
95 aNumberOfUnconvertibleCharacters,
96 aIndexOfFirstByteOfFirstUnconvertibleCharacter );
99 TBool CWin1251Implementation::IsInThisCharacterSetL(
101 TInt& aConfidenceLevel,
109 CWin1251Implementation* CWin1251Implementation::NewL()
111 CWin1251Implementation* self = new(ELeave) CWin1251Implementation;
115 CWin1251Implementation::CWin1251Implementation()
117 //default constructor.. do nothing
120 CWin1251Implementation::~CWin1251Implementation()
122 //default destructor .. do nothing
125 // ECOM CREATION FUNCTION
126 const TImplementationProxy ImplementationTable[] =
128 // Note: This is the same UID as defined in old mmp-file
129 // Used also in 12221212.rss ( implementation_uid )
130 IMPLEMENTATION_PROXY_ENTRY( 0x100059D7, CWin1251Implementation::NewL )
133 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
135 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
136 return ImplementationTable;