X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=bf92f6ae0d218325c690954595c09ac08ccd07b6;hb=7cd51e51add5d6682ef7535b9bce454043b2dad3;hp=9de7dba44e913ccd7f665d5b802df9af4331e44d;hpb=f040ee74bc71aad84339b672e5aec6247fdf189e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 9de7dba..bf92f6a 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -747,6 +747,26 @@ const Vector4& Controller::GetDefaultColor() const return mImpl->mTextColor; } +void Controller::SetDisabledColorOpacity(float opacity) +{ + mImpl->mDisabledColorOpacity = opacity; +} + +float Controller::GetDisabledColorOpacity() const +{ + return mImpl->mDisabledColorOpacity; +} + +void Controller::SetUserInteractionEnabled(bool enabled) +{ + mImpl->SetUserInteractionEnabled(enabled); +} + +bool Controller::IsUserInteractionEnabled() const +{ + return mImpl->mIsUserInteractionEnabled; +} + void Controller::SetPlaceholderTextColor(const Vector4& textColor) { PlaceholderHandler::SetPlaceholderTextColor(*this, textColor); @@ -1391,6 +1411,34 @@ Vector Controller::GetTextPosition(CharacterIndex startIndex, Character return positionsList; } +Rect<> Controller::GetTextBoundingRectangle(CharacterIndex startIndex, CharacterIndex endIndex) +{ + Vector sizeList; + Vector positionList; + + GetTextGeometry(mImpl->mModel, startIndex, endIndex, sizeList, positionList); + + if(sizeList.Empty() || sizeList.Size() != positionList.Size()) + { + return {0, 0, 0, 0}; + } + + auto minX = positionList[0].x; + auto minY = positionList[0].y; + auto maxRight = positionList[0].x + sizeList[0].x; + auto maxBottom = positionList[0].y + sizeList[0].y; + + for(unsigned int i = 1; i < sizeList.Size(); i++) + { + minX = std::min(minX, positionList[i].x); + minY = std::min(minY, positionList[i].y); + maxRight = std::max(maxRight, positionList[i].x + sizeList[i].x); + maxBottom = std::max(maxBottom, positionList[i].y + sizeList[i].y); + } + + return {minX, minY, maxRight - minX, maxBottom - minY}; +} + bool Controller::IsInputStyleChangedSignalsQueueEmpty() { return mImpl->IsInputStyleChangedSignalsQueueEmpty();