os/textandloc/charconvfw/charconvplugins/src/plugins/gb12345.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #include <e32std.h>
    20 #include <charconv.h>
    21 #include <convgeneratedcpp.h>
    22 #include <ecom/implementationproxy.h>
    23 #include <charactersetconverter.h>
    24 
    25 
    26 class CGB12345ConverterImpl : public CCharacterSetConverterPluginInterface
    27 	{
    28 
    29 public:
    30 	virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
    31 
    32 	virtual TInt ConvertFromUnicode(
    33 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    34 		const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
    35 		TDes8& aForeign, 
    36 		const TDesC16& aUnicode, 
    37 		CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters);
    38 
    39 	virtual TInt ConvertToUnicode(
    40 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    41 		TDes16& aUnicode, 
    42 		const TDesC8& aForeign, 
    43 		TInt& aState, 
    44 		TInt& aNumberOfUnconvertibleCharacters, 
    45 		TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter);
    46 
    47 	virtual TBool IsInThisCharacterSetL(
    48 		TBool& aSetToTrue, 
    49 		TInt& aConfidenceLevel, 
    50 		const TDesC8& aSample);
    51 
    52 	static CGB12345ConverterImpl* NewL();
    53 	virtual ~CGB12345ConverterImpl();
    54 
    55 private:
    56 	CGB12345ConverterImpl();
    57 
    58 	};
    59 
    60 
    61 
    62 const TDesC8& CGB12345ConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
    63 	{
    64 	return ReplacementForUnconvertibleUnicodeCharacters_internal();
    65 	}
    66 
    67 TInt CGB12345ConverterImpl::ConvertFromUnicode(
    68 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    69 		const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
    70 		TDes8& aForeign, 
    71 		const TDesC16& aUnicode, 
    72 		CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
    73 	{
    74 	return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
    75 	}
    76 
    77 TInt CGB12345ConverterImpl::ConvertToUnicode(
    78 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    79 		TDes16& aUnicode, 
    80 		const TDesC8& aForeign, 
    81 		TInt& /*aState*/, 
    82 		TInt& aNumberOfUnconvertibleCharacters, 
    83 		TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
    84 	{
    85 	return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
    86 	}
    87 
    88 TBool CGB12345ConverterImpl::IsInThisCharacterSetL(
    89 		TBool& aSetToTrue, 
    90 		TInt& aConfidenceLevel, 
    91 		const TDesC8& /*aSample*/)
    92 	{
    93 	aSetToTrue=ETrue;
    94 	aConfidenceLevel=0;
    95 	return EFalse;
    96 	}
    97 
    98 CGB12345ConverterImpl* CGB12345ConverterImpl::NewL()
    99 	{
   100 	CGB12345ConverterImpl* self = new(ELeave) CGB12345ConverterImpl();
   101 	return self;
   102 	}
   103 
   104 CGB12345ConverterImpl::~CGB12345ConverterImpl()
   105 	{
   106 	}
   107 
   108 CGB12345ConverterImpl::CGB12345ConverterImpl()
   109 	{
   110 	}
   111 
   112 const TImplementationProxy ImplementationTable[] = 
   113 	{
   114 		IMPLEMENTATION_PROXY_ENTRY(0x1000401A,CGB12345ConverterImpl::NewL)
   115 	};
   116 
   117 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
   118 	{
   119 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
   120 
   121 	return ImplementationTable;
   122 	}
   123