X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fvisual-model-impl.cpp;h=9c57494235b332dd5aec1ea107eb7215de82ea69;hb=478e477e07fde916953748d2cd4befc0326bfc34;hp=eda56336d3473463a2b6d5f840cba1648cd8b9d9;hpb=c052b6678e2c6d8a65545dbbe4531ea7057c1999;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index eda5633..9c57494 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -204,6 +204,11 @@ void VisualModel::GetGlyphPositions(Vector2* glyphPositions, memcpy(glyphPositions, mGlyphPositions.Begin() + glyphIndex, numberOfGlyphs * sizeof(Vector2)); } +Length VisualModel::GetTotalNumberOfLines() const +{ + return mLines.Size(); +} + void VisualModel::GetNumberOfLines(GlyphIndex glyphIndex, Length numberOfGlyphs, LineIndex& firstLine, @@ -230,6 +235,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. @@ -384,6 +395,41 @@ void VisualModel::SetBackgroundEnabled(bool enabled) mBackgroundEnabled = enabled; } +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; @@ -439,6 +485,41 @@ bool VisualModel::IsBackgroundEnabled() const return mBackgroundEnabled; } +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(); @@ -474,9 +555,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) + mBackgroundEnabled(false), + mMarkupProcessorEnabled(false) + { }