ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LayoutEngine.h
Go to the documentation of this file.
1 
2 /*
3  *
4  * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved
5  *
6  */
7 
8 #ifndef __LAYOUTENGINE_H
9 #define __LAYOUTENGINE_H
10 
11 #include "LETypes.h"
12 
19 
20 class LEFontInstance;
21 class LEGlyphFilter;
22 class LEGlyphStorage;
23 
68 protected:
75 
84 
93 
102 
109 
117 
134  LayoutEngine(const LEFontInstance *fontInstance,
135  le_int32 scriptCode,
136  le_int32 languageCode,
137  le_int32 typoFlags,
138  LEErrorCode &success);
139 
147  LayoutEngine();
148 
171  virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
172  LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
173 
200  virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
201 
215  virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
216 
237  virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
238 
251  virtual const void *getFontTable(LETag tableTag) const;
252 
278  virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
279 
292  static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
293 
294 
313  static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
314 
315 
316 public:
325  virtual ~LayoutEngine();
326 
352  virtual le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success);
353 
363  le_int32 getGlyphCount() const;
364 
375  void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
376 
389  virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
390 
401  void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
402 
414  void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
415 
427  void getGlyphPositions(float positions[], LEErrorCode &success) const;
428 
443  void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
444 
452  virtual void reset();
453 
470  static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
471 
476  static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
477 
483  virtual UClassID getDynamicClassID() const;
484 
490  static UClassID getStaticClassID();
491 
492 };
493 
495 #endif
496 
uint32_t le_uint32
A type used for unsigned, 32-bit integers.
Definition: LETypes.h:41
le_uint32 LETag
Used for four character tags.
Definition: LETypes.h:93
le_int32 fScriptCode
The script code for the text.
Definition: LayoutEngine.h:92
le_int32 fLanguageCode
The langauge code for the text.
Definition: LayoutEngine.h:101
This class encapsulates the per-glyph storage used by the ICU LayoutEngine.
#define U_LAYOUT_API
Set to export library symbols from inside the layout engine library, and to import them from outside...
Definition: utypes.h:476
This is a virtual base class used to do complex text layout.
Definition: LayoutEngine.h:67
LEGlyphStorage * fGlyphStorage
The object which holds the glyph storage.
Definition: LayoutEngine.h:74
C API: Basic definitions for the ICU LayoutEngine.
int32_t le_int32
A type used for signed, 32-bit integers.
Definition: LETypes.h:34
UBool le_bool
A type used for boolean values.
Definition: LETypes.h:77
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:183
This is a virtual base class that serves as the interface between a LayoutEngine and the platform fon...
const LEFontInstance * fFontInstance
The font instance for the text font.
Definition: LayoutEngine.h:83
LEErrorCode
Error codes returned by the LayoutEngine.
Definition: LETypes.h:528
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
Definition: uversion.h:184
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:212
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
Definition: utypes.h:339
UChar LEUnicode
Used to represent 16-bit Unicode code points.
Definition: LETypes.h:237
le_uint32 LEGlyphID
Used for glyph indices.
Definition: LETypes.h:112
le_int32 fTypoFlags
The typographic control flags.
Definition: LayoutEngine.h:108
le_bool fFilterZeroWidth
TRUE if mapCharsToGlyphs should replace ZWJ / ZWNJ with a glyph with no contours. ...
Definition: LayoutEngine.h:116
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.