CTextLayout::TRangeChange Class Reference

class CTextLayout::TRangeChange

Specifies the range of characters involved when setting or clearing a text selection.

This class is used in the CTextLayout::Highlight() function. The following code demonstrates how it should be used to clear an existing highlight and set a new one:

	CTextLayout::TRangeChange oldHighlight(anchorPos, old_cursorPos,
	CTextLayout::TRangeChange::EClear); // existing highlight
	CTextLayout::TRangeChange newHighlight(anchorPos, new_cursorPos,
	CTextLayout::TRangeChange::ESet); // new one
	newHighlight.OptimizeWith(oldHighlight); // doesn't matter which range is
	the parameter and which is the calling object
	layout.Highlight(oldHighlight,drawRect,context); // doesn't matter in which
	order this and following line occur
	layout.Highlight(newHighlight,drawRect,context);

CTextLayout::Highlight()

Public Member Functions
TRangeChange(TInt, TInt, TChangeType)
TRangeChange()
IMPORT_C TBoolClip(TInt, TInt)
IMPORT_C TChangeTypeGet(TInt &, TInt &)
TBool IsJoinedTo(const TRangeChange)
voidJoin(const TRangeChange)
IMPORT_C TBoolNonNull()
IMPORT_C voidOptimizeWith(TRangeChange &)
IMPORT_C voidSet(TInt, TInt, TChangeType)
Public Member Enumerations
enumTChangeType { ESet, EClear }
Private Attributes
TInt iA
TInt iB

Constructor & Destructor Documentation

TRangeChange(TInt, TInt, TChangeType)

IMPORT_CTRangeChange(TIntaStart,
TIntaEnd,
TChangeTypeaChange
)

Parameters

TInt aStart
TInt aEnd
TChangeType aChange

TRangeChange()

IMPORT_CTRangeChange()

Member Functions Documentation

Clip(TInt, TInt)

IMPORT_C TBoolClip(TIntaMin,
TIntaMax
)

Parameters

TInt aMin
TInt aMax

Get(TInt &, TInt &)

IMPORT_C TChangeTypeGet(TInt &aStart,
TInt &aEnd
)const

Parameters

TInt & aStart
TInt & aEnd

IsJoinedTo(const TRangeChange)

TBool IsJoinedTo(const TRangeChangeaRange)

Parameters

const TRangeChange aRange

Join(const TRangeChange)

voidJoin(const TRangeChangeaRange)

Parameters

const TRangeChange aRange

NonNull()

IMPORT_C TBoolNonNull()const

OptimizeWith(TRangeChange &)

IMPORT_C voidOptimizeWith(TRangeChange &aBuddy)

Parameters

TRangeChange & aBuddy

Set(TInt, TInt, TChangeType)

IMPORT_C voidSet(TIntaStart,
TIntaEnd,
TChangeTypeaChange
)

Parameters

TInt aStart
TInt aEnd
TChangeType aChange

Member Enumerations Documentation

Enum TChangeType

Enumerates the possible change types.

Enumerators

ESet

The object is being used to set a range.

EClear

The object is being used to clear a range.

Member Data Documentation

TInt iA

TInt iA[private]

TInt iB

TInt iB[private]