1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/src/plugins/Win1254.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,139 @@
1.4 +/*
1.5 +* Copyright (c) 1254 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 CWin1254Implementation : 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 CWin1254Implementation* NewL();
1.58 +
1.59 + virtual ~CWin1254Implementation();
1.60 + private:
1.61 + CWin1254Implementation();
1.62 +};
1.63 +
1.64 +const TDesC8& CWin1254Implementation::ReplacementForUnconvertibleUnicodeCharacters()
1.65 + {
1.66 + return ReplacementForUnconvertibleUnicodeCharacters_internal();
1.67 + }
1.68 +
1.69 +TInt CWin1254Implementation::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 CWin1254Implementation::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 +
1.103 +TBool CWin1254Implementation::IsInThisCharacterSetL(
1.104 + TBool& aSetToTrue,
1.105 + TInt& aConfidenceLevel,
1.106 + const TDesC8& )
1.107 + {
1.108 + aSetToTrue=EFalse;
1.109 + aConfidenceLevel=0;
1.110 + return EFalse;
1.111 + }
1.112 +
1.113 +CWin1254Implementation* CWin1254Implementation::NewL()
1.114 + {
1.115 + CWin1254Implementation* self = new(ELeave) CWin1254Implementation;
1.116 + return self;
1.117 + }
1.118 +
1.119 +CWin1254Implementation::CWin1254Implementation()
1.120 + {
1.121 + //default constructor.. do nothing
1.122 + }
1.123 +
1.124 +CWin1254Implementation::~CWin1254Implementation()
1.125 + {
1.126 + //default destructor .. do nothing
1.127 + }
1.128 +
1.129 +// ECOM CREATION FUNCTION
1.130 +const TImplementationProxy ImplementationTable[] =
1.131 + {
1.132 + // Note: This is the same UID as defined in old mmp-file
1.133 + // Used also in 12221212.rss ( implementation_uid )
1.134 + IMPLEMENTATION_PROXY_ENTRY( 0x100059D9, CWin1254Implementation::NewL )
1.135 + };
1.136 +
1.137 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
1.138 + {
1.139 + aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
1.140 + return ImplementationTable;
1.141 + }
1.142 +