Translator::OnBidirectionalText

Translator::OnBidirectionalText
virtual bool OnBidirectionalText(const wchar_t* text, UPInt textLen, wchar_t* newText, unsigned* indexMap, bool* mirrorBits);
Description

OnBidirectionalText is a callback that is called on bidirectional text enabled textfields. This method receives original text ('text'/'textLen' parameters) and pre-allocated buffers:

Parameters
Parameters 
Description 
const wchar_t* text 
The original text. 
UPInt textLen 
Length of the text. 
wchar_t* newText 
New re-ordered text should be put there, do not overrun the length (the length is the same as 'textLen') 
unsigned* indexMap 
A buffer for an array of unsigned integers, that should be filled with new indices of each char. For example, if original char at index 0 was relocated to index 10, then indexMap[0] = 10. 
bool* mirrorBits 
A buffer for an array of bools (length = 'textLen'), where index is an index of char in 'newText' and the value (true/false) indicates necessity of the glyph mirroring (for example, for integral sign). 
Return Value

Should return 'true' if method was successful and the core should use contents of the buffers; false, if no changes to the textfield should be applied.