ICU 4.4.2 4.4.2
|
00001 00002 /* 00003 * 00004 * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved 00005 * 00006 */ 00007 00008 #ifndef __LAYOUTENGINE_H 00009 #define __LAYOUTENGINE_H 00010 00011 #include "LETypes.h" 00012 00018 U_NAMESPACE_BEGIN 00019 00020 class LEFontInstance; 00021 class LEGlyphFilter; 00022 class LEGlyphStorage; 00023 00067 class U_LAYOUT_API LayoutEngine : public UObject { 00068 protected: 00074 LEGlyphStorage *fGlyphStorage; 00075 00083 const LEFontInstance *fFontInstance; 00084 00092 le_int32 fScriptCode; 00093 00101 le_int32 fLanguageCode; 00102 00108 le_int32 fTypoFlags; 00109 00116 le_bool fFilterZeroWidth; 00117 00134 LayoutEngine(const LEFontInstance *fontInstance, 00135 le_int32 scriptCode, 00136 le_int32 languageCode, 00137 le_int32 typoFlags, 00138 LEErrorCode &success); 00139 00147 LayoutEngine(); 00148 00171 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, 00172 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); 00173 00200 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); 00201 00215 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success); 00216 00237 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success); 00238 00251 virtual const void *getFontTable(LETag tableTag) const; 00252 00278 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success); 00279 00292 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); 00293 00294 00313 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success); 00314 00315 00316 public: 00325 virtual ~LayoutEngine(); 00326 00352 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); 00353 00363 le_int32 getGlyphCount() const; 00364 00375 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const; 00376 00389 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const; 00390 00401 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const; 00402 00414 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const; 00415 00427 void getGlyphPositions(float positions[], LEErrorCode &success) const; 00428 00443 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const; 00444 00452 virtual void reset(); 00453 00470 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success); 00471 00476 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success); 00477 00483 virtual UClassID getDynamicClassID() const; 00484 00490 static UClassID getStaticClassID(); 00491 00492 }; 00493 00494 U_NAMESPACE_END 00495 #endif 00496