X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali-toolkit%2Finternal%2Ftext%2Fvisual-model-impl.h;h=359b695deb20c9ca441ed9eddc5b142a878afef9;hb=eb86a7e2a223a3876fa8be052872df527aad777f;hp=371b6669b69f575519e22780f21835a7abf305c1;hpb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/visual-model-impl.h b/dali-toolkit/internal/text/visual-model-impl.h index 371b666..359b695 100644 --- a/dali-toolkit/internal/text/visual-model-impl.h +++ b/dali-toolkit/internal/text/visual-model-impl.h @@ -29,12 +29,22 @@ #include #include +// DEVEL INCLUDES +#include + namespace Dali { namespace Toolkit { namespace Text { +struct HyphenInfo +{ + Vector glyph; + Vector position; + Vector index; +}; + class VisualModel; typedef IntrusivePtr VisualModelPtr; @@ -353,6 +363,103 @@ public: */ bool IsBackgroundEnabled() const; + /** + * @brief Sets whether the text has a markup-processor or not. + * + * @param[in] enabled true if the text has a markup-processor. + */ + void SetMarkupProcessorEnabled(bool enabled); + + /** + * @brief Returns whether the text has a markup-processor or not. + * + * @return whether the text has a markup-processor or not. + */ + bool IsMarkupProcessorEnabled() const; + + /** + * @brief Sets ellipsis position + * @param[in] ellipsisPosition The ellipsis position for the text + */ + void SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type ellipsisPosition); + + /** + * @brief Retrieves ellipsis position for text. + * + * @return The ellipsis position. + */ + Toolkit::DevelText::EllipsisPosition::Type GetEllipsisPosition() const; + + /** + * @brief Enable or disable the text elide. + * + * @param[in] enabled Whether to enable the text elide. + */ + void SetTextElideEnabled(bool enabled); + + /** + * @brief Whether the text elide property is enabled. + * + * @return @e true if the text elide property is enabled, @e false otherwise. + */ + bool IsTextElideEnabled() const; + + /** + * @brief Sets the start index of laid-out glyphs. + * + * @param[in] startIndexOfElidedGlyphs The start index of laid-out glyphs. + */ + void SetStartIndexOfElidedGlyphs(GlyphIndex startIndexOfElidedGlyphs); + + /** + * @brief Sets the end index of elided glyphs. + * + * @param[in] endIndexOfElidedGlyphs The end index of elided glyphs. + */ + void SetEndIndexOfElidedGlyphs(GlyphIndex endIndexOfElidedGlyphs); + + /** + * @brief Sets the first middle index of elided glyphs, index before ellipsis of middle. + * + * @param[in] firstMiddleIndexOfElidedGlyphs The first middle index of elided glyphs, index before ellipsis of middle. + */ + void SetFirstMiddleIndexOfElidedGlyphs(GlyphIndex firstMiddleIndexOfElidedGlyphs); + + /** + * @brief Sets the second middle index of elided glyphs, index of ellipsis of middle. + * + * @param[in] secondMiddleIndexOfElidedGlyphs The second middle index of elided glyphs, index of ellipsis of middle. + */ + void SetSecondMiddleIndexOfElidedGlyphs(GlyphIndex secondMiddleIndexOfElidedGlyphs); + + /** + * @brief Retrieves the start index of laid-out glyphs. + * + * @return The start index of laid-out glyphs. + */ + GlyphIndex GetStartIndexOfElidedGlyphs() const; + + /** + * @brief Retrieves the end index of laid-out glyphs. + * + * @return The end index of laid-out glyphs. + */ + GlyphIndex GetEndIndexOfElidedGlyphs() const; + + /** + * @brief Retrieves the first middle index of elided glyphs, index before ellipsis of middle. + * + * @return The first middle index of elided glyphs, index before ellipsis of middle. + */ + GlyphIndex GetFirstMiddleIndexOfElidedGlyphs() const; + + /** + * @brief Retrieves the second middle index of elided glyphs, index of ellipsis of middle. + * + * @return The second middle index of elided glyphs, index of ellipsis of middle. + */ + GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const; + protected: /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -403,10 +510,19 @@ private: // Caches to increase performance in some consecutive operations. LineIndex mCachedLineIndex; ///< Used to increase performance in consecutive calls to GetLineOfGlyph() or GetLineOfCharacter() with consecutive glyphs or characters. + DevelText::EllipsisPosition::Type mEllipsisPosition; ///< Where is the location the text elide + GlyphIndex mStartIndexOfElidedGlyphs; ///< The start index of elided glyphs. + GlyphIndex mEndIndexOfElidedGlyphs; ///< The end index of elided glyphs. + GlyphIndex mFirstMiddleIndexOfElidedGlyphs; ///< The first end index of elided glyphs, index before ellipsis of middle. + GlyphIndex mSecondMiddleIndexOfElidedGlyphs; ///< The first end index of elided glyphs, index of ellipsis of middle. + bool mTextElideEnabled : 1; ///< Whether the text's elide is enabled. + public: - bool mUnderlineEnabled : 1; ///< Underline enabled flag - bool mUnderlineColorSet : 1; ///< Has the underline color been explicitly set? - bool mBackgroundEnabled : 1; ///< Background enabled flag + bool mUnderlineEnabled : 1; ///< Underline enabled flag + bool mUnderlineColorSet : 1; ///< Has the underline color been explicitly set? + bool mBackgroundEnabled : 1; ///< Background enabled flag + bool mMarkupProcessorEnabled : 1; ///< Markup-processor enabled flag + HyphenInfo mHyphen; ///< Contains hyphen glyph info & the character index to draw hyphen after. }; } // namespace Text