class CLafEdwinCustomWrapBase : public CBase |
LAF support for custom line breaking in Edwins.
This class is used by CEikEdwin to determine how to place line breaks.
The custom line breaking interface is defined by the MFormCustomWrap class.
Public Member Functions | |
---|---|
~CLafEdwinCustomWrapBase () | |
IMPORT_C TBool | GetLineBreakInContext (const TDesC &, TInt , TInt , TBool , TInt &) |
IMPORT_C TBool | IsHangingCharacter ( TUint ) |
IMPORT_C TUint | LineBreakClass ( TUint , TUint &, TUint &) |
IMPORT_C TBool | LineBreakPossible ( TUint , TUint , TBool ) |
IMPORT_C CLafEdwinCustomWrapBase * | NewL (const CCoeControl &) |
Protected Member Functions | |
---|---|
CLafEdwinCustomWrapBase (const CCoeControl &) |
Private Member Functions | |
---|---|
IMPORT_C void | MFormCustomWrap_Reserved_1 () |
IMPORT_C void | MFormCustomWrap_Reserved_2 () |
Protected Attributes | |
---|---|
const CCoeControl & | iControl |
Private Attributes | |
---|---|
TInt | iSpare |
IMPORT_C | CLafEdwinCustomWrapBase | ( | const CCoeControl & | aControl | ) | [protected] |
Constructor.
const CCoeControl & aControl | The Edwin control |
IMPORT_C TBool | GetLineBreakInContext | ( | const TDesC & | aText, |
TInt | aMinBreakPos, | |||
TInt | aMaxBreakPos, | |||
TBool | aForwards, | |||
TInt & | aBreakPos | |||
) | const |
Gets the position of the first or last possible line break position in a text string.
This implements MFormCustomWrap::GetLineBreakInContext() .
Return the first (if aForwards is TRUE) or last (if aForwards is FALSE) linebreak in aText, This must be in the range aMinBreakPos...aMaxBreakPos, which is a run of characters in the class ESaLineBreakClass, usually employed for Thai, Lao and Khmer letters, because these scripts don't use word spaces and need dictionary-based line breaking. The break position is returned in aBreakPos, which must be > 0 and < aText.Length() - 1. Return TRUE if a break is found, FALSE otherwise. Test
const TDesC & aText | A string containing characters of class MTmCustom::ESaLineBreakClass. |
TInt aMinBreakPos | A position within aText at which to begin searching for a possible line break position. |
TInt aMaxBreakPos | A position within aText at which to stop searching for a possible line break position. |
TBool aForwards | If ETrue, the function gets the first possible line break position (searches forwards from aMinBreakPos); if EFalse, gets the last one (searches backwards from aMaxBreakPos). |
TInt & aBreakPos | On return, the position of the first or last possible line break within aText. This must be greater than zero and less than aText.Length()1, and must also be in the range aMinBreakPos to aMaxBreakPos. |
IMPORT_C TBool | IsHangingCharacter | ( | TUint | aChar | ) | const |
Tests whether a character can overhang the right margin.
TUint aChar | The Unicode character code of interest |
IMPORT_C TUint | LineBreakClass | ( | TUint | aCode, |
TUint & | aRangeStart, | |||
TUint & | aRangeEnd | |||
) | const |
Gets the line break class for a Unicode character.
This implements MFormCustomWrap::LineBreakClass() .
Returns the line break class for a character. Return the range of characters including aCode that are known to share this range.
The custom wrapping interface returns the default implementation. The overriding implementation could return different value to perform custom line break. Test
TUint aCode | The Unicode character code |
TUint & aRangeStart | On return, contains the Unicode character code at the start of the range including aCode that shares the same line break class as aCode. |
TUint & aRangeEnd | On return, contains the Unicode character code at the end of the range including aCode that shares the same line break class as aCode |
IMPORT_C TBool | LineBreakPossible | ( | TUint | aPrevClass, |
TUint | aNextClass, | |||
TBool | aHaveSpaces | |||
) | const |
Tests whether a line break is possible between two characters.
This implements MFormCustomWrap::LineBreakPossible() .
Return TRUE if a line break is possible between characters of the two specified classes. If aHaveSpaces is TRUE, one or more characters in ESpLineBreakClass was found between the characters in the two specified classes.
For the custom implementation here, returns true everytime, ie a line break is possible anywhere. This allows the edwin to break a line anywhere, thus eliminating the jagged white space at the right hand side of the edwin window. Test
TUint aPrevClass | The line break class of the previous non-space character. |
TUint aNextClass | The line break class of the next non-space character. |
TBool aHaveSpaces | True if there are one or more space characters (with a line break class of MTmCustom::ESpLineBreakClass) between aPrevClass and aNextClass; false if not. |
IMPORT_C CLafEdwinCustomWrapBase * | NewL | ( | const CCoeControl & | aControl | ) | [static] |
Allocates and constructs the custom line breaker.
const CCoeControl & aControl | The Edwin control |
const CCoeControl & | iControl | [protected] |
The Edwin control, initialised by the constructor.
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.