X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=cfac37f676421921790938a42ef725a245149154;hp=8aaefae5900c95dc1c5b58340b5cc6a50a742407;hb=dd0935960c1acaf63d2b4f560b39236b871135b7;hpb=1af4cb78028c7aae2f0df9efd0c52d6cd9bbabaa diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 8aaefae..cfac37f 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1462,6 +1462,22 @@ float Controller::GetDefaultLineSpacing() const return mImpl->mLayoutEngine.GetDefaultLineSpacing(); } +bool Controller::SetDefaultLineSize( float lineSize ) +{ + if( std::fabs( lineSize - mImpl->mLayoutEngine.GetDefaultLineSize() ) > Math::MACHINE_EPSILON_1000 ) + { + mImpl->mLayoutEngine.SetDefaultLineSize(lineSize); + mImpl->mRecalculateNaturalSize = true; + return true; + } + return false; +} + +float Controller::GetDefaultLineSize() const +{ + return mImpl->mLayoutEngine.GetDefaultLineSize(); +} + void Controller::SetInputColor( const Vector4& color ) { if( NULL != mImpl->mEventData ) @@ -3033,17 +3049,22 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y ) } } -void Controller::SelectEvent( float x, float y, bool selectAll ) +void Controller::SelectEvent( float x, float y, SelectionType selectType ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" ); if( NULL != mImpl->mEventData ) { - if( selectAll ) + if( selectType == SelectionType::ALL ) { Event event( Event::SELECT_ALL ); mImpl->mEventData->mEventQueue.push_back( event ); } + else if( selectType == SelectionType::NONE ) + { + Event event( Event::SELECT_NONE ); + mImpl->mEventData->mEventQueue.push_back( event ); + } else { Event event( Event::SELECT ); @@ -3326,14 +3347,14 @@ void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt if( mImpl->mEventData->mSelectionEnabled ) { // Creates a SELECT event. - SelectEvent( currentCursorPosition.x, currentCursorPosition.y, false ); + SelectEvent( currentCursorPosition.x, currentCursorPosition.y, SelectionType::INTERACTIVE ); } break; } case Toolkit::TextSelectionPopup::SELECT_ALL: { // Creates a SELECT_ALL event - SelectEvent( 0.f, 0.f, true ); + SelectEvent( 0.f, 0.f, SelectionType::ALL ); break; } case Toolkit::TextSelectionPopup::CLIPBOARD: @@ -3755,6 +3776,16 @@ bool Controller::RemoveSelectedText() return textRemoved; } +std::string Controller::GetSelectedText() +{ + std::string text; + if( EventData::SELECTING == mImpl->mEventData->mState ) + { + mImpl->RetrieveSelection( text, false ); + } + return text; +} + // private : Relayout. bool Controller::DoRelayout( const Size& size,