1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/src/plugins/Win1253.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,137 @@
1.4 +/*
1.5 +* Copyright (c) 1253 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 CWin1253Implementation : 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 CWin1253Implementation* NewL();
1.58 +
1.59 + virtual ~CWin1253Implementation();
1.60 + private:
1.61 + CWin1253Implementation();
1.62 +};
1.63 +
1.64 +const TDesC8& CWin1253Implementation::ReplacementForUnconvertibleUnicodeCharacters()
1.65 + {
1.66 + return ReplacementForUnconvertibleUnicodeCharacters_internal();
1.67 + }
1.68 +
1.69 +TInt CWin1253Implementation::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 CWin1253Implementation::ConvertToUnicode(
1.86 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.87 + TDes16& aUnicode,
1.88 + const TDesC8& aForeign,
1.89 + TInt&, TInt& aNumberOfUnconvertibleCharacters,
1.90 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter )
1.91 + {
1.92 + return CCnvCharacterSetConverter::DoConvertToUnicode(
1.93 + conversionData,
1.94 + aDefaultEndiannessOfForeignCharacters,
1.95 + aUnicode,
1.96 + aForeign,
1.97 + aNumberOfUnconvertibleCharacters,
1.98 + aIndexOfFirstByteOfFirstUnconvertibleCharacter );
1.99 + }
1.100 +
1.101 +TBool CWin1253Implementation::IsInThisCharacterSetL(
1.102 + TBool& aSetToTrue,
1.103 + TInt& aConfidenceLevel,
1.104 + const TDesC8&)
1.105 + {
1.106 + aSetToTrue=EFalse;
1.107 + aConfidenceLevel=0;
1.108 + return EFalse;
1.109 + }
1.110 +
1.111 +CWin1253Implementation* CWin1253Implementation::NewL()
1.112 + {
1.113 + CWin1253Implementation* self = new(ELeave) CWin1253Implementation;
1.114 + return self;
1.115 + }
1.116 +
1.117 +CWin1253Implementation::CWin1253Implementation()
1.118 + {
1.119 + //default constructor.. do nothing
1.120 + }
1.121 +
1.122 +CWin1253Implementation::~CWin1253Implementation()
1.123 + {
1.124 + //default destructor .. do nothing
1.125 + }
1.126 +
1.127 +// ECOM CREATION FUNCTION
1.128 +const TImplementationProxy ImplementationTable[] =
1.129 + {
1.130 + // Note: This is the same UID as defined in old mmp-file
1.131 + // Used also in 12221212.rss ( implementation_uid )
1.132 + IMPLEMENTATION_PROXY_ENTRY( 0x100059D8, CWin1253Implementation::NewL )
1.133 + };
1.134 +
1.135 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
1.136 + {
1.137 + aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
1.138 + return ImplementationTable;
1.139 + }
1.140 +