TBidirectionalState Class Reference

class TBidirectionalState

The bidirectional state class. This class contains functions that implement the Unicode Bidirectional Algorithm, which changes text from logical order to display order for the correct display of right-to-left scripts, like Arabic and Hebrew. A TBidirectionalState object carries the embedding level and stack from one line to the next. On construction it is in its 'start of paragraph' state.

Public Member Functions
TBidirectionalState()
TBidirectionalState(TChar::TBdCategory, TChar::TBdCategory, TBool)
TInt CatToNumber(TInt)
TCategory CharToBdCat(TChar::TBdCategory)
voidDeneutralizeRuns(TRunInfo *, TRunInfo *, TCategory, TCategory)
IMPORT_C voidExternalizeL(RWriteStream &)
TInt GenerateBdRunArray(const TText *, TInt, TBidirectionalState::TRunInfo *, TInt)
voidHandleBdControls(TReorderContext &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsDefault()
TBool ParRightToLeft()
voidPrepareForNextLine(const TReorderContext &)
IMPORT_C voidReorderLine(TRunInfo *, TInt, TBool, TBool, TBool, TChar::TBdCategory, TChar::TBdCategory, TBool &)
IMPORT_C voidReorderLine(TRunInfo *, TInt, TBool, TBool, TBool, TChar::TBdCategory, TChar::TBdCategory)
voidReorderRuns(TReorderContext &)
IMPORT_C TIntReorderText(const TText *, TInt, TBool, TText *&)
IMPORT_C voidReset()
voidResolveImplicitLevels(TReorderContext &)
voidResolveNeutralTypes(TReorderContext &)
voidResolveWeakTypesW1W2W3(TReorderContext &)
voidResolveWeakTypesW4W5W6(TReorderContext &)
voidResolveWeakTypesW7(TReorderContext &)
IMPORT_C voidReverseGroups(TText *, TInt)
TCategory UintToBdCat(TUint)
IMPORT_C TBooloperator==(const TBidirectionalState &)
Private Member Functions
TCategory Pop()
TCategory Push(TCategory)
const TStackItem &State()
Private Member Enumerations
enumanonymous { EMaxExplicitLevel = 61, EMaxLevel = 63, EMaxStackLevels = 62 }
enumTCategory {
ELeftToRight = 1 << TChar::ELeftToRight, ELeftToRightEmbedding = 1 << TChar::ELeftToRightEmbedding, ELeftToRightOverride = 1 << TChar::ELeftToRightOverride, ERightToLeft = 1 << TChar::ERightToLeft, ERightToLeftArabic = 1 << TChar::ERightToLeftArabic, ERightToLeftEmbedding = 1 << TChar::ERightToLeftEmbedding, ERightToLeftOverride = 1 << TChar::ERightToLeftOverride, EPopDirectionalFormat = 1 << TChar::EPopDirectionalFormat, EEuropeanNumber = 1 << TChar::EEuropeanNumber, EEuropeanNumberSeparator = 1 << TChar::EEuropeanNumberSeparator, EEuropeanNumberTerminator = 1 << TChar::EEuropeanNumberTerminator, EArabicNumber = 1 << TChar::EArabicNumber, ECommonNumberSeparator = 1 << TChar::ECommonNumberSeparator, ENonSpacingMark = 1 << TChar::ENonSpacingMark, EBoundaryNeutral = 1 << TChar::EBoundaryNeutral, EParagraphSeparator = 1 << TChar::EParagraphSeparator, ESegmentSeparator = 1 << TChar::ESegmentSeparator, EWhitespace = 1 << TChar::EWhitespace, EOtherNeutral = 1 << TChar::EOtherNeutral, EBdControlsGroup = ELeftToRightEmbedding | ERightToLeftEmbedding | ELeftToRightOverride | ERightToLeftOverride | EPopDirectionalFormat, ELeftToRightGroup = ELeftToRight | EEuropeanNumber | ELeftToRightOverride | ELeftToRightEmbedding, ERightToLeftGroup = ERightToLeft | EArabicNumber | ERightToLeftArabic | ERightToLeftOverride | ERightToLeftEmbedding, EStrongGroup = ELeftToRightEmbedding | ERightToLeftEmbedding | ELeftToRightOverride | ERightToLeftOverride | ELeftToRight | ERightToLeft | ERightToLeftArabic, ENoCategory = 0
}
enumTOverrideState { ENoOverrideState = 0, ELeftToRightOverrideState = ELeftToRightOverride, ERightToLeftOverrideState = ERightToLeftOverride }
Private Attributes
TCategory iPreviousCategory
TCategory iPreviousStrongCategory
TInt8 iPushesBeyond60
TInt8 iPushesBeyond61
TStackItem iStack
TInt16 iStackLevel

Constructor & Destructor Documentation

TBidirectionalState()

IMPORT_CTBidirectionalState()

TBidirectionalState(TChar::TBdCategory, TChar::TBdCategory, TBool)

TBidirectionalState(TChar::TBdCategoryaPrevCat,
TChar::TBdCategoryaPrevStrongCat,
TBoolaParRightToLeft
)

Parameters

TChar::TBdCategory aPrevCat
TChar::TBdCategory aPrevStrongCat
TBool aParRightToLeft

Member Functions Documentation

CatToNumber(TInt)

TInt CatToNumber(TIntaCat)[static]

Parameters

TInt aCat

CharToBdCat(TChar::TBdCategory)

TCategory CharToBdCat(TChar::TBdCategoryaCat)[static]

Parameters

TChar::TBdCategory aCat

DeneutralizeRuns(TRunInfo *, TRunInfo *, TCategory, TCategory)

voidDeneutralizeRuns(TRunInfo *aStart,
TRunInfo *aEnd,
TCategoryaStartCategory,
TCategoryaEndCategory
)[static]

Parameters

TRunInfo * aStart
TRunInfo * aEnd
TCategory aStartCategory
TCategory aEndCategory

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aDest)

