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);
Public Member Functions | |
---|---|
TRangeChange(TInt, TInt, TChangeType) | |
TRangeChange() | |
IMPORT_C TBool | Clip(TInt, TInt) |
IMPORT_C TChangeType | Get(TInt &, TInt &) |
TBool | IsJoinedTo(const TRangeChange) |
void | Join(const TRangeChange) |
IMPORT_C TBool | NonNull() |
IMPORT_C void | OptimizeWith(TRangeChange &) |
IMPORT_C void | Set(TInt, TInt, TChangeType) |
Public Member Enumerations | |
---|---|
enum | TChangeType { ESet, EClear } |
Private Attributes | |
---|---|
TInt | iA |
TInt | iB |
IMPORT_C | TRangeChange | ( | TInt | aStart, |
TInt | aEnd, | |||
TChangeType | aChange | |||
) |
TInt aStart | |
TInt aEnd | |
TChangeType aChange |
TBool | IsJoinedTo | ( | const TRangeChange | aRange | ) |
const TRangeChange aRange |
IMPORT_C void | OptimizeWith | ( | TRangeChange & | aBuddy | ) |
TRangeChange & aBuddy |
IMPORT_C void | Set | ( | TInt | aStart, |
TInt | aEnd, | |||
TChangeType | aChange | |||
) |
TInt aStart | |
TInt aEnd | |
TChangeType aChange |
Enumerates the possible change types.
ESet |
The object is being used to set a range. |
EClear |
The object is being used to clear a range. |