|
1 /* |
|
2 * Copyright (c) 1997-2009 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 #include <e32std.h> |
|
20 #include <charconv.h> |
|
21 #include <convgeneratedcpp.h> |
|
22 #include <ecom/implementationproxy.h> |
|
23 #include <charactersetconverter.h> |
|
24 |
|
25 class CISO88596ConverterImpl : public CCharacterSetConverterPluginInterface |
|
26 { |
|
27 |
|
28 public: |
|
29 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters(); |
|
30 |
|
31 virtual TInt ConvertFromUnicode( |
|
32 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
33 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
|
34 TDes8& aForeign, |
|
35 const TDesC16& aUnicode, |
|
36 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters); |
|
37 |
|
38 virtual TInt ConvertToUnicode( |
|
39 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
40 TDes16& aUnicode, |
|
41 const TDesC8& aForeign, |
|
42 TInt& aState, |
|
43 TInt& aNumberOfUnconvertibleCharacters, |
|
44 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter); |
|
45 |
|
46 virtual TBool IsInThisCharacterSetL( |
|
47 TBool& aSetToTrue, |
|
48 TInt& aConfidenceLevel, |
|
49 const TDesC8& aSample); |
|
50 |
|
51 static CISO88596ConverterImpl* NewL(); |
|
52 virtual ~CISO88596ConverterImpl(); |
|
53 |
|
54 private: |
|
55 CISO88596ConverterImpl(); |
|
56 |
|
57 }; |
|
58 |
|
59 |
|
60 const TDesC8& CISO88596ConverterImpl::ReplacementForUnconvertibleUnicodeCharacters() |
|
61 { |
|
62 return ReplacementForUnconvertibleUnicodeCharacters_internal(); |
|
63 } |
|
64 |
|
65 TInt CISO88596ConverterImpl::ConvertFromUnicode( |
|
66 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
67 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
|
68 TDes8& aForeign, |
|
69 const TDesC16& aUnicode, |
|
70 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters) |
|
71 { |
|
72 return CCnvCharacterSetConverter::DoConvertFromUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters); |
|
73 } |
|
74 |
|
75 TInt CISO88596ConverterImpl::ConvertToUnicode( |
|
76 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
77 TDes16& aUnicode, |
|
78 const TDesC8& aForeign, |
|
79 TInt& /*aState*/, |
|
80 TInt& aNumberOfUnconvertibleCharacters, |
|
81 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter) |
|
82 { |
|
83 return CCnvCharacterSetConverter::DoConvertToUnicode(conversionData, aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter); |
|
84 } |
|
85 |
|
86 TBool CISO88596ConverterImpl::IsInThisCharacterSetL( |
|
87 TBool& aSetToTrue, |
|
88 TInt& aConfidenceLevel, |
|
89 const TDesC8& /*aSample*/) |
|
90 { |
|
91 aSetToTrue=ETrue; |
|
92 aConfidenceLevel=0; |
|
93 return EFalse; |
|
94 } |
|
95 |
|
96 CISO88596ConverterImpl* CISO88596ConverterImpl::NewL() |
|
97 { |
|
98 CISO88596ConverterImpl* self = new(ELeave) CISO88596ConverterImpl(); |
|
99 return self; |
|
100 } |
|
101 |
|
102 CISO88596ConverterImpl::~CISO88596ConverterImpl() |
|
103 { |
|
104 } |
|
105 |
|
106 CISO88596ConverterImpl::CISO88596ConverterImpl() |
|
107 { |
|
108 } |
|
109 |
|
110 const TImplementationProxy ImplementationTable[] = |
|
111 { |
|
112 IMPLEMENTATION_PROXY_ENTRY(0x10008A29, CISO88596ConverterImpl::NewL) |
|
113 }; |
|
114 |
|
115 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
116 { |
|
117 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
118 |
|
119 return ImplementationTable; |
|
120 } |
|
121 |