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=3c01dc6f6f6a81c8ccbcd227feefa22f956c19be;hp=e41f0faa85702dd161f47cb87554a0011db9c0b0;hb=528aa3699cd51dab5115bca1aaebb65d4bc67c15;hpb=0b2e209ecfb3cedba510f53a4af58d7d8a2b3876 diff --git a/dali-toolkit/internal/text/logical-model-impl.h b/dali-toolkit/internal/text/logical-model-impl.h old mode 100644 new mode 100755 index e41f0fa..3c01dc6 --- a/dali-toolkit/internal/text/logical-model-impl.h +++ b/dali-toolkit/internal/text/logical-model-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H__ -#define __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H__ +#ifndef DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H +#define DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -89,30 +90,46 @@ public: // Visual <--> Logical conversion tables. /** - * @brief Sets the visual to logical and the logical to visual map tables. + * @brief Retrieves the logical cursor index for the given visual cursor index. * - * Replaces any map tables previously set. + * @pre The method FetchBidirectionalLineInfo() must be called before. If the result of FetchBidirectionalLineInfo() is false, + * then the character is not in a bidirectional line and the result will be invalid. * - * @note If the number of runs is zero the bidirectional info buffer is cleared. + * @param[in] visualCursorIndex The visual cursor index. * - * @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. + * @return The logical cursor index. */ - void SetVisualToLogicalMap( const BidirectionalLineInfoRun* const bidirectionalInfo, - Length numberOfRuns, - CharacterIndex startIndex, - Length numberOfCharacters ); + CharacterIndex GetLogicalCursorIndex( CharacterIndex visualCursorIndex ); /** * @brief Retrieves the logical character index for the given visual character index. * + * @pre The method FetchBidirectionalLineInfo() must be called before. If the result of FetchBidirectionalLineInfo() is false, + * then the character is not in a bidirectional line and the result will be invalid. + * * @param[in] visualCharacterIndex The visual character index. * * @return The logical character index. */ - CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ) const; + CharacterIndex GetLogicalCharacterIndex( CharacterIndex visualCharacterIndex ); + + /** + * @brief Fetch the bidirectional line info for the given character. + * + * Call GetBidirectionalLineInfo() to retrieve the last fetched line. + * + * @param[in] characterIndex The character index. + * + * @return @e true if the given @e character is in a bidirectional line. + */ + bool FetchBidirectionalLineInfo( CharacterIndex characterIndex ); + + /** + * @brief Retrieves the last fetched bidirectional line info. + * + * @return The index of the bidirectional line info. + */ + BidirectionalLineRunIndex GetBidirectionalLineInfo() const; // Text style. @@ -161,6 +178,13 @@ public: Length numberOfCharacters, Vector& paragraphs ); + // Embedded images + + /** + * @brief Clears the embedded images. + */ + void ClearEmbeddedImages(); + protected: /** @@ -187,16 +211,16 @@ public: Vector mScriptRuns; Vector mFontRuns; Vector mColorRuns; + Vector mBackgroundColorRuns; 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 mCharacterDirections; ///< For each character, whether is right to left. ( @e flase is left to right, @e true right to left ). Vector mBidirectionalLineInfo; - Vector mLogicalToVisualMap; ///< Bidirectional logical to visual conversion table. - Vector mVisualToLogicalMap; ///< Bidirectional visual to logical conversion table. - Vector mVisualToLogicalCursorMap; ///< Bidirectional visual to logical cursor conversion table. + Vector mEmbeddedItems; + + BidirectionalLineRunIndex mBidirectionalLineIndex; ///< The last fetched bidirectional line info. }; } // namespace Text @@ -205,4 +229,4 @@ public: } // namespace Dali -#endif // __DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H__ +#endif // DALI_TOOLKIT_TEXT_LOGICAL_MODEL_IMPL_H