X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fbidirectional-support.h;h=f659a9c50f8305eaad26940277d2e3f3f3e53a52;hp=4bdd5e32bd0839d2b11275f8cb4f53cd2da222d6;hb=5b3cf0e6742934674bdf62bbe15af00e39eae566;hpb=fc2392c09ab526295f52c430ead7879e1e91a096;ds=sidebyside diff --git a/dali-toolkit/internal/text/bidirectional-support.h b/dali-toolkit/internal/text/bidirectional-support.h index 4bdd5e3..f659a9c 100644 --- a/dali-toolkit/internal/text/bidirectional-support.h +++ b/dali-toolkit/internal/text/bidirectional-support.h @@ -36,9 +36,6 @@ namespace Toolkit namespace Text { -class LogicalModel; -class VisualModel; - /** * Sets the bidirectional info into the logical model. * @@ -53,62 +50,47 @@ void SetBidirectionalInfo( const Vector& text, Vector& bidirectionalInfo ); /** - * Replaces the bidirectional info from the logical model. - * - * @pre The @p model needs to have a text set. - * @pre The @p model needs to have the line break info set. - * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. - * - * @param[in,out] model The text's logical model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. - */ -void ReplaceBidirectionalInfo( LogicalModel& model, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); - -/** - * Sets the visual to logical and logical to visual map tables. + * Sets the visual to logical map tables. * * Any map tables previously set are removed. + * It sets the paragraph's direction to each line. * * @pre The @p logicalModel needs to have a text set. * @pre The @p logicalModel needs to have the bidirectional info indices for each paragraph set. * @pre The @p visualModel needs to have the laid-out lines info set. * * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph. - * @param[in] lineRuns The line runs converted to characters. - * @param[out] lineInfoRuns line runs with the visual to logical and logical to visual conversion maps. + * @param[in,out] lineRuns The line runs converted to characters. + * @param[out] lineInfoRuns line runs with the visual to logical conversion maps. */ void ReorderLines( const Vector& bidirectionalInfo, - const Vector& lineRuns, + Vector& lineRuns, Vector& lineInfoRuns ); /** - * Replaces the visual to logical and logical to visual map tables. + * @brief Replaces any character in the right to left paragraphs which could be mirrored. * - * @pre The @p logicalModel needs to have a text set. - * @pre The @p logicalModel needs to have the line break info set. - * @pre The @p visualModel needs to have the laid-out lines info set. + * @param[in] text The text. + * @param[in] mirroredText The mirroredText. + * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph. + * + * @return @e true if a character has been replaced. + */ +bool GetMirroredText( const Vector& text, + Vector& mirroredText, + const Vector& bidirectionalInfo ); + +/** + * @brief Retrieves the character's directions. * - * If the @p numberOfCharactersToRemove is zero, this operation is like an insert. - * If the @p numberOfCharactersToInsert is zero, this operation is like a remove. + * @pre The @p logicalModel needs to have a text set. + * @pre The @p logicalModel needs to have the bidirectional info indices for each paragraph set. * - * @param[in,out] logicalModel The text's logical model. - * @param[in] visualModel The text's visual model. - * @param[in] characterIndex Index to the first character. - * @param[in] numberOfCharactersToRemove The number of characters removed from the text. - * @param[in] numberOfCharactersToInsert The number of characters inserted in the text. + * @param[in] bidirectionalInfo Vector with the bidirectional infor for each paragraph. + * @param[out] directions The direction, @e false is left to right and @e true is right to left, of each character of the paragraph. */ -void ReorderLines( LogicalModel& logicalModel, - const VisualModel& visualModel, - CharacterIndex characterIndex, - Length numberOfCharactersToRemove, - Length numberOfCharactersToInsert ); +void GetCharactersDirection( const Vector& bidirectionalInfo, + Vector& directions ); } // namespace Text