X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fvisual-model-impl.cpp;h=5fa384335036580b94e7e9feb557cb550e34ce31;hp=7edb42826023062a02632e6091e06ebaa395eaf6;hb=7c13cc0c065ae22e7ad0deaea4f56730ff050c5c;hpb=9161d9828d1a5bb3c7eaf83002863de84b23b751 diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index 7edb428..5fa3843 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -230,6 +230,12 @@ void VisualModel::GetNumberOfLines(GlyphIndex glyphIndex, firstLineFound = true; ++numberOfLines; } + else if((line.glyphRunSecondHalf.glyphIndex + line.glyphRunSecondHalf.numberOfGlyphs > glyphIndex) && + (lastGlyphIndex > line.glyphRunSecondHalf.glyphIndex)) + { + firstLineFound = true; + ++numberOfLines; + } else if(lastGlyphIndex <= line.glyphRun.glyphIndex) { // nothing else to do. @@ -389,6 +395,36 @@ void VisualModel::SetMarkupProcessorEnabled(bool enabled) mMarkupProcessorEnabled = enabled; } +void VisualModel::SetTextElideEnabled(bool enabled) +{ + mTextElideEnabled = enabled; +} + +void VisualModel::SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type ellipsisPosition) +{ + mEllipsisPosition = ellipsisPosition; +} + +void VisualModel::SetStartIndexOfElidedGlyphs(GlyphIndex startIndexOfElidedGlyphs) +{ + mStartIndexOfElidedGlyphs = startIndexOfElidedGlyphs; +} + +void VisualModel::SetEndIndexOfElidedGlyphs(GlyphIndex endIndexOfElidedGlyphs) +{ + mEndIndexOfElidedGlyphs = endIndexOfElidedGlyphs; +} + +void VisualModel::SetFirstMiddleIndexOfElidedGlyphs(GlyphIndex firstMiddleIndexOfElidedGlyphs) +{ + mFirstMiddleIndexOfElidedGlyphs = firstMiddleIndexOfElidedGlyphs; +} + +void VisualModel::SetSecondMiddleIndexOfElidedGlyphs(GlyphIndex secondMiddleIndexOfElidedGlyphs) +{ + mSecondMiddleIndexOfElidedGlyphs = secondMiddleIndexOfElidedGlyphs; +} + const Vector4& VisualModel::GetTextColor() const { return mTextColor; @@ -449,6 +485,36 @@ bool VisualModel::IsMarkupProcessorEnabled() const return mMarkupProcessorEnabled; } +bool VisualModel::IsTextElideEnabled() const +{ + return mTextElideEnabled; +} + +Toolkit::DevelText::EllipsisPosition::Type VisualModel::GetEllipsisPosition() const +{ + return mEllipsisPosition; +} + +GlyphIndex VisualModel::GetStartIndexOfElidedGlyphs() const +{ + return mStartIndexOfElidedGlyphs; +} + +GlyphIndex VisualModel::GetEndIndexOfElidedGlyphs() const +{ + return mEndIndexOfElidedGlyphs; +} + +GlyphIndex VisualModel::GetFirstMiddleIndexOfElidedGlyphs() const +{ + return mFirstMiddleIndexOfElidedGlyphs; +} + +GlyphIndex VisualModel::GetSecondMiddleIndexOfElidedGlyphs() const +{ + return mSecondMiddleIndexOfElidedGlyphs; +} + Length VisualModel::GetNumberOfUnderlineRuns() const { return mUnderlineRuns.Count(); @@ -484,10 +550,17 @@ VisualModel::VisualModel() mNaturalSize(), mLayoutSize(), mCachedLineIndex(0u), + mEllipsisPosition(DevelText::EllipsisPosition::END), + mStartIndexOfElidedGlyphs(0u), + mEndIndexOfElidedGlyphs(0u), + mFirstMiddleIndexOfElidedGlyphs(0u), + mSecondMiddleIndexOfElidedGlyphs(0u), + mTextElideEnabled(false), mUnderlineEnabled(false), mUnderlineColorSet(false), mBackgroundEnabled(false), mMarkupProcessorEnabled(false) + { }