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=9b46fe200a8be322272e1d55c9b9fb508450eabf;hp=48036adaaa1a60cd45e0aab78b9432f553c794a1;hb=517dab63fca9d69d49a68c8763fe477f53cc6d5f;hpb=7b49f95b6d22be04ef9a3320eaaae7dc3e63ec46 diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 48036ad..9b46fe2 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -143,10 +143,12 @@ ControllerPtr Controller::New( ControlInterface* controlInterface ) } ControllerPtr Controller::New( ControlInterface* controlInterface, - EditableControlInterface* editableControlInterface ) + EditableControlInterface* editableControlInterface, + SelectableControlInterface* selectableControlInterface ) { return ControllerPtr( new Controller( controlInterface, - editableControlInterface ) ); + editableControlInterface, + selectableControlInterface ) ); } // public : Configure the text controller. @@ -3193,6 +3195,24 @@ void Controller::SelectEvent( float x, float y, SelectionType selectType ) } } +void Controller::SetTextSelectionRange(const uint32_t *start, const uint32_t *end) +{ + if( mImpl->mEventData ) + { + mImpl->mEventData->mCheckScrollAmount = true; + mImpl->mEventData->mIsLeftHandleSelected = true; + mImpl->mEventData->mIsRightHandleSelected = true; + mImpl->SetTextSelectionRange(start, end); + mImpl->RequestRelayout(); + KeyboardFocusGainEvent(); + } +} + +Uint32Pair Controller::GetTextSelectionRange() const +{ + return mImpl->GetTextSelectionRange(); +} + InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent ) { // Whether the text needs to be relaid-out. @@ -4448,19 +4468,21 @@ Actor Controller::CreateBackgroundActor() Controller::Controller() : mImpl( NULL ) { - mImpl = new Controller::Impl( NULL, NULL ); + mImpl = new Controller::Impl( nullptr, nullptr, nullptr ); } Controller::Controller( ControlInterface* controlInterface ) { - mImpl = new Controller::Impl( controlInterface, NULL ); + mImpl = new Controller::Impl( controlInterface, NULL, NULL ); } Controller::Controller( ControlInterface* controlInterface, - EditableControlInterface* editableControlInterface ) + EditableControlInterface* editableControlInterface, + SelectableControlInterface* selectableControlInterface ) { mImpl = new Controller::Impl( controlInterface, - editableControlInterface ); + editableControlInterface, + selectableControlInterface ); } // The copy constructor and operator are left unimplemented.