Update contrib.
2 * Copyright (c) 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.
14 * Description: ksc5601 conversion plugin
22 #include <convgeneratedcpp.h>
23 #include <ecom/implementationproxy.h>
24 #include "cp949table.h"
25 #include "charactersetconverter.h"
27 // New Interface class
28 class CKSC5601Implementation : public CCharacterSetConverterPluginInterface
31 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
33 virtual TInt ConvertFromUnicode(
34 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
35 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
37 const TDesC16& aUnicode,
38 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
40 virtual TInt ConvertToUnicode(
41 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
43 const TDesC8& aForeign,
45 TInt& aNumberOfUnconvertibleCharacters,
46 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
48 virtual TBool IsInThisCharacterSetL(
50 TInt& aConfidenceLevel,
53 static CKSC5601Implementation* NewL();
55 virtual ~CKSC5601Implementation();
58 CKSC5601Implementation();
61 // FUNCTION DEFINITIONS
62 const TDesC8& CKSC5601Implementation::ReplacementForUnconvertibleUnicodeCharacters()
64 return CnvCp949Table::ReplacementForUnconvertibleUnicodeCharacters();
67 TInt CKSC5601Implementation::ConvertFromUnicode(
68 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
69 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
71 const TDesC16& aUnicode,
72 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
74 return CCnvCharacterSetConverter::DoConvertFromUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
77 TInt CKSC5601Implementation::ConvertToUnicode(
78 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
80 const TDesC8& aForeign,
82 TInt& aNumberOfUnconvertibleCharacters,
83 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
85 return CCnvCharacterSetConverter::DoConvertToUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
89 TBool CKSC5601Implementation::IsInThisCharacterSetL(
91 TInt& aConfidenceLevel,
92 const TDesC8& /*aBuf*/)
99 for (TInt i=0;i<aBuf.Length();i++)
106 else if (0xa1<=ch&&ch<=0xfe)
109 __ASSERT_DEBUG(i<aBuf.Length(),User::Panic(_L("KSC5601"),__LINE__));
125 CKSC5601Implementation* CKSC5601Implementation::NewL()
127 CKSC5601Implementation* self = new(ELeave) CKSC5601Implementation;
131 CKSC5601Implementation::CKSC5601Implementation()
133 //default constructor.. do nothing
136 CKSC5601Implementation::~CKSC5601Implementation()
138 //default destructor .. do nothing
141 // ECOM CREATION FUNCTION
142 const TImplementationProxy ImplementationTable[] =
144 // Note: This is the same UID as defined in old mmp-file
145 // Used also in 12221212.rss ( implementation_uid )
146 IMPLEMENTATION_PROXY_ENTRY( 0x200113CD, CKSC5601Implementation::NewL )
149 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
151 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
152 return ImplementationTable;