1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/src/plugins/gb12345.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
1.4 +/*
1.5 +* Copyright (c) 1997-2009 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 +#include <e32std.h>
1.23 +#include <charconv.h>
1.24 +#include <convgeneratedcpp.h>
1.25 +#include <ecom/implementationproxy.h>
1.26 +#include <charactersetconverter.h>
1.27 +
1.28 +
1.29 +class CGB12345ConverterImpl : public CCharacterSetConverterPluginInterface
1.30 + {
1.31 +
1.32 +public:
1.33 + virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
1.34 +
1.35 + virtual TInt ConvertFromUnicode(
1.36 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.37 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.38 + TDes8& aForeign,
1.39 + const TDesC16& aUnicode,
1.40 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters);
1.41 +
1.42 + virtual TInt ConvertToUnicode(
1.43 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.44 + TDes16& aUnicode,
1.45 + const TDesC8& aForeign,
1.46 + TInt& aState,
1.47 + TInt& aNumberOfUnconvertibleCharacters,
1.48 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter);
1.49 +
1.50 + virtual TBool IsInThisCharacterSetL(
1.51 + TBool& aSetToTrue,
1.52 + TInt& aConfidenceLevel,
1.53 + const TDesC8& aSample);
1.54 +
1.55 + static CGB12345ConverterImpl* NewL();
1.56 + virtual ~CGB12345ConverterImpl();
1.57 +
1.58 +private:
1.59 + CGB12345ConverterImpl();
1.60 +
1.61 + };
1.62 +
1.63 +
1.64 +
1.65 +const TDesC8& CGB12345ConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
1.66 + {
1.67 + return ReplacementForUnconvertibleUnicodeCharacters_internal();
1.68 + }
1.69 +
1.70 +TInt CGB12345ConverterImpl::ConvertFromUnicode(
1.71 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.72 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.73 + TDes8& aForeign,
1.74 + const TDesC16& aUnicode,
1.75 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
1.76 + {
1.77 + return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
1.78 + }
1.79 +
1.80 +TInt CGB12345ConverterImpl::ConvertToUnicode(
1.81 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.82 + TDes16& aUnicode,
1.83 + const TDesC8& aForeign,
1.84 + TInt& /*aState*/,
1.85 + TInt& aNumberOfUnconvertibleCharacters,
1.86 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
1.87 + {
1.88 + return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
1.89 + }
1.90 +
1.91 +TBool CGB12345ConverterImpl::IsInThisCharacterSetL(
1.92 + TBool& aSetToTrue,
1.93 + TInt& aConfidenceLevel,
1.94 + const TDesC8& /*aSample*/)
1.95 + {
1.96 + aSetToTrue=ETrue;
1.97 + aConfidenceLevel=0;
1.98 + return EFalse;
1.99 + }
1.100 +
1.101 +CGB12345ConverterImpl* CGB12345ConverterImpl::NewL()
1.102 + {
1.103 + CGB12345ConverterImpl* self = new(ELeave) CGB12345ConverterImpl();
1.104 + return self;
1.105 + }
1.106 +
1.107 +CGB12345ConverterImpl::~CGB12345ConverterImpl()
1.108 + {
1.109 + }
1.110 +
1.111 +CGB12345ConverterImpl::CGB12345ConverterImpl()
1.112 + {
1.113 + }
1.114 +
1.115 +const TImplementationProxy ImplementationTable[] =
1.116 + {
1.117 + IMPLEMENTATION_PROXY_ENTRY(0x1000401A,CGB12345ConverterImpl::NewL)
1.118 + };
1.119 +
1.120 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
1.121 + {
1.122 + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
1.123 +
1.124 + return ImplementationTable;
1.125 + }
1.126 +