os/textandloc/charconvfw/charconvplugins/src/plugins/portuguese_locking_single.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2008-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 
    20 #include <e32std.h>
    21 #include <charconv.h>
    22 #include <convgeneratedcpp.h>
    23 #include <ecom/implementationproxy.h>
    24 #include <charactersetconverter.h>
    25 
    26 class CPortuguese_locking_singleConverterImpl : 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 CPortuguese_locking_singleConverterImpl* NewL();
    53 	virtual ~CPortuguese_locking_singleConverterImpl();
    54 
    55 private:
    56 	CPortuguese_locking_singleConverterImpl();
    57 
    58 	};
    59 
    60 
    61 const TDesC8& CPortuguese_locking_singleConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
    62 	{
    63 	return ReplacementForUnconvertibleUnicodeCharacters_internal();
    64 	}
    65 
    66 TInt CPortuguese_locking_singleConverterImpl::ConvertFromUnicode(
    67 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    68 		const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
    69 		TDes8& aForeign, 
    70 		const TDesC16& aUnicode, 
    71 		CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
    72 	{
    73 	return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
    74 	}
    75 
    76 TInt CPortuguese_locking_singleConverterImpl::ConvertToUnicode(
    77 		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    78 		TDes16& aUnicode, 
    79 		const TDesC8& aForeign, 
    80 		TInt& /*aState*/, 
    81 		TInt& aNumberOfUnconvertibleCharacters, 
    82 		TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
    83 	{
    84 	return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
    85 	}
    86 
    87 TBool CPortuguese_locking_singleConverterImpl::IsInThisCharacterSetL(
    88 		TBool& aSetToTrue, 
    89 		TInt& aConfidenceLevel, 
    90 		const TDesC8& /*aSample*/)
    91 	{
    92 	aSetToTrue=ETrue;
    93 	aConfidenceLevel=0;
    94 	return EFalse;
    95 	}
    96 
    97 CPortuguese_locking_singleConverterImpl* CPortuguese_locking_singleConverterImpl::NewL()
    98 	{
    99 	CPortuguese_locking_singleConverterImpl* self = new(ELeave) CPortuguese_locking_singleConverterImpl();
   100 	return self;
   101 	}
   102 
   103 CPortuguese_locking_singleConverterImpl::~CPortuguese_locking_singleConverterImpl()
   104 	{
   105 	}
   106 
   107 CPortuguese_locking_singleConverterImpl::CPortuguese_locking_singleConverterImpl()
   108 	{
   109 	}
   110 
   111 const TImplementationProxy ImplementationTable[] = 
   112 	{
   113 		IMPLEMENTATION_PROXY_ENTRY(KCharacterSetIdentifierPortugueseLockingAndSingleSms7Bit,	CPortuguese_locking_singleConverterImpl::NewL)
   114 	};
   115 
   116 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
   117 	{
   118 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
   119 
   120 	return ImplementationTable;
   121 	}
   122 
   123