1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/src/plugins/Win1258.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,138 @@
1.4 +/*
1.5 +* Copyright (c) 1258 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +
1.25 +// INCLUDES
1.26 +#include <e32std.h>
1.27 +#include <charconv.h>
1.28 +#include <convgeneratedcpp.h>
1.29 +#include <ecom/implementationproxy.h>
1.30 +#include <charactersetconverter.h>
1.31 +// New Interface class
1.32 +class CWin1258Implementation : public CCharacterSetConverterPluginInterface
1.33 +{
1.34 + public:
1.35 + virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
1.36 +
1.37 + virtual TInt ConvertFromUnicode(
1.38 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.39 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.40 + TDes8& aForeign,
1.41 + const TDesC16& aUnicode,
1.42 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
1.43 +
1.44 + virtual TInt ConvertToUnicode(
1.45 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.46 + TDes16& aUnicode,
1.47 + const TDesC8& aForeign,
1.48 + TInt&,
1.49 + TInt& aNumberOfUnconvertibleCharacters,
1.50 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
1.51 +
1.52 + virtual TBool IsInThisCharacterSetL(
1.53 + TBool& aSetToTrue,
1.54 + TInt& aConfidenceLevel,
1.55 + const TDesC8& );
1.56 +
1.57 + static CWin1258Implementation* NewL();
1.58 +
1.59 + virtual ~CWin1258Implementation();
1.60 + private:
1.61 + CWin1258Implementation();
1.62 +};
1.63 +
1.64 +const TDesC8& CWin1258Implementation::ReplacementForUnconvertibleUnicodeCharacters()
1.65 + {
1.66 + return ReplacementForUnconvertibleUnicodeCharacters_internal();
1.67 + }
1.68 +
1.69 +TInt CWin1258Implementation::ConvertFromUnicode(
1.70 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.71 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.72 + TDes8& aForeign,
1.73 + const TDesC16& aUnicode,
1.74 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters )
1.75 + {
1.76 + return CCnvCharacterSetConverter::DoConvertFromUnicode(
1.77 + conversionData,
1.78 + aDefaultEndiannessOfForeignCharacters,
1.79 + aReplacementForUnconvertibleUnicodeCharacters,
1.80 + aForeign,
1.81 + aUnicode,
1.82 + aIndicesOfUnconvertibleCharacters );
1.83 + }
1.84 +
1.85 +TInt CWin1258Implementation::ConvertToUnicode(
1.86 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.87 + TDes16& aUnicode,
1.88 + const TDesC8& aForeign,
1.89 + TInt&,
1.90 + TInt& aNumberOfUnconvertibleCharacters,
1.91 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter )
1.92 + {
1.93 + return CCnvCharacterSetConverter::DoConvertToUnicode(
1.94 + conversionData,
1.95 + aDefaultEndiannessOfForeignCharacters,
1.96 + aUnicode,
1.97 + aForeign,
1.98 + aNumberOfUnconvertibleCharacters,
1.99 + aIndexOfFirstByteOfFirstUnconvertibleCharacter );
1.100 + }
1.101 +
1.102 +TBool CWin1258Implementation::IsInThisCharacterSetL(
1.103 + TBool& aSetToTrue,
1.104 + TInt& aConfidenceLevel,
1.105 + const TDesC8& )
1.106 + {
1.107 + aSetToTrue=EFalse;
1.108 + aConfidenceLevel=0;
1.109 + return EFalse;
1.110 + }
1.111 +
1.112 +CWin1258Implementation* CWin1258Implementation::NewL()
1.113 + {
1.114 + CWin1258Implementation* self = new(ELeave) CWin1258Implementation;
1.115 + return self;
1.116 + }
1.117 +
1.118 +CWin1258Implementation::CWin1258Implementation()
1.119 + {
1.120 + //default constructor.. do nothing
1.121 + }
1.122 +
1.123 +CWin1258Implementation::~CWin1258Implementation()
1.124 + {
1.125 + //default destructor .. do nothing
1.126 + }
1.127 +
1.128 +// ECOM CREATION FUNCTION
1.129 +const TImplementationProxy ImplementationTable[] =
1.130 + {
1.131 + // Note: This is the same UID as defined in old mmp-file
1.132 + // Used also in 12221212.rss ( implementation_uid )
1.133 + IMPLEMENTATION_PROXY_ENTRY( 0x102073B8, CWin1258Implementation::NewL )
1.134 + };
1.135 +
1.136 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
1.137 + {
1.138 + aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
1.139 + return ImplementationTable;
1.140 + }
1.141 +