Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

ICULayoutEngine Class Reference

This is a wrapper class designed to allow ICU clients to use LayoutEngine in a way that is consistent with the rest of ICU. More...

#include <loengine.h>

Inheritance diagram for ICULayoutEngine::

UObject UMemory List of all members.

Public Methods

virtual ~ICULayoutEngine ()
 The destructor. More...

int32_t layoutChars (const UChar chars[], int32_t startOffset, int32_t endOffset, int32_t maxOffset, UBool rightToLeft, float x, float y, UErrorCode &success)
 This method computes the glyph, character index and position arrays for the input characters. More...

int32_t layoutString (const UnicodeString &str, int32_t startOffset, int32_t endOffset, UBool rightToLeft, float x, float y, UErrorCode &success)
 This method computes the glyph, character index and position arrays for the input characters. More...

int32_t countGlyphs () const
 This method returns the number of glyphs in the glyph array. More...

void getGlyphs (uint32_t glyphs[], UErrorCode &success)
 This method copies the glyph array into a caller supplied array. More...

void getCharIndices (int32_t charIndices[], UErrorCode &success)
 This method copies the character index array into a caller supplied array. More...

void getCharIndices (int32_t charIndices[], int32_t indexBase, UErrorCode &success)
 This method copies the character index array into a caller supplied array. More...

void getGlyphPositions (float positions[], UErrorCode &success)
 This method copies the position array into a caller supplied array. More...

void getGlyphPosition (int32_t glyphIndex, float &x, float &y, UErrorCode &success)
 This method returns the X and Y position of the glyph at the given index. More...

virtual UClassID getDynamicClassID () const
 ICU "poor man's RTTI", returns a UClassID for the actual class. More...


Static Public Methods

ICULayoutEngine * createInstance (const LEFontInstance *fontInstance, UScriptCode scriptCode, Locale &locale, UErrorCode &success)
 This method returns an ICULayoutEngine capable of laying out text in the given font, script and langauge. More...

UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class. More...


Private Methods

 ICULayoutEngine ()
 This no argument constructor is private so that clients can't envoke it. More...

 ICULayoutEngine (LayoutEngine *layoutEngine)
 The main constructor. More...


Private Attributes

LayoutEnginefLayoutEngine
 This holds the instance of LayoutEngine that does all the work. More...


Static Private Attributes

const char fgClassID
 The address of this static class variable serves as this class's ID for ICU "poor man's RTTI". More...


Detailed Description

This is a wrapper class designed to allow ICU clients to use LayoutEngine in a way that is consistent with the rest of ICU.

(LayoutEngine was developed seperately from ICU and the same source is used in non-ICU environments, so it cannot be changed to match ICU coding conventions).

This class is designed for clients who wish to use LayoutEngine to layout complex text. If you need to subclass LayoutEngine, you'll need to use the LayoutEngine interfaces directly.

Basically, it creates an instance of LayoutEngine, stashes it in fLayoutEngine, and uses it to implement the layout functionality.

Use the createInstance method to create an ICULayoutEngine. Use delete to destroy it. The layoutChars method computes the glyphs and positions, and saves them in the ICULayoutEngine object. Use getGlyphs, getPositions and getCharIndices to retreive this data.

You'll also need an implementation of LEFontInstance for your platform.

See also:
LayoutEngine.h , LEFontInstance.h
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 51 of file loengine.h.


Constructor & Destructor Documentation

ICULayoutEngine::ICULayoutEngine   [inline, private]
 

This no argument constructor is private so that clients can't envoke it.

Clients should use createInstance.

See also:
createInstance

Definition at line 268 of file loengine.h.

Referenced by createInstance().

ICULayoutEngine::ICULayoutEngine LayoutEngine   layoutEngine [inline, private]
 

The main constructor.

It is defined as private to stop clients from invoking it. Clients should use createInstance.

Parameters:
layoutEngine  - the LayoutEngine that this instance wraps.
See also:
createInstance

Definition at line 273 of file loengine.h.

ICULayoutEngine::~ICULayoutEngine   [inline, virtual]
 

The destructor.

At least on Windows it needs to be virtual to ensure that it deletes the object from the same heap that createInstance will allocate it from. We don't know why this is...

See also:
createInstance
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 279 of file loengine.h.


Member Function Documentation

int32_t ICULayoutEngine::countGlyphs   const [inline]
 

This method returns the number of glyphs in the glyph array.

Note that the number of glyphs will be greater than or equal to the number of characters used to create the LayoutEngine.

Returns:
the number of glyphs in the glyph array
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 322 of file loengine.h.

ICULayoutEngine * ICULayoutEngine::createInstance const LEFontInstance   fontInstance,
UScriptCode    scriptCode,
Locale   locale,
UErrorCode   success
[inline, static]
 

