|
1 /* |
|
2 * Copyright (c) 1254 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 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <charconv.h> |
|
24 #include <convgeneratedcpp.h> |
|
25 #include <ecom/implementationproxy.h> |
|
26 #include <charactersetconverter.h> |
|
27 // New Interface class |
|
28 class CWin1254Implementation : public CCharacterSetConverterPluginInterface |
|
29 { |
|
30 public: |
|
31 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters(); |
|
32 |
|
33 virtual TInt ConvertFromUnicode( |
|
34 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
35 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, |
|
36 TDes8& aForeign, |
|
37 const TDesC16& aUnicode, |
|
38 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters ); |
|
39 |
|
40 virtual TInt ConvertToUnicode( |
|
41 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
42 TDes16& aUnicode, |
|
43 const TDesC8& aForeign, |
|
44 TInt&, |
|
45 TInt& aNumberOfUnconvertibleCharacters, |
|
46 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter ); |
|
47 |
|
48 virtual TBool IsInThisCharacterSetL( |
|
49 TBool& aSetToTrue, |
|
50 TInt& aConfidenceLevel, |
|
51 const TDesC8& ); |
|
52 |
|
53 static CWin1254Implementation* NewL(); |
|
54 |
|
55 virtual ~CWin1254Implementation(); |
|
56 private: |
|
57 CWin1254Implementation(); |
|
58 }; |
|
59 |
|
60 const TDesC8& CWin1254Implementation::ReplacementForUnconvertibleUnicodeCharacters() |
|
61 { |
|
62 return ReplacementForUnconvertibleUnicodeCharacters_internal(); |
|
63 } |
|
64 |
|
65 TInt CWin1254Implementation::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( |
|
73 conversionData, |
|
74 aDefaultEndiannessOfForeignCharacters, |
|
75 aReplacementForUnconvertibleUnicodeCharacters, |
|
76 aForeign, |
|
77 aUnicode, |
|
78 aIndicesOfUnconvertibleCharacters ); |
|
79 } |
|
80 |
|
81 TInt CWin1254Implementation::ConvertToUnicode( |
|
82 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, |
|
83 TDes16& aUnicode, |
|
84 const TDesC8& aForeign, |
|
85 TInt&, |
|
86 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 |
|
99 TBool CWin1254Implementation::IsInThisCharacterSetL( |
|
100 TBool& aSetToTrue, |
|
101 TInt& aConfidenceLevel, |
|
102 const TDesC8& ) |
|
103 { |
|
104 aSetToTrue=EFalse; |
|
105 aConfidenceLevel=0; |
|
106 return EFalse; |
|
107 } |
|
108 |
|
109 CWin1254Implementation* CWin1254Implementation::NewL() |
|
110 { |
|
111 CWin1254Implementation* self = new(ELeave) CWin1254Implementation; |
|
112 return self; |
|
113 } |
|
114 |
|
115 CWin1254Implementation::CWin1254Implementation() |
|
116 { |
|
117 //default constructor.. do nothing |
|
118 } |
|
119 |
|
120 CWin1254Implementation::~CWin1254Implementation() |
|
121 { |
|
122 //default destructor .. do nothing |
|
123 } |
|
124 |
|
125 // ECOM CREATION FUNCTION |
|
126 const TImplementationProxy ImplementationTable[] = |
|
127 { |
|
128 // Note: This is the same UID as defined in old mmp-file |
|
129 // Used also in 12221212.rss ( implementation_uid ) |
|
130 IMPLEMENTATION_PROXY_ENTRY( 0x100059D9, CWin1254Implementation::NewL ) |
|
131 }; |
|
132 |
|
133 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) |
|
134 { |
|
135 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy); |
|
136 return ImplementationTable; |
|
137 } |
|
138 |