ParagraphLayout Class Reference

ParagraphLayout. More...

#include <ParagraphLayout.h>

Inheritance diagram for ParagraphLayout:
UObject UMemory

Data Structures

class  Line
 This class represents a single line of text in a ParagraphLayout. More...
struct  StyleRunInfo
class  VisualRun
 This object represents a single visual run in a line of text in a paragraph. More...

Public Member Functions

 ParagraphLayout (const LEUnicode chars[], le_int32 count, const FontRuns *fontRuns, const ValueRuns *levelRuns, const ValueRuns *scriptRuns, const LocaleRuns *localeRuns, UBiDiLevel paragraphLevel, le_bool vertical, LEErrorCode &status)
 Construct a ParagraphLayout object for a styled paragraph.
 ~ParagraphLayout ()
 The destructor.
UBiDiLevel getParagraphLevel ()
 Return the resolved paragraph level.
UBiDiDirection getTextDirection ()
 Return the directionality of the text in the paragraph.
virtual le_int32 getAscent () const
 Return the max ascent value for all the fonts in the paragraph.
virtual le_int32 getDescent () const
 Return the max descent value for all the fonts in the paragraph.
virtual le_int32 getLeading () const
 Return the max leading value for all the fonts in the paragraph.
void reflow ()
 Reset line breaking to start from the beginning of the paragraph.
le_bool isDone () const
 Convenience method for determining if paragraph layout processing is complete ( i.e.
LinenextLine (float width)
 Return a ParagraphLayout::Line object which represents next line in the paragraph.
virtual UClassID getDynamicClassID () const
 ICU "poor man's RTTI", returns a UClassID for the actual class.

Static Public Member Functions

static le_bool isComplex (const LEUnicode chars[], le_int32 count)
 Examine the given text and determine if it contains characters in any script which requires complex processing to be rendered correctly.
static UClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.

Detailed Description

ParagraphLayout.

The ParagraphLayout object will analyze the text into runs of text in the same font, script and direction, and will create a LayoutEngine object for each run. The LayoutEngine will transform the characters into glyph codes in visual order.

Clients can use this to break a paragraph into lines, and to display the glyphs in each line.

Definition at line 44 of file ParagraphLayout.h.


Constructor & Destructor Documentation

ParagraphLayout::ParagraphLayout ( const LEUnicode  chars[],
le_int32  count,
const FontRuns fontRuns,
const ValueRuns levelRuns,
const ValueRuns scriptRuns,
const LocaleRuns localeRuns,
UBiDiLevel  paragraphLevel,
le_bool  vertical,
LEErrorCode status 
)

Construct a ParagraphLayout object for a styled paragraph.

The paragraph is specified as runs of text all in the same font. An LEFontInstance object and a limit offset are specified for each font run. The limit offset is the offset of the character immediately after the font run.

Clients can optionally specify directional runs and / or script runs. If these aren't specified they will be computed.

If any errors are encountered during construction, status will be set, and the object will be set to be empty.

Parameters:
chars is an array of the characters in the paragraph
count is the number of characters in the paragraph.
fontRuns a pointer to a FontRuns object representing the font runs.
levelRuns is a pointer to a ValueRuns object representing the directional levels. If this pointer in NULL the levels will be determined by running the Unicde Bidi algorithm.
scriptRuns is a pointer to a ValueRuns object representing script runs. If this pointer in NULL the script runs will be determined using the Unicode code points.
localeRuns is a pointer to a LocaleRuns object representing locale runs. The Locale objects are used to determind the language of the text. If this pointer is NULL the default locale will be used for all of the text.
paragraphLevel is the directionality of the paragraph, as in the UBiDi object.
vertical is TRUE if the paragraph should be set vertically.
status will be set to any error code encountered during construction.
See also:
ubidi.h
LEFontInstance.h
LayoutEngine.h
RunArrays.h
Stable:
ICU 2.8
ParagraphLayout::~ParagraphLayout (  ) 

The destructor.

Virtual so that it works correctly with sublcasses.

Stable:
ICU 3.2

Member Function Documentation

virtual le_int32 ParagraphLayout::getAscent (  )  const [virtual]

Return the max ascent value for all the fonts in the paragraph.

Returns:
the ascent value.
Stable:
ICU 3.2
virtual le_int32 ParagraphLayout::getDescent (  )  const [virtual]

Return the max descent value for all the fonts in the paragraph.

Returns:
the decent value.
Stable:
ICU 3.2
virtual UClassID ParagraphLayout::getDynamicClassID ( void   )  const [inline, virtual]

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

Stable:
ICU 3.2

Implements UObject.

Definition at line 543 of file ParagraphLayout.h.

virtual le_int32 ParagraphLayout::getLeading (  )  const [virtual]

Return the max leading value for all the fonts in the paragraph.

Returns:
the leading value.
Stable:
ICU 3.2
UBiDiLevel ParagraphLayout::getParagraphLevel (  )  [inline]

Return the resolved paragraph level.

This is useful for those cases where the bidi analysis has determined the level based on the first strong character in the paragraph.

Returns:
the resolved paragraph level.
Stable:
ICU 3.2

Definition at line 638 of file ParagraphLayout.h.

References ubidi_getParaLevel().

static UClassID ParagraphLayout::getStaticClassID ( void   )  [inline, static]

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

Stable:
ICU 3.2

Definition at line 536 of file ParagraphLayout.h.

UBiDiDirection ParagraphLayout::getTextDirection (  )  [inline]

Return the directionality of the text in the paragraph.

Returns:
UBIDI_LTR if the text is all left to right, UBIDI_RTL if the text is all right to left, or UBIDI_MIXED if the text has mixed direction.
Stable:
ICU 3.2

Definition at line 643 of file ParagraphLayout.h.

References ubidi_getDirection().

static le_bool ParagraphLayout::isComplex ( const LEUnicode  chars[],
le_int32  count 
) [static]

Examine the given text and determine if it contains characters in any script which requires complex processing to be rendered correctly.

Parameters:
chars is an array of the characters in the paragraph
count is the number of characters in the paragraph.
Returns:
TRUE if any of the text requires complex processing.
Stable:
ICU 3.2
le_bool ParagraphLayout::isDone (  )  const [inline]

Convenience method for determining if paragraph layout processing is complete ( i.e.

there are no more lines left to process. )

Returns:
true if there are no more lines to be processed
Internal:
Do not use. This API is for internal use only.
Line* ParagraphLayout::nextLine ( float  width  ) 

Return a ParagraphLayout::Line object which represents next line in the paragraph.

The width of the line is specified each time so that it can be varied to support arbitrary paragraph shapes.

Parameters:
width is the width of the line. If width is less than or equal to zero, a ParagraphLayout::Line object representing the rest of the paragraph will be returned.
Returns:
a ParagraphLayout::Line object which represents the line. The caller is responsible for deleting the object. Returns NULL if there are no more lines in the paragraph.
See also:
ParagraphLayout::Line
Stable:
ICU 3.2
void ParagraphLayout::reflow (  )  [inline]

Reset line breaking to start from the beginning of the paragraph.

Stable:
ICU 3.2

Definition at line 648 of file ParagraphLayout.h.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sat Jan 23 15:17:43 2010 for ICU 4.3.4 by  doxygen 1.6.1