Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <charactersetconverter.h>

Class CCharacterSetConverterPluginInterface

class CCharacterSetConverterPluginInterface : public CBase;

Description

This is the base class defining the methods in the CharConv Character Set Conversion plugin interface. CharConv plugin suppliers would define implementation classes inheriting from this interface class to add additional character set support to CharConv.

Derivation

Members

Defined in CCharacterSetConverterPluginInterface:

Inherited from CBase:


Construction and destruction


NewL(TUid)

static inline CCharacterSetConverterPluginInterface* NewL(TUid aInterfaceImplUid);

Description

Parameters

TUid aInterfaceImplUid

Return value

CCharacterSetConverterPluginInterface *


~CCharacterSetConverterPluginInterface()

inline virtual ~CCharacterSetConverterPluginInterface();

Description

Destroys the Charconv Plug-in interface implementation specified by iDtor_ID_Key

[Top]


Member functions


ReplacementForUnconvertibleUnicodeCharacters()

virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters()=0;

Description

A function prototype which must be implemented by a character conversion plug-in DLL to return the character (represented by one or more byte values) which is used by default as the replacement for unconvertible Unicode characters.

This character is used when converting from Unicode into a foreign character set, if there is no equivalent for the Unicode character in the foreign character set. The default replacement character can be overriden by a call to CCnvCharacterSetConverter::SetReplacemen- tForUnconvertibleUnicodeCharactersL() .This function is exported at ordinal position 1 in the plug-in DLL. It is called by CCnvC- haracterSetConverter::PrepareToConvertToOrFromL() .To implement this function, you should #include convgeneratedcpp.h in the cpp file. This gives access to the ReplacementForUnconvertibleUnicodeCharacters_internal() function. This function can then be implemented by calling ReplacementForUnconvertibleUnicodeCharacters_internal() .

Return value

const TDesC8 &

" const TDesC8& " The single character which is to be used to replace unconvertible characters.


ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness,const TDesC8 &,TDes8 &,const TDesC16 &,CCnvCharacterSetConverter::TArrayOfAscendingIndices &)

virtual TInt ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, const TDesC8 &aReplacementForUnconvertibleUnicodeCharacters, TDes8 &aForeign, const TDesC16 &aUnicode, CCnvCharacterSetConverter::TArrayOfAscendingIndices &aIndicesOfUnconvertibleCharacters)=0;

Description

A function prototype which must be implemented by a character conversion plug-in DLL to convert from Unicode into a foreign character set.

This function is exported at ordinal position 2 in the plug-in DLL. It is called by CCnvCharacterSetConverter::ConvertFromUnicode() .For many non-complex character sets, the implementation of this function is trivial. Include convgeneratedcpp.h in the .cpp file to get access to the SCnvConversionData object called conversionData . Then call CCnvCharacterSetConverter::DoConvertFromUnicode() specifying conversionData as the first argument and passing in all parameters unchanged.For complex character sets, you need to create an array of character conversion data objects (CnvUtilities::SCharacterSet s), then call CnvUtilities::ConvertFromUnicode() .

Parameters

CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters

const TDesC8 &aReplacementForUnconvertibleUnicodeCharacters

TDes8 &aForeign

const TDesC16 &aUnicode

CCnvCharacterSetConverter::TArrayOfAscendingIndices &aIndicesOfUnconvertibleCharacters

Return value

TInt

" TInt " The number of unconverted characters left at the end of the input descriptor (e.g. because aForeign was not long enough to hold all the text), or a negative error value, as defined in TError .


ConvertToUnicode(CCnvCharacterSetConverter::TEndianness,TDes16 &,const TDesC8 &,TInt &,TInt &,TInt &)

virtual TInt ConvertToUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, TDes16 &aUnicode, const TDesC8 &aForeign, TInt &aState, TInt &aNumberOfUnconvertibleCharacters, TInt &aIndexOfFirstByteOfFirstUnconvertibleCharacter)=0;

Description

A function prototype which must be implemented by a character conversion plug-in DLL to convert from a foreign character set into Unicode.

This function is exported at ordinal position 3 in the plug-in DLL. It is called by CCnvCharacterSetConverter::ConvertToUnicode() .For many non-complex character sets, the implementation of this function is trivial. Include convgeneratedcpp.h in the .cpp file to get access to the SCnvConversionData object called conversionData . Then call CCnvCharacterSetConverter::DoConvertToUnicode() specifying conversionData as the first argument and passing in all other parameters unchanged.For complex character sets, you need to create an array of character conversion methods (CnvUtilities::SMethod s or CnvUtilities::SState s, depending on whether the complex character set encoding is modal or not), then call CnvUtilities::ConvertToUnicodeFromHeterogeneousForeign() or CnvUtilities::ConvertToUnicodeFromModalForeign() .

Parameters

CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters

TDes16 &aUnicode

const TDesC8 &aForeign

TInt &aState

TInt &aNumberOfUnconvertibleCharacters

TInt &aIndexOfFirstByteOfFirstUnconvertibleCharacter

Return value

TInt

" TInt " The number of unconverted bytes left at the end of the input descriptor (e.g. because the output descriptor is not long enough to hold all the text), or one of the error values defined in TError .


IsInThisCharacterSetL(TBool &,TInt &,const TDesC8 &)

virtual TBool IsInThisCharacterSetL(TBool &aSetToTrue, TInt &aConfidenceLevel, const TDesC8 &aSample)=0;

Description

A function which must be implemented by a character conversion plug-in DLL to calculate how probable it is that a sample piece of text is encoded in this character set.

This function was added in 6.1 as the 4th-ordinal exported function in the plug-in DLL interface. It is called by CCnvCharacterSetConverter::AutoDetectCharacterSetL() for each character conversion plug-in DLL.

Parameters

TBool &aSetToTrue

TInt &aConfidenceLevel

const TDesC8 &aSample

Return value

TBool

"TBool" ETrue if it is more probable that the sample text is encoded in this character set than not. EFalse if it is more probable that the sample text is not encoded in this character set. The confidence level applies to this value.