-
/*
- *
- * (C) Copyright IBM Corp. 1998-2006 - All Rights Reserved
- *
+ * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*/
#ifndef __LAYOUTENGINE_H
* @stable ICU 2.8
*/
class U_LAYOUT_API LayoutEngine : public UObject {
+public:
+#ifndef U_HIDE_INTERNAL_API
+ /** @internal Flag to request kerning. */
+ static const le_int32 kTypoFlagKern;
+ /** @internal Flag to request ligatures. */
+ static const le_int32 kTypoFlagLiga;
+#endif /* U_HIDE_INTERNAL_API */
+
protected:
/**
* The object which holds the glyph storage
*/
le_int32 fTypoFlags;
+ /**
+ * <code>TRUE</code> if <code>mapCharsToGlyphs</code> should replace ZWJ / ZWNJ with a glyph
+ * with no contours.
+ *
+ * @internal
+ */
+ le_bool fFilterZeroWidth;
+
+#ifndef U_HIDE_INTERNAL_API
/**
* This constructs an instance for a given font, script and language. Subclass constructors
* must call this constructor.
* @param fontInstance - the font for the text
* @param scriptCode - the script for the text
* @param languageCode - the language for the text
- * @param typoFlags - the typographic control flags for the text. Set bit 1 if kerning
- * is desired, set bit 2 if ligature formation is desired. Others are reserved.
+ * @param typoFlags - the typographic control flags for the text (a bitfield). Use kTypoFlagKern
+ * if kerning is desired, kTypoFlagLiga if ligature formation is desired. Others are reserved.
+ * @param success - set to an error code if the operation fails
*
* @see LEFontInstance
* @see ScriptAndLanguageTags.h
*
* @internal
*/
- LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
-
+ LayoutEngine(const LEFontInstance *fontInstance,
+ le_int32 scriptCode,
+ le_int32 languageCode,
+ le_int32 typoFlags,
+ LEErrorCode &success);
+#endif /* U_HIDE_INTERNAL_API */
+
+ // Do not enclose the protected default constructor with #ifndef U_HIDE_INTERNAL_API
+ // or else the compiler will create a public default constructor.
/**
* This overrides the default no argument constructor to make it
* difficult for clients to call it. Clients are expected to call
* @param count - the number of characters to be mapped
* @param reverse - if <code>TRUE</code>, the output will be in reverse order
* @param mirror - if <code>TRUE</code>, do character mirroring
- * @param filterZeroWidth - if <code>TRUE</code> replace ZWJ / ZWNJ with a glyph with no contours.
* @param glyphStorage - the object which holds the per-glyph storage. The glyph and char
* indices arrays will be filled in.
* @param success - set to an error code if the operation fails
*
* @internal
*/
- virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, le_bool filterZeroWidth, LEGlyphStorage &glyphStorage, LEErrorCode &success);
+ virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
+#ifndef U_HIDE_INTERNAL_API
/**
* This is a convenience method that forces the advance width of mark
* glyphs to be zero, which is required for proper selection and highlighting.
* @internal
*/
static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
-
+#endif /* U_HIDE_INTERNAL_API */
public:
/**
/**
* Override of existing call that provides flags to control typography.
- * @draft ICU 3.4
+ * @stable ICU 3.4
*/
static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
U_NAMESPACE_END
#endif
-