os/textandloc/charconvfw/charconvplugins/src/plugins/TIS_620.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2003 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:    (Thai)
    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 CTIS620Implementation : 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 CTIS620Implementation* NewL();
    55 
    56         virtual ~CTIS620Implementation();
    57     private:
    58         CTIS620Implementation();
    59 };
    60 
    61 // FUNCTION DEFINITIONS
    62 const TDesC8& CTIS620Implementation::ReplacementForUnconvertibleUnicodeCharacters()
    63 	{
    64 	return ReplacementForUnconvertibleUnicodeCharacters_internal();
    65 	}
    66 
    67 TInt CTIS620Implementation::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 CTIS620Implementation::ConvertToUnicode(
    78     CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    79     TDes16& aUnicode, 
    80     const TDesC8& aForeign, 
    81     TInt&, 
    82     TInt& aNumberOfUnconvertibleCharacters, 
    83     TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
    84 	{
    85     return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
    86 	}
    87 
    88 
    89 TBool CTIS620Implementation::IsInThisCharacterSetL(
    90     TBool& aSetToTrue, 
    91     TInt& aConfidenceLevel, 
    92     const TDesC8&)
    93 	{
    94     aSetToTrue=EFalse;
    95 	aConfidenceLevel=0;
    96 	return EFalse;
    97 	}
    98 
    99 CTIS620Implementation* CTIS620Implementation::NewL()
   100     {
   101     CTIS620Implementation* self = new(ELeave) CTIS620Implementation;
   102     return self;
   103     }
   104 
   105 CTIS620Implementation::CTIS620Implementation()
   106     {
   107     //default constructor.. do nothing
   108     }
   109 
   110 CTIS620Implementation::~CTIS620Implementation()
   111     {
   112     //default destructor .. do nothing
   113     }
   114 
   115 // ECOM CREATION FUNCTION
   116 const TImplementationProxy ImplementationTable[] = 
   117     {
   118     // Note: This is the same UID as defined in old mmp-file
   119     // Used also in 12221212.rss ( implementation_uid )
   120     IMPLEMENTATION_PROXY_ENTRY( 0x101F8549, CTIS620Implementation::NewL )
   121     };
   122 
   123 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
   124     {
   125     aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
   126     return ImplementationTable;
   127     }
   128