]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/layout/ThaiLayoutEngine.h
ICU-551.24.tar.gz
[apple/icu.git] / icuSources / layout / ThaiLayoutEngine.h
index 818f01b32bf0aa1107230e7774cf86af8b05f216..4b6d2eff6f62b913bd500756b2e00f482b2bfa24 100644 (file)
@@ -1,8 +1,7 @@
 
 /*
- * @(#)ThaiLayoutEngine.h      1.3 00/03/15
  *
- * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
  *
  */
 
@@ -17,6 +16,8 @@
 
 U_NAMESPACE_BEGIN
 
+class LEGlyphStorage;
+
 /**
  * This class implements layout for the Thai script, using the ThaiShapingClass.
  * All existing Thai fonts use an encoding which assigns character codes to all
@@ -36,13 +37,14 @@ public:
      * @param fontInstance - the font
      * @param scriptCode - the script
      * @param languageCode - the language
+     * @param success - set to an error code if the operation fails
      *
      * @see LEFontInstance
      * @see ScriptAndLanguageTags.h for script and language codes
      *
      * @internal
      */
-    ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode);
+    ThaiLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags, LEErrorCode &success);
 
     /**
      * The destructor, virtual for correct polymorphic invocation.
@@ -54,16 +56,16 @@ public:
     /**
      * ICU "poor man's RTTI", returns a UClassID for the actual class.
      *
-     * @draft ICU 2.2
+     * @deprecated ICU 54. See {@link icu::LayoutEngine}
      */
-    virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
+    virtual UClassID getDynamicClassID() const;
 
     /**
      * ICU "poor man's RTTI", returns a UClassID for this class.
      *
-     * @draft ICU 2.2
+     * @deprecated ICU 54. See {@link icu::LayoutEngine}
      */
-    static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
+    static UClassID getStaticClassID();
 
 protected:
     /**
@@ -98,11 +100,10 @@ protected:
      * @param offset - the index of the first character to process
      * @param count - the number of characters to process
      * @param max - the number of characters in the input context
-     * @param rightToLeft - true if the text is in a right to left directional run
+     * @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run
+     * @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.
      *
      * Output parameters:
-     * @param glyphs - the glyph index array
-     * @param charIndices - the character index array
      * @param success - set to an error code if the operation fails
      *
      * @return the number of glyphs in the glyph index array
@@ -112,15 +113,30 @@ protected:
      * @internal
      */
     virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
-        LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success);
-
-private:
+        LEGlyphStorage &glyphStorage, LEErrorCode &success);
 
     /**
-     * The address of this static class variable serves as this class's ID
-     * for ICU "poor man's RTTI".
+     * This method does positioning adjustments like accent positioning and
+     * kerning. The default implementation does nothing. Subclasses needing
+     * position adjustments must override this method.
+     *
+     * Note that this method has both characters and glyphs as input so that
+     * it can use the character codes to determine glyph types if that information
+     * isn't directly available. (e.g. Some Arabic OpenType fonts don't have a GDEF
+     * table)
+     *
+     * @param chars - the input character context
+     * @param offset - the offset of the first character to process
+     * @param count - the number of characters to process
+     * @param reverse - <code>TRUE</code> if the glyphs in the glyph array have been reordered
+     * @param glyphStorage - the object which holds the per-glyph storage. The glyph positions will be
+     *                       adjusted as needed.
+     * @param success - output parameter set to an error code if the operation fails
+     *
+     * @internal
      */
-    static const char fgClassID;
+    virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
+
 };
 
 U_NAMESPACE_END