ICU 4.8.1.1  4.8.1.1
LayoutEngine.h
Go to the documentation of this file.
00001 /*
00002  * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
00003  */
00004 
00005 #ifndef __LAYOUTENGINE_H
00006 #define __LAYOUTENGINE_H
00007 
00008 #include "LETypes.h"
00009 
00015 U_NAMESPACE_BEGIN
00016 
00017 class LEFontInstance;
00018 class LEGlyphFilter;
00019 class LEGlyphStorage;
00020 
00064 class U_LAYOUT_API LayoutEngine : public UObject {
00065 public:
00067     static const le_int32 kTypoFlagKern;
00069     static const le_int32 kTypoFlagLiga;
00070 
00071 protected:
00077     LEGlyphStorage *fGlyphStorage;
00078 
00086     const LEFontInstance *fFontInstance;
00087 
00095     le_int32 fScriptCode;
00096 
00104     le_int32 fLanguageCode;
00105 
00111     le_int32 fTypoFlags;
00112 
00119     le_bool fFilterZeroWidth;
00120 
00137     LayoutEngine(const LEFontInstance *fontInstance,
00138                  le_int32 scriptCode,
00139                  le_int32 languageCode,
00140                  le_int32 typoFlags,
00141                  LEErrorCode &success);
00142 
00150     LayoutEngine();
00151 
00174     virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00175             LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00176 
00203     virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00204 
00218     virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00219 
00240     virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00241 
00254     virtual const void *getFontTable(LETag tableTag) const;
00255 
00281     virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00282 
00295     static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00296 
00297 
00316     static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00317 
00318 
00319 public:
00328     virtual ~LayoutEngine();
00329 
00355     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);
00356 
00366     le_int32 getGlyphCount() const;
00367 
00378     void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00379 
00392     virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00393 
00404     void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00405 
00417     void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00418 
00430     void getGlyphPositions(float positions[], LEErrorCode &success) const;
00431 
00446     void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00447 
00455     virtual void reset();
00456 
00473     static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00474 
00479     static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00480 
00486     virtual UClassID getDynamicClassID() const;
00487 
00493     static UClassID getStaticClassID();
00494 
00495 };
00496 
00497 U_NAMESPACE_END
00498 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines