charconvfw/charconvplugins/src/plugins/iso88598.cpp
changeset 0 1fb32624e06b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/charconvfw/charconvplugins/src/plugins/iso88598.cpp	Tue Feb 02 02:02:46 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include <e32std.h>
+#include <charconv.h>
+#include <convgeneratedcpp.h>
+#include <ecom/implementationproxy.h>
+#include <charactersetconverter.h>
+
+class CISO88598ConverterImpl : public CCharacterSetConverterPluginInterface
+	{
+
+public:
+	virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
+
+	virtual TInt ConvertFromUnicode(
+		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
+		const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
+		TDes8& aForeign, 
+		const TDesC16& aUnicode, 
+		CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters);
+
+	virtual TInt ConvertToUnicode(
+		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
+		TDes16& aUnicode, 
+		const TDesC8& aForeign, 
+		TInt& aState, 
+		TInt& aNumberOfUnconvertibleCharacters, 
+		TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter);
+
+	virtual TBool IsInThisCharacterSetL(
+		TBool& aSetToTrue, 
+		TInt& aConfidenceLevel, 
+		const TDesC8& aSample);
+
+	static CISO88598ConverterImpl* NewL();
+	virtual ~CISO88598ConverterImpl();
+
+private:
+	CISO88598ConverterImpl();
+
+	};
+
+
+const TDesC8& CISO88598ConverterImpl::ReplacementForUnconvertibleUnicodeCharacters()
+	{
+	return ReplacementForUnconvertibleUnicodeCharacters_internal();
+	}
+
+TInt CISO88598ConverterImpl::ConvertFromUnicode(
+		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
+		const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, 
+		TDes8& aForeign, 
+		const TDesC16& aUnicode, 
+		CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
+	{
+	return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
+	}
+
+TInt CISO88598ConverterImpl::ConvertToUnicode(
+		CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, 
+		TDes16& aUnicode, 
+		const TDesC8& aForeign, 
+		TInt& /*aState*/, 
+		TInt& aNumberOfUnconvertibleCharacters, 
+		TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
+	{
+	return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
+	}
+
+TBool CISO88598ConverterImpl::IsInThisCharacterSetL(
+		TBool& aSetToTrue, 
+		TInt& aConfidenceLevel, 
+		const TDesC8& /*aSample*/)
+	{
+	aSetToTrue=ETrue;
+	aConfidenceLevel=0;
+	return EFalse;
+	}
+
+CISO88598ConverterImpl* CISO88598ConverterImpl::NewL()
+	{
+	CISO88598ConverterImpl* self = new(ELeave) CISO88598ConverterImpl();
+	return self;
+	}
+
+CISO88598ConverterImpl::~CISO88598ConverterImpl()
+	{
+	}
+
+CISO88598ConverterImpl::CISO88598ConverterImpl()
+	{
+	}
+
+const TImplementationProxy ImplementationTable[] = 
+	{
+		IMPLEMENTATION_PROXY_ENTRY(0x10008A2A,	CISO88598ConverterImpl::NewL)
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+	return ImplementationTable;
+	}
+