os/textandloc/charconvfw/charconvplugins/src/plugins/Win1253.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 1253 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 CWin1253Implementation : 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 CWin1253Implementation* NewL();
    55 
    56         virtual ~CWin1253Implementation();
    57     private:
    58         CWin1253Implementation();
    59 };
    60 
    61 const TDesC8& CWin1253Implementation::ReplacementForUnconvertibleUnicodeCharacters()
    62 	{
    63 	return ReplacementForUnconvertibleUnicodeCharacters_internal();
    64 	}
    65 
    66 TInt CWin1253Implementation::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 CWin1253Implementation::ConvertToUnicode(
    83     CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
    84     TDes16& aUnicode, 
    85     const TDesC8& aForeign, 
    86     TInt&, TInt& aNumberOfUnconvertibleCharacters, 
    87     TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter )
    88 	{
    89     return CCnvCharacterSetConverter::DoConvertToUnicode(
    90         conversionData, 
    91         aDefaultEndiannessOfForeignCharacters, 
    92         aUnicode, 
    93         aForeign, 
    94         aNumberOfUnconvertibleCharacters, 
    95         aIndexOfFirstByteOfFirstUnconvertibleCharacter );
    96 	}
    97 
    98 TBool CWin1253Implementation::IsInThisCharacterSetL(
    99     TBool& aSetToTrue, 
   100     TInt& aConfidenceLevel, 
   101     const TDesC8&)
   102 	{
   103     aSetToTrue=EFalse;
   104 	aConfidenceLevel=0;
   105 	return EFalse;
   106 	}
   107 
   108 CWin1253Implementation* CWin1253Implementation::NewL()
   109     {
   110     CWin1253Implementation* self = new(ELeave) CWin1253Implementation;
   111     return self;
   112     }
   113 
   114 CWin1253Implementation::CWin1253Implementation()
   115     {
   116     //default constructor.. do nothing
   117     }
   118 
   119 CWin1253Implementation::~CWin1253Implementation()
   120     {
   121     //default destructor .. do nothing
   122     }
   123 
   124 // ECOM CREATION FUNCTION
   125 const TImplementationProxy ImplementationTable[] = 
   126     {
   127     // Note: This is the same UID as defined in old mmp-file
   128     // Used also in 12221212.rss ( implementation_uid )
   129     IMPLEMENTATION_PROXY_ENTRY( 0x100059D8, CWin1253Implementation::NewL )
   130     };
   131 
   132 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
   133     {
   134     aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
   135     return ImplementationTable;
   136     }
   137