os/textandloc/charconvfw/charconvplugins/src/plugins/portuguese_locking_single.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/src/plugins/portuguese_locking_single.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
1.4 +/*
1.5 +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#include <e32std.h>
1.24 +#include <charconv.h>
1.25 +#include <convgeneratedcpp.h>
1.26 +#include <ecom/implementationproxy.h>
1.27 +#include <charactersetconverter.h>
1.28 +
1.29 +class CPortuguese_locking_singleConverterImpl : public CCharacterSetConverterPluginInterface
1.30 + {
1.31 +
1.32 +public:
1.33 + virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
1.34 +
1.35 + virtual TInt ConvertFromUnicode(
1.36 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.37 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.38 + TDes8& aForeign,
1.39 + const TDesC16& aUnicode,
1.40 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters);
1.41 +
1.42 + virtual TInt ConvertToUnicode(
1.43 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.44 + TDes16& aUnicode,
1.45 + const TDesC8& aForeign,
1.46 + TInt& aState,
1.47 + TInt& aNumberOfUnconvertibleCharacters,
1.48 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter);
1.49 +
1.50 + virtual TBool IsInThisCharacterSetL(
1.51 + TBool& aSetToTrue,
1.52 + TInt& aConfidenceLevel,
1.53 + const TDesC8& aSample);
1.54 +
1.55 + static CPortuguese_locking_singleConverterImpl* NewL();
1.56 + virtual ~CPortuguese_locking_singleConverterImpl();
1.57 +
1.58 +private:
1.59 + CPortuguese_locking_singleConverterImpl();
1.60 +
1.61 + };
1.62 +
1.63 +
1.64 +const TDesC8& CPortuguese_locking_singleConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
1.65 + {
1.66 + return ReplacementForUnconvertibleUnicodeCharacters_internal();
1.67 + }
1.68 +
1.69 +TInt CPortuguese_locking_singleConverterImpl::ConvertFromUnicode(
1.70 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.71 + const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
1.72 + TDes8& aForeign,
1.73 + const TDesC16& aUnicode,
1.74 + CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
1.75 + {
1.76 + return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
1.77 + }
1.78 +
1.79 +TInt CPortuguese_locking_singleConverterImpl::ConvertToUnicode(
1.80 + CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
1.81 + TDes16& aUnicode,
1.82 + const TDesC8& aForeign,
1.83 + TInt& /*aState*/,
1.84 + TInt& aNumberOfUnconvertibleCharacters,
1.85 + TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
1.86 + {
1.87 + return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
1.88 + }
1.89 +
1.90 +TBool CPortuguese_locking_singleConverterImpl::IsInThisCharacterSetL(
1.91 + TBool& aSetToTrue,
1.92 + TInt& aConfidenceLevel,
1.93 + const TDesC8& /*aSample*/)
1.94 + {
1.95 + aSetToTrue=ETrue;
1.96 + aConfidenceLevel=0;
1.97 + return EFalse;
1.98 + }
1.99 +
1.100 +CPortuguese_locking_singleConverterImpl* CPortuguese_locking_singleConverterImpl::NewL()
1.101 + {
1.102 + CPortuguese_locking_singleConverterImpl* self = new(ELeave) CPortuguese_locking_singleConverterImpl();
1.103 + return self;
1.104 + }
1.105 +
1.106 +CPortuguese_locking_singleConverterImpl::~CPortuguese_locking_singleConverterImpl()
1.107 + {
1.108 + }
1.109 +
1.110 +CPortuguese_locking_singleConverterImpl::CPortuguese_locking_singleConverterImpl()
1.111 + {
1.112 + }
1.113 +
1.114 +const TImplementationProxy ImplementationTable[] =
1.115 + {
1.116 + IMPLEMENTATION_PROXY_ENTRY(KCharacterSetIdentifierPortugueseLockingAndSingleSms7Bit, CPortuguese_locking_singleConverterImpl::NewL)
1.117 + };
1.118 +
1.119 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
1.120 + {
1.121 + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
1.122 +
1.123 + return ImplementationTable;
1.124 + }
1.125 +
1.126 +