epoc32/include/convutils.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     1
// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     2
// All rights reserved.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     3
// This component and the accompanying materials are made available
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     4
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     5
// which accompanies this distribution, and is available
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     7
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     8
// Initial Contributors:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
     9
// Nokia Corporation - initial contribution.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    10
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    11
// Contributors:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    12
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    13
// Description:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    14
//
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    15
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    16
#if !defined(__CONVUTILS_H__)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    17
#define __CONVUTILS_H__
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    18
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    19
#if !defined(__E32STD_H__)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    20
#include <e32std.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    21
#endif
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    22
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    23
#if !defined(__E32BASE_H__)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    24
#include <e32base.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    25
#endif
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    26
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    27
#if !defined(__CHARCONV_H__)
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    28
#include <charconv.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    29
#endif
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    30
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    31
struct SCnvConversionData;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    32
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    33
 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    34
class CnvUtilities
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    35
/** 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    36
Provides static character conversion utilities for complex encodings. Its functions 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    37
may be called from a plug-in DLL's implementation of ConvertFromUnicode() 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    38
and ConvertToUnicode().
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    39
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    40
These utility functions are provided for use when converting to/from complex 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    41
character set encodings, including modal encodings. Modal encodings are those 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    42
where the interpretation of a given byte of data is dependent on the current 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    43
mode; mode changing is performed by escape sequences which occur in the byte 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    44
stream. A non-modal complex encoding is one in which characters are encoded 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    45
using variable numbers of bytes. The number of bytes used to encode a character 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    46
depends on the value of the initial byte.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    47
@publishedAll 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    48
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    49
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    50
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    51
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    52
	// type definitions for converting from Unicode
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    53
	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    54
	/**  A pointer to a function which "mangles" text when converting from
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    55
	Unicode into a complex modal or non-modal foreign character set
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    56
	encoding.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    57
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    58
	It might insert a shifting character, escape sequence, or other
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    59
	special characters.If the target character set encoding is modal, the
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    60
	implementation of this function may call the
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    61
	CnvUtilities::ConvertFromIntermediateBufferInPlace()
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    62
	utility function which is provided because many modal character sets
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    63
	require an identical implementation of this function.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    64
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    65
	" convutils.lib " */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    66
    typedef void (*FConvertFromIntermediateBufferInPlace)(TInt aStartPositionInDescriptor, TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    67
	struct SCharacterSet
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    68
	/** Stores information about a non-Unicode character set. The information 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    69
	is used to locate the conversion information required by 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    70
	ConvertFromUnicode() and ConvertToUnicode().
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    71
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    72
	An array of these structs  that contains all available character sets  
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    73
	can be generated by CreateArrayOfCharacterSetsAvailableLC() and 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    74
	CreateArrayOfCharacterSetsAvailableL(), and is used by one of the 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    75
	overloads of PrepareToConvertToOrFromL(). */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    76
		{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    77
		/** The conversion data. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    78
		const SCnvConversionData* iConversionData; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    79
		/** A pointer to a function which "mangles" the text in a way 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    80
		appropriate to the target complex character set. For instance it 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    81
		might insert a shifting character, escape sequence, or other special 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    82
		characters. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    83
		FConvertFromIntermediateBufferInPlace iConvertFromIntermediateBufferInPlace; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    84
		/** The escape sequence which introduces the character set, i.e. it 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    85
		identifies this character set as the next one to use. Must not be NULL.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    86
		If the character set is non-modal, this should be set to an empty 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    87
		descriptor. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    88
		const TDesC8* iEscapeSequence; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    89
		};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    90
	// type definitions for converting to Unicode
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    91
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    92
	/** A pointer to a function which calculates the number of consecutive
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    93
	bytes in the remainder of the foreign descriptor which can be
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    94
	converted using the current character set's conversion data.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    95
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    96
	Called when converting from a non-modal complex character set encoding
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    97
	into Unicode. It may return a negative
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    98
	CCnvCharacterSetConverter::TError value to indicate an
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    99
	error in the encoding.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   100
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   101
	" convutils.lib " */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   102
	typedef TInt (*FNumberOfBytesAbleToConvert)(const TDesC8& aDescriptor); // may return negative CCnvCharacterSetConverter::TError values
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   103
	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   104
	/** A pointer to a function which prepares the text for conversion into
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   105
	Unicode.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   106
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   107
	For instance it might remove any shifting or other special characters.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   108
	Called when converting from a non-modal complex character set encoding
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   109
	into Unicode.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   110
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   111
	" convutils.lib " */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   112
 	typedef void (*FConvertToIntermediateBufferInPlace)(TDes8& aDescriptor);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   113
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   114
	struct SState
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   115
	/** Character conversion data for one of the character sets which is 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   116
	specified in a modal character set encoding. An array of these structs 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   117
	is used when converting from a modal character set into Unicode, using 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   118
	CnvUtilities::ConvertToUnicodeFromModalForeign(). Neither of the members 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   119
	may be NULL. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   120
		{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   121
		/** The escape sequence which introduces the character set, i.e. it 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   122
		identifies this character set as the next one to use. This must begin 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   123
		with KControlCharacterEscape. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   124
		const TDesC8* iEscapeSequence; // must *not* be set to NULL and must begin with 0x1b
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   125
		/** The conversion data. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   126
		const SCnvConversionData* iConversionData; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   127
		};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   128
	struct SMethod
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   129
		{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   130
		/** A pointer to a function which calculates the number of consecutive 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   131
		bytes in the remainder of the foreign descriptor which can be converted 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   132
		using the current character set's conversion data. It may return a 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   133
		negative CCnvCharacterSetConverter::TError value to indicate an error 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   134
		in the encoding. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   135
		FNumberOfBytesAbleToConvert iNumberOfBytesAbleToConvert; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   136
		/** A pointer to a function which prepares the text for conversion 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   137
		into Unicode. For instance it might remove any shifting or other 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   138
		special characters. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   139
		FConvertToIntermediateBufferInPlace iConvertToIntermediateBufferInPlace; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   140
		/** The conversion data. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   141
		const SCnvConversionData* iConversionData; // must *not* be set to NULL
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   142
		/** The number of bytes per character. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   143
		TInt16 iNumberOfBytesPerCharacter;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   144
		/** The number of core bytes per character. */
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   145
		TInt16 iNumberOfCoreBytesPerCharacter;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   146
		};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   147
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   148
	// these functions may *not* have CCnvCharacterSetConverter::EInputConversionFlagStopAtFirstUnconvertibleCharacter set in aInputConversionFlags
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   149
	IMPORT_C static TInt ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, TDes8& aForeign, const TDesC16& aUnicode, CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters, const TArray<SCharacterSet>& aArrayOfCharacterSets);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   150
	IMPORT_C static TInt ConvertFromUnicode(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, const TDesC8& aReplacementForUnconvertibleUnicodeCharacters, TDes8& aForeign, const TDesC16& aUnicode, CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters, const TArray<SCharacterSet>& aArrayOfCharacterSets, TUint& aOutputConversionFlags, TUint aInputConversionFlags);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   151
	IMPORT_C static void ConvertFromIntermediateBufferInPlace(TInt aStartPositionInDescriptor, TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut, const TDesC8& aEscapeSequence, TInt aNumberOfBytesPerCharacter);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   152
	IMPORT_C static TInt ConvertToUnicodeFromModalForeign(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, TDes16& aUnicode, const TDesC8& aForeign, TInt& aState, TInt& aNumberOfUnconvertibleCharacters, TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, const TArray<SState>& aArrayOfStates); // the first element of aArrayOfStates is taken to be the default state
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   153
	IMPORT_C static TInt ConvertToUnicodeFromModalForeign(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, TDes16& aUnicode, const TDesC8& aForeign, TInt& aState, TInt& aNumberOfUnconvertibleCharacters, TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, const TArray<SState>& aArrayOfStates, TUint& aOutputConversionFlags, TUint aInputConversionFlags); // the first element of aArrayOfStates is taken to be the default state
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   154
	IMPORT_C static TInt ConvertToUnicodeFromHeterogeneousForeign(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, TDes16& aUnicode, const TDesC8& aForeign, TInt& aNumberOfUnconvertibleCharacters, TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, const TArray<SMethod>& aArrayOfMethods);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   155
	IMPORT_C static TInt ConvertToUnicodeFromHeterogeneousForeign(CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters, TDes16& aUnicode, const TDesC8& aForeign, TInt& aNumberOfUnconvertibleCharacters, TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter, const TArray<SMethod>& aArrayOfMethods, TUint& aOutputConversionFlags, TUint aInputConversionFlags);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   156
private:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   157
	static void CheckArrayOfCharacterSets(const TArray<SCharacterSet>& aArrayOfCharacterSets);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   158
	static void CheckArrayOfStates(const TArray<SState>& aArrayOfStates);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   159
	static void CheckArrayOfMethods(const TArray<SMethod>& aArrayOfMethods);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   160
	static TInt LengthOfUnicodeCharacter(const TDesC16& aUnicode, TInt aIndex);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   161
	static TBool NextHomogeneousForeignRun(const SCnvConversionData*& aConversionData, TInt& aNumberOfForeignBytesConsumed, TPtrC8& aHomogeneousRun, TPtrC8& aRemainderOfForeign, const TArray<SState>& aArrayOfStates, TUint& aOutputConversionFlags);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   162
	static TBool MatchesEscapeSequence(TInt& aNumberOfForeignBytesConsumed, TPtrC8& aHomogeneousRun, TPtrC8& aRemainderOfForeign, const TDesC8& aEscapeSequence);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   163
	static TBool IsStartOf(const TDesC8& aStart, const TDesC8& aPotentiallyLongerDescriptor);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   164
	inline static TInt ReduceToNearestMultipleOf(TInt aNumber1, TInt aNumber2) {return (aNumber1/aNumber2)*aNumber2;}
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   165
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   166
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   167
#endif