X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-field-impl.cpp;h=d63fbc022f67ce660a872132ff0119b14e3610f7;hb=d6c840efea857e4e14115940a6f14821a23c81fd;hp=6a1f1c9d67c7af4005b519df5188ed727c6a6d2c;hpb=c1370bd1ce7d2982987115c7fe36eb87041c0a5a;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 6a1f1c9..d63fbc0 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 @@ -134,6 +136,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableShiftSelection", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE ) 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_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED ) @@ -767,7 +770,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: { - if (impl.mController) + if( impl.mController ) { const bool grabHandlePopupEnabled = value.Get(); DALI_LOG_INFO(gLogFilter, Debug::General, "TextField %p ENABLE_GRAB_HANDLE_POPUP %d\n", impl.mController.Get(), grabHandlePopupEnabled); @@ -776,6 +779,18 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr break; } } + case Toolkit::DevelTextField::Property::BACKGROUND: + { + if( impl.mController ) + { + const Vector4 backgroundColor = value.Get< Vector4 >(); + DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p BACKGROUND %f,%f,%f,%f\n", impl.mController.Get(), backgroundColor.r, backgroundColor.g, backgroundColor.b, backgroundColor.a ); + + impl.mController->SetBackgroundEnabled( true ); + impl.mController->SetBackgroundColor( backgroundColor ); + } + break; + } } // switch } // textfield } @@ -1185,12 +1200,20 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP: { - if (impl.mController) + if( impl.mController ) { value = impl.mController->IsGrabHandlePopupEnabled(); } break; } + case Toolkit::DevelTextField::Property::BACKGROUND: + { + if( impl.mController ) + { + value = impl.mController->GetBackgroundColor(); + } + break; + } } //switch } @@ -1546,7 +1569,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 ); @@ -1560,13 +1583,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.