CSmsAlphabetConverter Class Reference
| class CSmsAlphabetConverter : public CBase |
Utility to provide piecewise character set conversion to / from unpacked user data elements.
Nested Classes and Structures
| Public Member Functions |
|---|
| ~CSmsAlphabetConverter() |
|
TSmsDataCodingScheme::TSmsAlphabet
| Alphabet() |
| void | ConfirmAlternativeEncoderL(TSmsEncoding) |
| void | ConversionPropertiesL(TSmsAlphabetConversionProperties &) |
| IMPORT_C TPtrC8 | ConvertFromNativeL(const TDesC &) |
| IMPORT_C TPtrC8 | ConvertFromNativeL(const TDesC &, TSmsEncoding, TInt &, TInt &) |
| IMPORT_C TPtrC | ConvertToNativeL(const TDesC8 &) |
| IMPORT_C TPtrC | ConvertToNativeL(const TDesC8 &, TSmsEncoding) |
|
TSmsEncoding
| FindBestAlternativeEncodingL(const TDesC &, TSmsEncoding) |
|
TBool
| IsSupportedL(TChar) |
|
TBool
| IsSupportedL(const TDesC &, TInt &, TInt &) |
|
TBool
| IsSupportedL(TChar, TSmsEncoding, TBool &, TBool &) |
|
TBool
| IsSupportedL(const TDesC &, TSmsEncoding, TInt &, TInt &, TInt &, TInt &) |
| IMPORT_C CSmsAlphabetConverter * | NewLC(CCnvCharacterSetConverter &, RFs &, TSmsDataCodingScheme::TSmsAlphabet, TBool) |
| void | ResetUnconvertedNativeCharacters() |
| void | ResetUnconvertedUDElements() |
|
TPtrC
| UnconvertedNativeCharacters() |
|
TPtrC8
| UnconvertedUDElements() |
Constructor & Destructor Documentation
CSmsAlphabetConverter(CCnvCharacterSetConverter &, RFs &, TSmsDataCodingScheme::TSmsAlphabet, TBool)
~CSmsAlphabetConverter()
| IMPORT_C | ~CSmsAlphabetConverter | ( | ) | |
Destructor.
- capability
- None
Member Functions Documentation
Alphabet()
Gets the coding scheme alphabet.
CheckAllocBufferL(HBufC16 **, TInt, TInt)
CheckAllocBufferL(HBufC8 **, TInt, TInt)
ConfirmAlternativeEncoderL(TSmsEncoding)
ConstructL()
| void | ConstructL | ( | ) | [private] |
ConversionPropertiesL(TSmsAlphabetConversionProperties &)
ConvertFromNativeL(const TDesC &)
| IMPORT_C TPtrC8 | ConvertFromNativeL | ( | const TDesC & | aNativeCharacters | ) | |
Converts from the native character set to unpacked user data elements of the desired character set.
The function stores the converted data internally.
Parameters
| const TDesC & aNativeCharacters | The native character set data (Unicode only) |
ConvertFromNativeL(const TDesC &, TSmsEncoding, TInt &, TInt &)
| IMPORT_C TPtrC8 | ConvertFromNativeL | ( | const TDesC & | aNativeCharacters, |
| | TSmsEncoding | aEncoding, |
| | TInt & | aNumberOfUnconvertibleCharacters, |
| | TInt & | aNumberOfDowngradedCharacters |
| | ) | |
Converts from the native character set to unpacked user data elements of the desired character set.
The function stores the converted data internally.
Parameters
| const TDesC & aNativeCharacters | The native character set data (Unicode only) |
| TSmsEncoding aEncoding | Alternative 7bit encoding to used (if needed) |
| TInt & aNumberOfUnconvertibleCharacters | Number of characters unconverted |
| TInt & aNumberOfDowngradedCharacters | Number of characters downgraded |
ConvertToNativeL(const TDesC8 &)
| IMPORT_C TPtrC | ConvertToNativeL | ( | const TDesC8 & | aUDElements | ) | |
Converts the user data elements of the specified character set to the native character set.
Parameters
| const TDesC8 & aUDElements | The converted character set data |
ConvertToNativeL(const TDesC8 &, TSmsEncoding)
FindBestAlternativeEncodingL(const TDesC &, TSmsEncoding)
Given a piece of text and an alternative encoding, this function works out which encoding is best to use and returns the ID of that converter.
Parameters
| const TDesC & aNativeCharacters | Text to use as a sample. |
| TSmsEncoding aSuggestedEncoding | |
GetAlternativeEncoderIDL(TSmsEncoding, TUint &)
| void | GetAlternativeEncoderIDL | ( | TSmsEncoding | aEncoding, |
| | TUint & | aEncoderID |
| | ) | const [private] |
This function returns the alternative encoding converters that are used incase the default GSM encoding cannot encode the message completely without data loss.
-
leave
- KErrArgument if the encoding enum is invalid or
Parameters
| TSmsEncoding aEncoding | Encoding to obtain the converter for. |
| TUint & aEncoderID | Returned converter UID if present. |
IsSupportedL(TChar)
Tests if the character is supported by the current character set. This function can be used with 7bit and 8bit alphabets.
Note:
Since the function is based on the old behaviour (pre-PREQ2090) it does not accept a downgraded character or alternative encoding as being supported.
Parameters
| TChar aChar | Character to investigate. |
IsSupportedL(const TDesC &, TInt &, TInt &)
|
TBool
| IsSupportedL | ( | const TDesC & | aDes, |
| | TInt & | aNumberOfUnconvertibleCharacters, |
| | TInt & | aIndexOfFirstUnconvertibleCharacter |
| | ) | |
Tests if the descriptor text is supported by the current character set. This function can be used with 7bit and 8bit alphabets.
Parameters
| const TDesC & aDes | Text string to check. |
| TInt & aNumberOfUnconvertibleCharacters | Exit param for the number of characters unconvertible. |
| TInt & aIndexOfFirstUnconvertibleCharacter | Exit param for the first unconverted character. |
IsSupportedL(TChar, TSmsEncoding, TBool &, TBool &)
Tests if the character is supported by the current character set. This function can be used with 7bit and 8bit alphabets.
Parameters
| TChar aChar | Character to investigate. |
| TSmsEncoding aEncoding | Alternative 7bit encoding (if used). |
| TBool & aIsDowngrade | Exit param set to ETrue if the character has to be downgraded. |
| TBool & aRequiresAlternativeEncoding | Exit param set to ETrue if the alternative encoding has to be used to encode it. |
IsSupportedL(const TDesC &, TSmsEncoding, TInt &, TInt &, TInt &, TInt &)
|
TBool
| IsSupportedL | ( | const TDesC & | aDes, |
| | TSmsEncoding | aEncoding, |
| | TInt & | aNumberOfUnconvertibleCharacters, |
| | TInt & | aNumberOfDowngradedCharacters, |
| | TInt & | aNumberRequiringAlternativeEncoding, |
| | TInt & | aIndexOfFirstUnconvertibleCharacter |
| | ) | |
Tests if the descriptor text is supported by the current character set. This function can be used with 7bit and 8bit alphabets.
Parameters
| const TDesC & aDes | Text string to check. |
| TSmsEncoding aEncoding | Alternative 7bit encoding (if used). |
| TInt & aNumberOfUnconvertibleCharacters | Exit param for the number of characters unconvertible. |
| TInt & aNumberOfDowngradedCharacters | Exit param for the number of downgraded characters. |
| TInt & aNumberRequiringAlternativeEncoding | Exit param for the number of characters requiring use of the alternative encoder. |
| TInt & aIndexOfFirstUnconvertibleCharacter | Exit param for the first unconverted character. |
NewLC(CCnvCharacterSetConverter &, RFs &, TSmsDataCodingScheme::TSmsAlphabet, TBool)
Allocates and creates a CSmsAlphabetConverter object, specifying an Alphabet Coding scheme and a Binary flag.
PrepareForConversionFromNativeL(TSmsEncoding)
| void | PrepareForConversionFromNativeL | ( | TSmsEncoding | aEncoding | ) | [private] |
Prepares the converted for conversion from native charset. Character set specific preparation is performed here.
Parameters
| TSmsEncoding aEncoding | Alternative 7bit encoding to use if required. |
PrepareForConversionToNativeL(TSmsEncoding)
| void | PrepareForConversionToNativeL | ( | TSmsEncoding | aEncoding | ) | [private] |
Prepares the converted for conversion to unicode. Character set specific preparation is performed here.
Parameters
| TSmsEncoding aEncoding | Alternative 7bit encoding to use if required. |
ResetUnconvertedNativeCharacters()
| void | ResetUnconvertedNativeCharacters | ( | ) | [inline] |
Resets the unconverted native character buffer.
ResetUnconvertedUDElements()
| void | ResetUnconvertedUDElements | ( | ) | [inline] |
Resets the unconverted user data elements buffer.
UnconvertedNativeCharacters()
|
TPtrC
| UnconvertedNativeCharacters | ( | ) | [inline] |
Gets the unconverted native characters.
UnconvertedUDElements()
|
TPtrC8
| UnconvertedUDElements | ( | ) | [inline] |
Gets the unconverted user data elements.
Member Enumerations Documentation
Enum anonymous
Enumerators
| KMaxSmsAlphabetConversionRetries = 4 | |
Enum anonymous
Enumerators
| KMinSmsAlphabetConversionAllocIncrement = 4 | |
Enum anonymous
Enumerators
Enum anonymous
Enumerators
Enum TSmsAlphabetWidthConversion
Indicates whether there is a fixed relationship between the number of characters and user data elements.
For example, Unicode characters always map to a single SMS UCS2 character, while a Unicode character might map to one, two or more SMS 7-bit User Data Elements (extended 7-bit characters).
Enumerators
| ESmsAlphabetWidthConversionFixed |
Fixed relationship.
|
| ESmsAlphabetWidthConversionVariable |
Variable relationship.
|
Member Data Documentation
CCnvCharacterSetConverter & iCharacterSetConverter
HBufC * iConvertedNativeCharacters
|
HBufC * | iConvertedNativeCharacters | [private] |
HBufC8 * iConvertedUDElements
|
HBufC8 * | iConvertedUDElements | [private] |
TSmsDataCodingScheme::TSmsAlphabet
iSmsAlphabet
HBufC * iUnconvertedNativeCharacters
|
HBufC * | iUnconvertedNativeCharacters | [private] |
TPtr
iUnconvertedNativeCharactersPtr
|
TPtr
| iUnconvertedNativeCharactersPtr | [private] |
HBufC8 * iUnconvertedUDElements
|
HBufC8 * | iUnconvertedUDElements | [private] |
TPtr8
iUnconvertedUDElementsPtr
|
TPtr8
| iUnconvertedUDElementsPtr | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.