X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Fpublic-api%2Ftext%2Flogical-model.h;h=d8f6617ada6df65d7dfa4ba8fb4da4474f3fa3be;hp=f62e6b268b4f22a353d19a12a0181799cd67ee51;hb=e6119e0806fc7460e95d5569ff53fd1577214ae5;hpb=c803046c24398c2037a83d105a932976dede943f;ds=sidebyside diff --git a/base/dali-toolkit/public-api/text/logical-model.h b/base/dali-toolkit/public-api/text/logical-model.h index f62e6b2..d8f6617 100644 --- a/base/dali-toolkit/public-api/text/logical-model.h +++ b/base/dali-toolkit/public-api/text/logical-model.h @@ -33,8 +33,10 @@ namespace Toolkit namespace Text { +struct FontRun; class LogicalModel; typedef IntrusivePtr LogicalModelPtr; +struct ScriptRun; /** * @brief A logical text model contains layout independent information. @@ -83,6 +85,106 @@ public: Character* text, Length numberOfCharacters ) const; + // Language support interface. + + /** + * Sets the script runs. + * + * Replaces any scripts previously set. + * + * A run is a group of consecutive characters. A script run contains the script for a run. + * + * @param[in] scripts Pointer to a buffer with all the script runs. + * @param[in] numberOfRuns The number of script runs. + */ + void SetScripts( const ScriptRun* const scripts, + Length numberOfRuns ); + + /** + * Retrieves the number of script runs for the given range of characters. + * + * A run is a group of consecutive characters. A script run contains the script for a run. + * + * @param[in] characterIndex Index to the first character. + * @param[in] numberOfCharacters The number of characters. + * + * @return The number of script runs. + */ + Length GetNumberOfScriptRuns( CharacterIndex characterIndex, + Length numberOfCharacters ) const; + + /** + * Retrieves the script runs for the given range of characters. + * + * The @p scriptRuns buffer needs to be big enough to copy the number of script runs. + * Call GetNumberOfScriptRuns() to retrieve the number of script runs. + * + * @param[out] scriptRuns Pointer to a buffer where the script runs are copied. + * @param[in] characterIndex Index to the first character. + * @param[in] numberOfCharacters The number of characters. + */ + void GetScriptRuns( ScriptRun* scriptRuns, + CharacterIndex characterIndex, + Length numberOfCharacters ) const; + + /** + * Retrieves the script for the given character index. + * + * @param[in] characterIndex Index to the character. + * + * @return The character's script. + */ + Script GetScript( CharacterIndex characterIndex ) const; + + /** + * Sets the font runs. + * + * Replaces any fonts previously set. + * + * A run is a group of consecutive characters. A font run contains the font id for a run. + * + * @param[in] fonts Pointer to a buffer with all the font runs. + * @param[in] numberOfRuns The number of font runs. + */ + void SetFonts( const FontRun* const fonts, + Length numberOfRuns ); + + /** + * Retrieves the number of font runs for the given range of characters. + * + * A run is a group of consecutive characters. A font run contains the font id for a run. + * + * @param[in] characterIndex Index to the first character. + * @param[in] numberOfCharacters The number of characters. + * + * @return The number of font runs. + */ + Length GetNumberOfFontRuns( CharacterIndex characterIndex, + Length numberOfCharacters ) const; + + /** + * Retrieves the font runs for the given range of characters. + * + * The @p fontRuns buffer needs to be big enough to copy the number of font runs. + * Call GetNumberOfFontRuns() to retrieve the number of font runs. + * + * @param[out] fontRuns Pointer to a buffer where the font runs are copied. + * @param[in] characterIndex Index to the first character. + * @param[in] numberOfCharacters The number of characters. + */ + void GetFontRuns( FontRun* fontRuns, + CharacterIndex characterIndex, + Length numberOfCharacters ) const; + + /** + * Retrieves the font id for the given character index. + * + * @param[in] characterIndex Index to the first character. + * + * @return The font id. + */ + FontId GetFont( CharacterIndex characterIndex ) const; + protected: /**