- impl.mDecorator->SetBoundingBox( box );
- impl.RequestTextRelayout();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
- {
- const Property::Map* map = value.GetMap();
- if (map)
- {
- impl.mInputMethodOptions.ApplyProperty( *map );
- }
- impl.mController->SetInputModePassword( impl.mInputMethodOptions.IsPassword() );
-
- Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
- if (control == textField)
- {
- impl.mInputMethodContext.ApplyOptions( impl.mInputMethodOptions );
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 inputColor = value.Get< Vector4 >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p INPUT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), inputColor.r, inputColor.g, inputColor.b, inputColor.a );
-
- impl.mController->SetInputColor( inputColor );
- }
- break;
- }
- case Toolkit::TextField::Property::ENABLE_MARKUP:
- {
- if( impl.mController )
- {
- const bool enableMarkup = value.Get<bool>();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ENABLE_MARKUP %d\n", impl.mController.Get(), enableMarkup );
-
- impl.mController->SetMarkupProcessorEnabled( enableMarkup );
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_FONT_FAMILY:
- {
- if( impl.mController )
- {
- const std::string& fontFamily = value.Get< std::string >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p INPUT_FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str() );
- impl.mController->SetInputFontFamily( fontFamily );
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_FONT_STYLE:
- {
- SetFontStyleProperty( impl.mController, value, Text::FontStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_POINT_SIZE:
- {
- if( impl.mController )
- {
- const float pointSize = value.Get< float >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p INPUT_POINT_SIZE %f\n", impl.mController.Get(), pointSize );
- impl.mController->SetInputFontPointSize( pointSize );
- }
- break;
- }
- case Toolkit::TextField::Property::UNDERLINE:
- {
- const bool update = SetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_UNDERLINE:
- {
- const bool update = SetUnderlineProperties( impl.mController, value, Text::EffectStyle::INPUT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::SHADOW:
- {
- const bool update = SetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_SHADOW:
- {
- const bool update = SetShadowProperties( impl.mController, value, Text::EffectStyle::INPUT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::EMBOSS:
- {
- const bool update = SetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_EMBOSS:
- {
- const bool update = SetEmbossProperties( impl.mController, value, Text::EffectStyle::INPUT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::OUTLINE:
- {
- const bool update = SetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_OUTLINE:
- {
- const bool update = SetOutlineProperties( impl.mController, value, Text::EffectStyle::INPUT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextField::Property::HIDDEN_INPUT_SETTINGS:
- {
- const Property::Map* map = value.GetMap();
- if (map)
- {
- impl.mController->SetHiddenInputOption(*map);
- }
- break;
- }
- case Toolkit::TextField::Property::PIXEL_SIZE:
- {
- if( impl.mController )
- {
- const float pixelSize = value.Get< float >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PIXEL_SIZE %f\n", impl.mController.Get(), pixelSize );
-
- if( !Equals( impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE ), pixelSize ) )
- {
- impl.mController->SetDefaultFontSize( pixelSize, Text::Controller::PIXEL_SIZE );
- }
- }
- break;
- }
- case Toolkit::TextField::Property::ENABLE_SELECTION:
- {
- if( impl.mController )
- {
- const bool enableSelection = value.Get< bool >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ENABLE_SELECTION %d\n", impl.mController.Get(), enableSelection );
- impl.mController->SetSelectionEnabled( enableSelection );
- }
- break;
- }
- case Toolkit::TextField::Property::PLACEHOLDER:
- {
- const Property::Map* map = value.GetMap();
- if( map )
- {
- impl.mController->SetPlaceholderProperty( *map );
- }
- break;
- }
- case Toolkit::TextField::Property::ELLIPSIS:
- {
- if( impl.mController )
- {
- const bool ellipsis = value.Get<bool>();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ELLIPSIS %d\n", impl.mController.Get(), ellipsis );
-
- impl.mController->SetTextElideEnabled( ellipsis );
- }
- break;
- }
- case Toolkit::DevelTextField::Property::ENABLE_SHIFT_SELECTION:
- {
- if( impl.mController )
- {
- const bool shiftSelection = value.Get<bool>();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ENABLE_SHIFT_SELECTION %d\n", impl.mController.Get(), shiftSelection );
-
- impl.mController->SetShiftSelectionEnabled( shiftSelection );
- }
- break;
- }
- case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE:
- {
- if( impl.mController )
- {
- const bool grabHandleEnabled = value.Get<bool>();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p ENABLE_GRAB_HANDLE %d\n", impl.mController.Get(), grabHandleEnabled );
-
- impl.mController->SetGrabHandleEnabled( grabHandleEnabled );
- }
- break;
- }
- } // switch
- } // textfield
-}
-
-Property::Value TextField::GetProperty( BaseObject* object, Property::Index index )
-{
- Property::Value value;
-
- Toolkit::TextField textField = Toolkit::TextField::DownCast( Dali::BaseHandle( object ) );
-
- if( textField )
- {
- TextField& impl( GetImpl( textField ) );
-
- switch( index )
- {
- case Toolkit::TextField::Property::RENDERING_BACKEND:
- {
- value = impl.mRenderingBackend;
- break;
- }
- case Toolkit::TextField::Property::TEXT:
- {
- if( impl.mController )
- {
- std::string text;
- impl.mController->GetText( text );
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p returning text: %s\n", impl.mController.Get(), text.c_str() );
- value = text;
- }
- break;
- }
- case Toolkit::TextField::Property::PLACEHOLDER_TEXT:
- {
- if( impl.mController )
- {
- std::string text;
- impl.mController->GetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, text );
- value = text;
- }
- break;
- }
- case Toolkit::TextField::Property::PLACEHOLDER_TEXT_FOCUSED:
- {
- if( impl.mController )
- {
- std::string text;
- impl.mController->GetPlaceholderText( Controller::PLACEHOLDER_TYPE_ACTIVE, text );
- value = text;
- }
- break;
- }
- case Toolkit::TextField::Property::FONT_FAMILY:
- {
- if( impl.mController )
- {
- value = impl.mController->GetDefaultFontFamily();
- }
- break;
- }
- case Toolkit::TextField::Property::FONT_STYLE:
- {
- GetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
- break;
- }
- case Toolkit::TextField::Property::POINT_SIZE:
- {
- if( impl.mController )
- {
- value = impl.mController->GetDefaultFontSize( Text::Controller::POINT_SIZE );
- }
- break;
- }
- case Toolkit::TextField::Property::MAX_LENGTH:
- {
- if( impl.mController )
- {
- value = impl.mController->GetMaximumNumberOfCharacters();
- }
- break;
- }
- case Toolkit::TextField::Property::EXCEED_POLICY:
- {
- value = impl.mExceedPolicy;
- break;
- }
- case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
- {
- if( impl.mController )
- {
- const char* name = Text::GetHorizontalAlignmentString( impl.mController->GetHorizontalAlignment() );
-
- if ( name )
- {
- value = std::string( name );
- }
- }
- break;
- }
- case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
- {
- if( impl.mController )
- {
- const char* name = Text::GetVerticalAlignmentString( impl.mController->GetVerticalAlignment() );
-
- if( name )
- {
- value = std::string( name );
- }
- }
- break;
- }
- case Toolkit::TextField::Property::TEXT_COLOR:
- {
- if ( impl.mController )
- {
- value = impl.mController->GetDefaultColor();
- }
- break;
- }
- case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR:
- {
- if ( impl.mController )
- {
- value = impl.mController->GetPlaceholderTextColor();
- }
- break;
- }
- case Toolkit::TextField::Property::SHADOW_OFFSET:
- {
- if ( impl.mController )
- {
- value = impl.mController->GetShadowOffset();
- }
- break;
- }
- case Toolkit::TextField::Property::SHADOW_COLOR:
- {
- if ( impl.mController )
- {
- value = impl.mController->GetShadowColor();
- }
- break;
- }
- case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetColor( PRIMARY_CURSOR );
- }
- break;
- }
- case Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetColor( SECONDARY_CURSOR );
- }
- break;
- }
- case Toolkit::TextField::Property::ENABLE_CURSOR_BLINK:
- {
- value = impl.mController->GetEnableCursorBlink();
- break;
- }
- case Toolkit::TextField::Property::CURSOR_BLINK_INTERVAL:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetCursorBlinkInterval();
- }
- break;
- }
- case Toolkit::TextField::Property::CURSOR_BLINK_DURATION:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetCursorBlinkDuration();
- }
- break;
- }
- case Toolkit::TextField::Property::CURSOR_WIDTH:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetCursorWidth();
- }
- break;
- }
- case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
- {
- if( impl.mDecorator )
- {
- ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED ) );
- if( image )
- {
- value = image.GetUrl();
- }
- }
- break;
- }
- case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
- {
- if( impl.mDecorator )
- {
- ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED ) );
- if( image )
- {
- value = image.GetUrl();
- }
- }
- break;
- }
- case Toolkit::TextField::Property::SCROLL_THRESHOLD:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetScrollThreshold();
- }
- break;
- }
- case Toolkit::TextField::Property::SCROLL_SPEED:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetScrollSpeed();
- }
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
- {
- impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED );
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
- {
- impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) ;
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
- {
- impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED );
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
- {
- impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED );
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
- {
- impl.GetHandleImagePropertyValue( value, LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED );
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
- {
- impl.GetHandleImagePropertyValue( value, RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED );
- break;
- }
- case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
- {
- if( impl.mDecorator )
- {
- value = impl.mDecorator->GetHighlightColor();
- }
- break;
- }
- case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
- {
- if( impl.mDecorator )
- {
- Rect<int> boundingBox;
- impl.mDecorator->GetBoundingBox( boundingBox );
- value = boundingBox;
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
- {
- Property::Map map;
- impl.mInputMethodOptions.RetrieveProperty( map );
- value = map;
- break;
- }
- case Toolkit::TextField::Property::INPUT_COLOR:
- {
- if( impl.mController )
- {
- value = impl.mController->GetInputColor();
- }
- break;
- }
- case Toolkit::TextField::Property::ENABLE_MARKUP:
- {
- if( impl.mController )
- {
- value = impl.mController->IsMarkupProcessorEnabled();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_FONT_FAMILY:
- {
- if( impl.mController )
- {
- value = impl.mController->GetInputFontFamily();
- }
- break;
- }
- case Toolkit::TextField::Property::INPUT_FONT_STYLE:
- {
- GetFontStyleProperty( impl.mController, value, Text::FontStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_POINT_SIZE:
- {
- if( impl.mController )
- {
- value = impl.mController->GetInputFontPointSize();
- }
- break;
- }
- case Toolkit::TextField::Property::UNDERLINE:
- {
- GetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_UNDERLINE:
- {
- GetUnderlineProperties( impl.mController, value, Text::EffectStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::SHADOW:
- {
- GetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_SHADOW:
- {
- GetShadowProperties( impl.mController, value, Text::EffectStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::EMBOSS:
- {
- GetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_EMBOSS:
- {
- GetEmbossProperties( impl.mController, value, Text::EffectStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::OUTLINE:
- {
- GetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- break;
- }
- case Toolkit::TextField::Property::INPUT_OUTLINE:
- {
- GetOutlineProperties( impl.mController, value, Text::EffectStyle::INPUT );
- break;
- }
- case Toolkit::TextField::Property::HIDDEN_INPUT_SETTINGS:
- {
- Property::Map map;
- impl.mController->GetHiddenInputOption(map);
- value = map;
- break;
- }
- case Toolkit::TextField::Property::PIXEL_SIZE:
- {
- if( impl.mController )
- {
- value = impl.mController->GetDefaultFontSize( Text::Controller::PIXEL_SIZE );
- }
- break;
- }
- case Toolkit::TextField::Property::ENABLE_SELECTION:
- {
- if( impl.mController )
- {
- value = impl.mController->IsSelectionEnabled();
- }
- break;
- }
- case Toolkit::TextField::Property::PLACEHOLDER:
- {
- Property::Map map;
- impl.mController->GetPlaceholderProperty( map );
- value = map;
- break;
- }
- case Toolkit::TextField::Property::ELLIPSIS:
- {
- if( impl.mController )
- {
- value = impl.mController->IsTextElideEnabled();
- }
- break;
- }
- case Toolkit::DevelTextField::Property::ENABLE_SHIFT_SELECTION:
- {
- if( impl.mController )
- {
- value = impl.mController->IsShiftSelectionEnabled();
- }
- break;
- }
- case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE:
- {
- if( impl.mController )
- {
- value = impl.mController->IsGrabHandleEnabled();
- }
- break;
- }
- } //switch