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

ParagraphLayout Class Reference

ParagraphLayout. More...

#include <ParagraphLayout.h>

Inheritance diagram for ParagraphLayout::

UObject UMemory List of all members.

Public Methods

 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. More...

 ~ParagraphLayout ()
 The destructor. More...

UBiDiLevel getParagraphLevel ()
 Return the resolved paragraph level. More...

UBiDiDirection getTextDirection ()
 Return the directionality of the text in the paragraph. More...

virtual le_int32 getAscent () const
 Return the max ascent value for all the fonts in the paragraph. More...

virtual le_int32 getDescent () const
 Return the max descent value for all the fonts in the paragraph. More...

virtual le_int32 getLeading () const
 Return the max leading value for all the fonts in the paragraph. More...

void reflow ()
 Reset line breaking to start from the beginning of the paragraph. More...

LinenextLine (float width)
 Return a ParagraphLayout::Line object which represents next line in the paragraph. More...

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


Static Public Methods

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. More...

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


Private Methods

 ParagraphLayout ()
 ParagraphLayout (const ParagraphLayout &)
ParagraphLayout & operator= (const ParagraphLayout &)
void computeLevels (UBiDiLevel paragraphLevel)
LinecomputeVisualRuns ()
void appendRun (Line *line, le_int32 run, le_int32 firstChar, le_int32 lastChar)
void computeScripts ()
void computeLocales ()
void computeSubFonts (const FontRuns *fontRuns, LEErrorCode &status)
void computeMetrics ()
le_int32 getLanguageCode (const Locale *locale)
le_int32 getCharRun (le_int32 charIndex)
le_int32 previousBreak (le_int32 charIndex)

Static Private Methods

le_bool isComplex (UScriptCode script)

Private Attributes

const LEUnicodefChars
le_int32 fCharCount
const FontRunsfFontRuns
const ValueRunsfLevelRuns
const ValueRunsfScriptRuns
const LocaleRunsfLocaleRuns
le_bool fVertical
le_bool fClientLevels
le_bool fClientScripts
le_bool fClientLocales
UBiDiLevelfEmbeddingLevels
le_int32 fAscent
le_int32 fDescent
le_int32 fLeading
le_int32fGlyphToCharMap
le_int32fCharToMinGlyphMap
le_int32fCharToMaxGlyphMap
float * fGlyphWidths
le_int32 fGlyphCount
UBiDifParaBidi
UBiDifLineBidi
le_int32fStyleRunLimits
le_int32fStyleIndices
StyleRunInfofStyleRunInfo
le_int32 fStyleRunCount
BreakIteratorfBreakIterator
le_int32 fLineStart
le_int32 fLineEnd
le_int32 fFirstVisualRun
le_int32 fLastVisualRun
float fVisualRunLastX
float fVisualRunLastY

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

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 39 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
Draft:
This API has been introduced in ICU 2.8. It is still in draft state and may be modified in a future release.

ParagraphLayout::~ParagraphLayout  
 

The destructor.

Virtual so that it works correctly with sublcasses.

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

ParagraphLayout::ParagraphLayout   [inline, private]
 

Definition at line 554 of file ParagraphLayout.h.

ParagraphLayout::ParagraphLayout const ParagraphLayout &    [inline, private]
 

Definition at line 555 of file ParagraphLayout.h.


Member Function Documentation

void ParagraphLayout::appendRun Line   line,
le_int32    run,
le_int32    firstChar,
le_int32    lastChar
[private]
 

void ParagraphLayout::computeLevels UBiDiLevel    paragraphLevel [private]
 

void ParagraphLayout::computeLocales   [private]
 

void ParagraphLayout::computeMetrics   [private]
 

void ParagraphLayout::computeScripts   [private]
 

void ParagraphLayout::computeSubFonts const FontRuns   fontRuns,
LEErrorCode   status
[private]
 

Line* ParagraphLayout::computeVisualRuns   [private]
 

virtual le_int32 ParagraphLayout::getAscent   const [virtual]
 

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

Returns:
the ascent value.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

le_int32 ParagraphLayout::getCharRun le_int32    charIndex [private]
 

virtual le_int32 ParagraphLayout::getDescent   const [virtual]
 

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

Returns:
the decent value.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

virtual UClassID ParagraphLayout::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.6. It is still in draft state and may be modified in a future release.

Reimplemented from UObject.

Definition at line 521 of file ParagraphLayout.h.

