CLafEdwinCustomWrapBase Class Reference

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.

Inherits from

  • CLafEdwinCustomWrapBase

Constructor & Destructor Documentation

CLafEdwinCustomWrapBase(const CCoeControl &)

IMPORT_CCLafEdwinCustomWrapBase(const CCoeControl &aControl)[protected]

Constructor.

Test

Parameters

const CCoeControl & aControlThe Edwin control

~CLafEdwinCustomWrapBase()

IMPORT_C~CLafEdwinCustomWrapBase()

Destructor.

Test

Member Functions Documentation

GetLineBreakInContext(const TDesC &, TInt, TInt, TBool, TInt &)

IMPORT_C TBoolGetLineBreakInContext(const TDesC &aText,
TIntaMinBreakPos,
TIntaMaxBreakPos,
TBoolaForwards,
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

Parameters

const TDesC & aTextA string containing characters of class MTmCustom::ESaLineBreakClass.
TInt aMinBreakPosA position within aText at which to begin searching for a possible line break position.
TInt aMaxBreakPosA position within aText at which to stop searching for a possible line break position.
TBool aForwardsIf 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 & aBreakPosOn 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.

IsHangingCharacter(TUint)

IMPORT_C TBoolIsHangingCharacter(TUintaChar)const

Tests whether a character can overhang the right margin.

Test

Parameters

TUint aCharThe Unicode character code of interest

LineBreakClass(TUint, TUint &, TUint &)

IMPORT_C TUintLineBreakClass(TUintaCode,
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

Parameters

TUint aCodeThe Unicode character code
TUint & aRangeStartOn return, contains the Unicode character code at the start of the range including aCode that shares the same line break class as aCode.
TUint & aRangeEndOn return, contains the Unicode character code at the end of the range including aCode that shares the same line break class as aCode

LineBreakPossible(TUint, TUint, TBool)

IMPORT_C TBoolLineBreakPossible(TUintaPrevClass,
TUintaNextClass,
TBoolaHaveSpaces
)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

Parameters

TUint aPrevClassThe line break class of the previous non-space character.
TUint aNextClassThe line break class of the next non-space character.
TBool aHaveSpacesTrue if there are one or more space characters (with a line break class of MTmCustom::ESpLineBreakClass) between aPrevClass and aNextClass; false if not.

MFormCustomWrap_Reserved_1()

IMPORT_C voidMFormCustomWrap_Reserved_1()[private]

Unused.

Test

MFormCustomWrap_Reserved_2()

IMPORT_C voidMFormCustomWrap_Reserved_2()[private]

Unused.

Test

NewL(const CCoeControl &)

IMPORT_C CLafEdwinCustomWrapBase *NewL(const CCoeControl &aControl)[static]

Allocates and constructs the custom line breaker.

Test

Parameters

const CCoeControl & aControlThe Edwin control

Member Data Documentation

const CCoeControl & iControl

const CCoeControl &iControl[protected]

The Edwin control, initialised by the constructor.

TInt iSpare

TInt iSpare[private]

Unused.