Parameters

RWriteStream & aDest

GenerateBdRunArray(const TText *, TInt, TBidirectionalState::TRunInfo *, TInt)

TInt GenerateBdRunArray(const TText *aText,
TIntaLength,
TBidirectionalState::TRunInfo *aRun,
TIntaMaxRuns
)[static]

Parameters

const TText * aText
TInt aLength
TBidirectionalState::TRunInfo * aRun
TInt aMaxRuns

HandleBdControls(TReorderContext &)

voidHandleBdControls(TReorderContext &aContext)

Parameters

TReorderContext & aContext

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aSource)

Parameters

RReadStream & aSource

IsDefault()

IMPORT_C TBoolIsDefault()const

ParRightToLeft()

TBool ParRightToLeft()const [inline]

Pop()

TCategory Pop()[private]

PrepareForNextLine(const TReorderContext &)

voidPrepareForNextLine(const TReorderContext &aContext)

Parameters

const TReorderContext & aContext

Push(TCategory)

TCategory Push(TCategoryaStartCategory)[private]

Parameters

TCategory aStartCategory

ReorderLine(TRunInfo *, TInt, TBool, TBool, TBool, TChar::TBdCategory, TChar::TBdCategory, TBool &)

IMPORT_C voidReorderLine(TRunInfo *aRunInfo,
TIntaRuns,
TBoolaParStart,
TBoolaParEnd,
TBoolaParRightToLeft,
TChar::TBdCategoryaNextCategory,
TChar::TBdCategoryaNextStrongCategory,
TBool &aVisualEndIsAmbiguous
)

Parameters

TRunInfo * aRunInfo
TInt aRuns
TBool aParStart
TBool aParEnd
TBool aParRightToLeft
TChar::TBdCategory aNextCategory
TChar::TBdCategory aNextStrongCategory
TBool & aVisualEndIsAmbiguous

ReorderLine(TRunInfo *, TInt, TBool, TBool, TBool, TChar::TBdCategory, TChar::TBdCategory)

IMPORT_C voidReorderLine(TRunInfo *aRunInfo,
TIntaRuns,
TBoolaParStart,
TBoolaParEnd,
TBoolaParRightToLeft,
TChar::TBdCategoryaNextCategory,
TChar::TBdCategoryaNextStrongCategory
)

Parameters

TRunInfo * aRunInfo
TInt aRuns
TBool aParStart
TBool aParEnd
TBool aParRightToLeft
TChar::TBdCategory aNextCategory
TChar::TBdCategory aNextStrongCategory

ReorderRuns(TReorderContext &)