le_int32 ParagraphLayout::getLanguageCode const Locale   locale [private]
 

virtual le_int32 ParagraphLayout::getLeading   const [virtual]
 

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

Returns:
the leading value.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

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.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 623 of file ParagraphLayout.h.

UClassID ParagraphLayout::getStaticClassID void    [inline, static]
 

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

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

Definition at line 528 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.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 628 of file ParagraphLayout.h.

le_bool ParagraphLayout::isComplex UScriptCode    script [static, private]
 

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.
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

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
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

ParagraphLayout& ParagraphLayout::operator= const ParagraphLayout &    [inline, private]
 

Definition at line 556 of file ParagraphLayout.h.

le_int32 ParagraphLayout::previousBreak le_int32    charIndex [private]
 

void ParagraphLayout::reflow   [inline]
 

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

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

Definition at line 633 of file ParagraphLayout.h.


Member Data Documentation

le_int32 ParagraphLayout::fAscent [private]
 

Definition at line 595 of file ParagraphLayout.h.

BreakIterator* ParagraphLayout::fBreakIterator [private]
 

Definition at line 613 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fCharCount [private]
 

Definition at line 581 of file ParagraphLayout.h.

le_int32* ParagraphLayout::fCharToMaxGlyphMap [private]
 

Definition at line 601 of file ParagraphLayout.h.

le_int32* ParagraphLayout::fCharToMinGlyphMap [private]
 

Definition at line 600 of file ParagraphLayout.h.

const LEUnicode* ParagraphLayout::fChars [private]
 

Definition at line 580 of file ParagraphLayout.h.

le_bool ParagraphLayout::fClientLevels [private]
 

Definition at line 589 of file ParagraphLayout.h.

le_bool ParagraphLayout::fClientLocales [private]
 

Definition at line 591 of file ParagraphLayout.h.

le_bool ParagraphLayout::fClientScripts [private]
 

Definition at line 590 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fDescent [private]
 

Definition at line 596 of file ParagraphLayout.h.

UBiDiLevel* ParagraphLayout::fEmbeddingLevels [private]
 

Definition at line 593 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fFirstVisualRun [private]
 

Definition at line 617 of file ParagraphLayout.h.

const FontRuns* ParagraphLayout::fFontRuns [private]
 

Definition at line 583 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fGlyphCount [private]
 

Definition at line 603 of file ParagraphLayout.h.

le_int32* ParagraphLayout::fGlyphToCharMap [private]
 

Definition at line 599 of file ParagraphLayout.h.

float* ParagraphLayout::fGlyphWidths [private]
 

Definition at line 602 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fLastVisualRun [private]
 

Definition at line 618 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fLeading [private]
 

Definition at line 597 of file ParagraphLayout.h.

const ValueRuns* ParagraphLayout::fLevelRuns [private]
 

Definition at line 584 of file ParagraphLayout.h.

UBiDi* ParagraphLayout::fLineBidi [private]
 

Definition at line 606 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fLineEnd [private]
 

Definition at line 615 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fLineStart [private]
 

Definition at line 614 of file ParagraphLayout.h.

const LocaleRuns* ParagraphLayout::fLocaleRuns [private]
 

Definition at line 586 of file ParagraphLayout.h.

UBiDi* ParagraphLayout::fParaBidi [private]
 

Definition at line 605 of file ParagraphLayout.h.

const ValueRuns* ParagraphLayout::fScriptRuns [private]
 

Definition at line 585 of file ParagraphLayout.h.

le_int32* ParagraphLayout::fStyleIndices [private]
 

Definition at line 609 of file ParagraphLayout.h.

le_int32 ParagraphLayout::fStyleRunCount [private]
 

Definition at line 611 of file ParagraphLayout.h.

StyleRunInfo* ParagraphLayout::fStyleRunInfo [private]
 

Definition at line 610 of file ParagraphLayout.h.

le_int32* ParagraphLayout::fStyleRunLimits [private]
 

Definition at line 608 of file ParagraphLayout.h.

le_bool ParagraphLayout::fVertical [private]
 

Definition at line 588 of file ParagraphLayout.h.

float ParagraphLayout::fVisualRunLastX [private]
 

Definition at line 619 of file ParagraphLayout.h.

float ParagraphLayout::fVisualRunLastY [private]
 

Definition at line 620 of file ParagraphLayout.h.

const char ParagraphLayout::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 537 of file ParagraphLayout.h.


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