X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flogical-model-impl.h;h=e41f0faa85702dd161f47cb87554a0011db9c0b0;hp=43ef817cc3a5fdcf5af4236ef235fe29a7de62ea;hb=0b2e209ecfb3cedba510f53a4af58d7d8a2b3876;hpb=5b3cf0e6742934674bdf62bbe15af00e39eae566 diff --git a/dali-toolkit/internal/text/logical-model-impl.h b/dali-toolkit/internal/text/logical-model-impl.h index 43ef817..e41f0fa 100644 --- a/dali-toolkit/internal/text/logical-model-impl.h +++ b/dali-toolkit/internal/text/logical-model-impl.h @@ -26,7 +26,10 @@ // INTERNAL INCLUDES #include #include +#include #include +#include +#include #include namespace Dali @@ -40,6 +43,7 @@ namespace Text class LogicalModel; typedef IntrusivePtr LogicalModelPtr; +struct InputStyle; /** * @brief A logical text model contains layout independent information. @@ -93,9 +97,13 @@ public: * * @param[in] bidirectionalInfo Pointer to a buffer with all the bidirectional info runs. * @param[in] numberOfRuns The number of bidirectional info runs. + * @param[in] startIndex Character index from where the conversion tables are set. + * @param[in] numberOfCharacters The number of characters. */ void SetVisualToLogicalMap( const BidirectionalLineInfoRun* const bidirectionalInfo, - Length numberOfRuns ); + Length numberOfRuns, + CharacterIndex startIndex, + Length numberOfCharacters ); /** * @brief Retrieves the logical character index for the given visual character index. @@ -106,6 +114,53 @@ public: */ CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ) const; + // Text style. + + /** + * @brief Updates the text's style runs with the added or removed text. + * + * @param[in] index The character's index. + * @param[in] numberOfCharacters The number of characters added or removed. If the value is negative the characters are removed. + */ + void UpdateTextStyleRuns( CharacterIndex index, int numberOfCharacters ); + + /** + * @brief Retrieves the text's style for the given character index. + * + * @param[in] index The character index. + * @param[out] style The text's style in the given style. + */ + void RetrieveStyle( CharacterIndex index, InputStyle& style ); + + /** + * @brief Clears the font description runs. + */ + void ClearFontDescriptionRuns(); + + // Paragraphs + + /** + * @brief Creates the paragraph info. + * + * @pre The line break info must be set. + * + * @param[in] startIndex The character from where the paragraph info is set. + * @param[in] numberOfCharacters The number of characters. + */ + void CreateParagraphInfo( CharacterIndex startIndex, + Length numberOfCharacters ); + + /** + * @brief Find the paragraphs which contains the given characters. + * + * @param[in] index The first character's index of the run. + * @param[in] numberOfCharacters The number of characters of the run. + * @param[out] paragraphs Indices to the paragraphs which contain the characters. + */ + void FindParagraphs( CharacterIndex index, + Length numberOfCharacters, + Vector& paragraphs ); + protected: /** @@ -131,8 +186,11 @@ public: Vector mText; Vector mScriptRuns; Vector mFontRuns; + Vector mColorRuns; + Vector mFontDescriptionRuns; Vector mLineBreakInfo; Vector mWordBreakInfo; + Vector mParagraphInfo; Vector mBidirectionalParagraphInfo; Vector mCharacterDirections; ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ). Vector mBidirectionalLineInfo;