Support of Bidirectional and Contextual Languages > The Class IlvBidiString
 
The Class IlvBidiString
The class IlvBidiString can be used to handle bidirectional strings. Its header file is <ilviews/bidi/type.h>.
Its synopsis is the following:
class IlvBidiString
{
public:
IlvBidiString(const IlvBidiString&);
~IlvBidiString();
const char* getString() const;
};
The only public constructor that this class allows is the copy constructor. Typically, you obtain a const IlvBidiString* from a const char* using the IlvGetBidiString functions (see Functions Using the IlvBidiString Class). You can then copy this object if you want to keep it.
The IlvGetBidiString::getString method returns a pointer to a reordered string obtained from the string passed initially to IlvGetBidiString. The returned string depends on the platform used (UNIX or Windows). If you intend to write portable code, use this string exclusively to compute its length.
This class is for internal use or for low-level operations. Most of the applications do not need to use it, since textual data is handled transparently by the gadgets (or any other graphic objects).
Functions Using the IlvBidiString Class
These functions are declared in the <ilviews/bidi/bidi.h> header file. Their signature follows:
const IlvBidiString*
IlvGetBidiString(const IlvFont* font,
const char* string,
int length,
const IlvPort* destination = 0);
const IlvBidiString*
IlvGetBidiString(const IlvFont* font,
const char* string,
int length,
IlvNumerals numerals,
IlvSwapping swapping,
IlvLayoutDirection layoutDirection,
IlvShaping shaping,
IlvWordBreak wordBreak,
const IlvPort* destination = 0);
They return an IlvBidiString, which is obtained by applying bidirectional parameters to the specified string.
The first IlvGetBidiString function uses the default bidirectional attributes of the display that is associated with the specified font. The second one uses the bidirectional attributes provided as parameters. Only the first length characters of the string are taken into account. A value of -1 for length is equivalent to using strlen(string). The font parameter indicates the font that will be used to draw or compute the string length.
Note: The returned IlvBidiString object is handled by Rogue Wave Views and must not be modified or deleted. Moreover, it can be overwritten by other functions of the Rogue Wave Views API. This object can be safely provided as a parameter to member functions of the class IlvPort and IlvFont, such as drawString() or stringWidth(). However, if the IlvBidiString must be kept or passed to other Rogue Wave Views functions, the calling function should make a copy of that object.
IlvPort Methods Using the IlvBidiString Class
The following member functions are similar to those documented in the Rogue Wave Views Foundation Package API Reference Guide, except that const char* has been replaced with const IlvBidiString*:
virtual void
drawString(const IlvPalette* pal,
const IlvPoint& p,
const IlvBidiString* s,
int length,
IlvAlignment align = IlvLeft) const = 0;
 
virtual void
drawIString(const IlvPalette* pal,
const IlvPoint& p,
const IlvBidiString* s,
int length,
IlvAlignment align = IlvLeft) const = 0;
 
virtual void
drawTransformedString(const IlvPalette* pal,
const IlvBidiString* label,
int length,
const IlvTransformer& t,
const IlvRegion* clip = 0) const = 0;
 
virtual void
drawLabel(const IlvPalette* palette,
const IlvBidiString* label,
int length,
const IlvRect& drawrect,
const IlvRegion* region = 0,
IlvPosition position = IlvCenter) const;
 
virtual void
drawMnemonicLabel(const IlvPalette* palette,
const IlvBidiString* label,
const IlvRect& drawrect,
const IlvRegion* region = 0,
IlvPosition position = IlvCenter,
IlBoolean underline = IlTrue) const;
IlvFont Methods Using the IlvBidiString Class
The following member functions are similar to those documented in the Rogue Wave Views Foundation Package API Reference Guide, except that const char* has been replaced with const IlvBidiString*:
IlvDim
stringWidth(const IlvBidiString* string,
int length = -1) const;
IlvDim
stringHeight(const IlvBidiString* string,
int length = -1) const;
void sizes(const IlvBidiString* s,
int length,
IlvDim& w,
IlvDim& h,
IlvDim& d) const;

Version 5.6
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.