voidReorderRuns(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ReorderText(const TText *, TInt, TBool, TText *&)

IMPORT_C TIntReorderText(const TText *aText,
TIntaLength,
TBoolaParRightToLeft,
TText *&aNewText
)[static]

Parameters

const TText * aText
TInt aLength
TBool aParRightToLeft
TText *& aNewText

Reset()

IMPORT_C voidReset()

ResolveImplicitLevels(TReorderContext &)

voidResolveImplicitLevels(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ResolveNeutralTypes(TReorderContext &)

voidResolveNeutralTypes(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ResolveWeakTypesW1W2W3(TReorderContext &)

voidResolveWeakTypesW1W2W3(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ResolveWeakTypesW4W5W6(TReorderContext &)

voidResolveWeakTypesW4W5W6(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ResolveWeakTypesW7(TReorderContext &)

voidResolveWeakTypesW7(TReorderContext &aContext)

Parameters

TReorderContext & aContext

ReverseGroups(TText *, TInt)

IMPORT_C voidReverseGroups(TText *aStart,
TIntaLength
)[static]

Parameters

TText * aStart
TInt aLength

State()

const TStackItem &State()const [private, inline]

UintToBdCat(TUint)

TCategory UintToBdCat(TUintaCat)[static]

Parameters

TUint aCat

operator==(const TBidirectionalState &)

IMPORT_C TBooloperator==(const TBidirectionalState &aState)const

Parameters

const TBidirectionalState & aState

Member Enumerations Documentation

Enum anonymous

Enumerators

EMaxExplicitLevel = 61
EMaxLevel = 63
EMaxStackLevels = 62

Enum TCategory

Enumerators

ELeftToRight = 1 << TChar::ELeftToRight
ELeftToRightEmbedding = 1 << TChar::ELeftToRightEmbedding
ELeftToRightOverride = 1 << TChar::ELeftToRightOverride
ERightToLeft = 1 << TChar::ERightToLeft
ERightToLeftArabic = 1 << TChar::ERightToLeftArabic
ERightToLeftEmbedding = 1 << TChar::ERightToLeftEmbedding
ERightToLeftOverride = 1 << TChar::ERightToLeftOverride
EPopDirectionalFormat = 1 << TChar::EPopDirectionalFormat
EEuropeanNumber = 1 << TChar::EEuropeanNumber
EEuropeanNumberSeparator = 1 << TChar::EEuropeanNumberSeparator
EEuropeanNumberTerminator = 1 << TChar::EEuropeanNumberTerminator
EArabicNumber = 1 << TChar::EArabicNumber
ECommonNumberSeparator = 1 << TChar::ECommonNumberSeparator
ENonSpacingMark = 1 << TChar::ENonSpacingMark
EBoundaryNeutral = 1 << TChar::EBoundaryNeutral
EParagraphSeparator = 1 << TChar::EParagraphSeparator
ESegmentSeparator = 1 << TChar::ESegmentSeparator
EWhitespace = 1 << TChar::EWhitespace
EOtherNeutral = 1 << TChar::EOtherNeutral
EBdControlsGroup = ELeftToRightEmbedding | ERightToLeftEmbedding | ELeftToRightOverride | ERightToLeftOverride | EPopDirectionalFormat
ELeftToRightGroup = ELeftToRight | EEuropeanNumber | ELeftToRightOverride | ELeftToRightEmbedding
ERightToLeftGroup = ERightToLeft | EArabicNumber | ERightToLeftArabic | ERightToLeftOverride | ERightToLeftEmbedding
EStrongGroup = ELeftToRightEmbedding | ERightToLeftEmbedding | ELeftToRightOverride | ERightToLeftOverride | ELeftToRight | ERightToLeft | ERightToLeftArabic
ENoCategory = 0

Enum TOverrideState

Enumerators

ENoOverrideState = 0
ELeftToRightOverrideState = ELeftToRightOverride
ERightToLeftOverrideState = ERightToLeftOverride

Member Data Documentation

TCategory iPreviousCategory

TCategory iPreviousCategory[private]

TCategory iPreviousStrongCategory

TCategory iPreviousStrongCategory[private]

TInt8 iPushesBeyond60

TInt8 iPushesBeyond60[private]

TInt8 iPushesBeyond61

TInt8 iPushesBeyond61[private]

TStackItem iStack

TStackItem iStack[private]

TInt16 iStackLevel

TInt16 iStackLevel[private]