os/textandloc/charconvfw/charconvplugins/src/plugins/Win1255.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1255 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 
    21 
    22 // INCLUDES
    23 #include <e32std.h>
    24 #include <charconv.h>
    25 #include <convgeneratedcpp.h>
    26 #include <ecom/implementationproxy.h>
    27 #include <charactersetconverter.h>
    28 // New Interface class
    29 class CWin1255Implementation : public CCharacterSetConverterPluginInterface
    30 {
    31     public:
    32         virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
    33 
    34         virtual TInt ConvertFromUnicode(
    35             CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    36             const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
    37             TDes8& aForeign, 
    38             const TDesC16& aUnicode, 
    39             CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
    40 
    41         virtual TInt ConvertToUnicode(
    42             CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    43             TDes16& aUnicode, 
    44             const TDesC8& aForeign, 
    45             TInt&, 
    46             TInt& aNumberOfUnconvertibleCharacters, 
    47             TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
    48 
    49         virtual TBool IsInThisCharacterSetL(
    50             TBool& aSetToTrue, 
    51             TInt& aConfidenceLevel, 
    52             const TDesC8& );
    53 
    54         static CWin1255Implementation* NewL();
    55 
    56         virtual ~CWin1255Implementation();
    57     private:
    58         CWin1255Implementation();
    59 };
    60 
    61 const TDesC8& CWin1255Implementation::ReplacementForUnconvertibleUnicodeCharacters()
    62 	{
    63 	return ReplacementForUnconvertibleUnicodeCharacters_internal();
    64 	}
    65 
    66 TInt CWin1255Implementation::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(
    74         conversionData, 
    75         aDefaultEndiannessOfForeignCharacters, 
    76         aReplacementForUnconvertibleUnicodeCharacters, 
    77         aForeign, 
    78         aUnicode, 
    79         aIndicesOfUnconvertibleCharacters );
    80 	}
    81 
    82 TInt CWin1255Implementation::ConvertToUnicode(
    83     CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    84     TDes16& aUnicode, 
    85     const TDesC8& aForeign, 
    86     TInt&, 
    87     TInt& aNumberOfUnconvertibleCharacters, 
    88     TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter )
    89 	{
    90     return CCnvCharacterSetConverter::DoConvertToUnicode(
    91         conversionData, 
    92         aDefaultEndiannessOfForeignCharacters, 
    93         aUnicode, 
    94         aForeign, 
    95         aNumberOfUnconvertibleCharacters, 
    96         aIndexOfFirstByteOfFirstUnconvertibleCharacter );
    97 	}
    98 
    99 
   100 TBool CWin1255Implementation::IsInThisCharacterSetL(
   101 	TBool& aSetToTrue, 
   102 	TInt& aConfidenceLevel, 
   103 	const TDesC8& )
   104 	{
   105     aSetToTrue=EFalse;
   106 	aConfidenceLevel=0;
   107 	return EFalse;
   108 	}
   109 
   110 CWin1255Implementation* CWin1255Implementation::NewL()
   111     {
   112     CWin1255Implementation* self = new(ELeave) CWin1255Implementation;
   113     return self;
   114     }
   115 
   116 CWin1255Implementation::CWin1255Implementation()
   117     {
   118     //default constructor.. do nothing
   119     }
   120 
   121 CWin1255Implementation::~CWin1255Implementation()
   122     {
   123     //default destructor .. do nothing
   124     }
   125 
   126 // ECOM CREATION FUNCTION
   127 const TImplementationProxy ImplementationTable[] = 
   128     {
   129     // Note: This is the same UID as defined in old mmp-file
   130     // Used also in 12221212.rss ( implementation_uid )
   131     IMPLEMENTATION_PROXY_ENTRY( 0x101F8547, CWin1255Implementation::NewL )
   132     };
   133 
   134 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
   135     {
   136     aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
   137     return ImplementationTable;
   138     }
   139