X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fcursor-helper-functions.h;h=ad17b3179f1e8fe33014bf83789ce80c3135c297;hp=f62165b1dd8add779d223b92f29b9212cbfdbe6a;hb=21f60153d688233c47b7e86dfe1d6e06450ed3a0;hpb=632c0f0659030bea7e4854c815c88a1eeabcf843 diff --git a/dali-toolkit/internal/text/cursor-helper-functions.h b/dali-toolkit/internal/text/cursor-helper-functions.h index f62165b..ad17b31 100644 --- a/dali-toolkit/internal/text/cursor-helper-functions.h +++ b/dali-toolkit/internal/text/cursor-helper-functions.h @@ -50,6 +50,7 @@ struct CursorInfo : primaryPosition(), secondaryPosition(), lineOffset( 0.f ), + glyphOffset( 0.f ), lineHeight( 0.f ), primaryCursorHeight( 0.f ), secondaryCursorHeight( 0.f ), @@ -62,6 +63,7 @@ struct CursorInfo Vector2 primaryPosition; ///< The primary cursor's position (in text's coords). Vector2 secondaryPosition; ///< The secondary cursor's position (in text's coords). float lineOffset; ///< The vertical offset where the line containing the cursor starts. + float glyphOffset; ///< The difference of line ascender and glyph ascender. float lineHeight; ///< The height of the line where the cursor is placed. float primaryCursorHeight; ///< The primary cursor's height. float secondaryCursorHeight; ///< The secondary cursor's height. @@ -69,6 +71,18 @@ struct CursorInfo }; /** + * @brief Parameters passed to the GetCursorPosition() function. + */ +struct GetCursorPositionParameters +{ + VisualModelPtr visualModel; ///< The visual model. + LogicalModelPtr logicalModel; ///< The logical model. + MetricsPtr metrics; ///< A wrapper around FontClient used to get metrics. + CharacterIndex logical; ///< The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character. + bool isMultiline; ///< Whether the text control is multi-line. +}; + +/** * @brief Retrieves the closest line for a given touch point. * * It returns the first line if the touch point is above the text and the last line if the touch point is below. @@ -128,16 +142,10 @@ CharacterIndex GetClosestCursorIndex( VisualModelPtr visualModel, * It retrieves as well the line's height and the cursor's height and * if there is a valid alternative cursor, its position and height. * - * @param[in] visualModel The visual model. - * @param[in] logicalModel The logical model. - * @param[in] metrics A wrapper around FontClient used to get metrics. - * @param[in] logical The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character. + * @param[in] parameters Parameters used to calculate the cursor's position. * @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor. */ -void GetCursorPosition( VisualModelPtr visualModel, - LogicalModelPtr logicalModel, - MetricsPtr metrics, - CharacterIndex logical, +void GetCursorPosition( GetCursorPositionParameters& parameters, CursorInfo& cursorInfo ); /**