This method returns an ICULayoutEngine capable of laying out text in the given font, script and langauge.

Parameters:
fontInstance  - the font of the text
scriptCode  - the script of the text
locale  - used to determine the language of the text
success  - output parameter set to an error code if the operation fails
Returns:
an ICULayoutEngine which can layout text in the given font.
NOTE: currently, locale is ignored...

See also:
LEFontInstance
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 352 of file loengine.h.

void ICULayoutEngine::getCharIndices int32_t    charIndices[],
int32_t    indexBase,
UErrorCode   success
[inline]
 

This method copies the character index array into a caller supplied array.

The caller must ensure that the array is large enough to hold a character index for each glyph.

Parameters:
charIndices  - the destiniation character index array
indexBase  - an offset which will be added to each index
success  - output parameter set to an error code if the operation fails
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 337 of file loengine.h.

void ICULayoutEngine::getCharIndices int32_t    charIndices[],
UErrorCode   success
[inline]
 

This method copies the character index array into a caller supplied array.

The caller must ensure that the array is large enough to hold a character index for each glyph.

Parameters:
charIndices  - the destiniation character index array
success  - output parameter set to an error code if the operation fails
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 332 of file loengine.h.

virtual UClassID ICULayoutEngine::getDynamicClassID void    const [inline, virtual]
 

ICU "poor man's RTTI", returns a UClassID for the actual class.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Reimplemented from UObject.

Definition at line 250 of file loengine.h.

void ICULayoutEngine::getGlyphPosition int32_t    glyphIndex,
float &    x,
float &    y,
UErrorCode   success
[inline]
 

This method returns the X and Y position of the glyph at the given index.

Input parameters:

Parameters:
glyphIndex  - the index of the glyph
Output parameters:
Parameters:
x  - the glyph's X position
y  - the glyph's Y position
success  - output parameter set to an error code if the operation fails
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 347 of file loengine.h.

void ICULayoutEngine::getGlyphPositions float    positions[],
UErrorCode   success
[inline]
 

This method copies the position array into a caller supplied array.

The caller must ensure that the array is large enough to hold an X and Y position for each glyph, plus an extra X and Y for the advance of the last glyph.

Parameters:
glyphs  - the destiniation position array
success  - output parameter set to an error code if the operation fails
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 342 of file loengine.h.

void ICULayoutEngine::getGlyphs uint32_t    glyphs[],
UErrorCode   success
[inline]
 

This method copies the glyph array into a caller supplied array.

The caller must ensure that the array is large enough to hold all the glyphs.

Parameters:
glyphs  - the destiniation glyph array
success  - output parameter set to an error code if the operation fails
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 327 of file loengine.h.

UClassID ICULayoutEngine::getStaticClassID void    [inline, static]
 

ICU "poor man's RTTI", returns a UClassID for this class.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 257 of file loengine.h.

int32_t ICULayoutEngine::layoutChars const UChar    chars[],
int32_t    startOffset,
int32_t    endOffset,
int32_t    maxOffset,
UBool    rightToLeft,
float    x,
float    y,
UErrorCode   success
[inline]
 

This method computes the glyph, character index and position arrays for the input characters.

Parameters:
chars  - the input character context
startOffset  - the starting offset of the characters to process
endOffset  - the ending offset of the characters to process
max  - the number of characters in the input context
rightToLeft  - true if the characers are in a right to left directional run
x  - the initial X position
y  - the initial Y position
success  - output parameter set to an error code if the operation fails
Returns:
the number of glyphs in the glyph array
Note; the glyph, character index and position array can be accessed using the getter method below.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 285 of file loengine.h.

int32_t ICULayoutEngine::layoutString const UnicodeString   str,
int32_t    startOffset,
int32_t    endOffset,
UBool    rightToLeft,
float    x,
float    y,
UErrorCode   success
[inline]
 

This method computes the glyph, character index and position arrays for the input characters.

Parameters:
str  - the input character context
startOffset  - the starting offset of the characters to process
endOffset  - the ending offset of the characters to process
rightToLeft  - true if the characers are in a right to left directional run
x  - the initial X position
y  - the initial Y position
success  - output parameter set to an error code if the operation fails
Returns:
the number of glyphs in the glyph array
Note; the glyph, character index and position array can be accessed using the getter method below.

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 304 of file loengine.h.


Member Data Documentation

LayoutEngine* ICULayoutEngine::fLayoutEngine [private]
 

This holds the instance of LayoutEngine that does all the work.

Definition at line 57 of file loengine.h.

const char ICULayoutEngine::fgClassID [static, private]
 

The address of this static class variable serves as this class's ID for ICU "poor man's RTTI".

Definition at line 265 of file loengine.h.


The documentation for this class was generated from the following file:
Generated on Mon Nov 24 14:36:34 2003 for ICU 2.8 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001