X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-field-impl.cpp;h=fc60b8224336cf31829ec5e3647c111ab76fd20b;hb=41af99ec8142c7cb02f0f80e26d13b77aadb8b37;hp=e9d1fe4d1f56a5624f338b6b11e8a23bdf18d1ea;hpb=9f57b6ad2040e964ed4eec3dc92e854ac2e03907;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index e9d1fe4..fc60b82 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include #include @@ -135,6 +137,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandle", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandlePopup", BOOLEAN, ENABLE_GRAB_HANDLE_POPUP ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "textBackground", VECTOR4, BACKGROUND ) +DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextField, "selectedText", STRING, SELECTED_TEXT ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED ) @@ -1212,6 +1215,14 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } break; } + case Toolkit::DevelTextField::Property::SELECTED_TEXT: + { + if( impl.mController ) + { + value = impl.mController->GetSelectedText( ); + } + break; + } } //switch } @@ -1222,7 +1233,16 @@ void TextField::SelectWholeText() { if( mController && mController->IsShowingRealText() ) { - mController->SelectEvent( 0.f, 0.f, true ); + mController->SelectEvent( 0.f, 0.f, SelectionType::ALL ); + SetKeyInputFocus(); + } +} + +void TextField::SelectNone() +{ + if( mController && mController->IsShowingRealText() ) + { + mController->SelectEvent( 0.f, 0.f, SelectionType::NONE ); SetKeyInputFocus(); } } @@ -1567,7 +1587,7 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType ) void TextField::OnKeyInputFocusGained() { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() ); - if ( mInputMethodContext ) + if( mInputMethodContext ) { mInputMethodContext.ApplyOptions( mInputMethodOptions ); @@ -1581,13 +1601,30 @@ void TextField::OnKeyInputFocusGained() // When window gain lost focus, the inputMethodContext is deactivated. Thus when window gain focus again, the inputMethodContext must be activated. mInputMethodContext.SetRestoreAfterFocusLost( true ); } - ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); - if ( notifier ) + ClipboardEventNotifier notifier( ClipboardEventNotifier::Get() ); + if( notifier ) { notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected ); } + Toolkit::Control control = Toolkit::Control::DownCast( Self() ); + Internal::Control& controlImpl = GetImplementation( control ); + Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl ); + bool enableAutofill = controlDataImpl.IsAutofillEnabled(); + if( enableAutofill ) + { + Toolkit::AutofillContainer container = controlDataImpl.GetAutofillContainer(); + container.SetFocusedControl( control ); + + Internal::AutofillContainer& containerImpl = GetImpl( container ); + Dali::AutofillGroup containerGroup = containerImpl.GetAutofillGroup(); + if( containerGroup != nullptr ) + { + containerGroup.RequestAuthentication(); + } + + } mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.