- case Toolkit::TextVisual::Property::ENABLE_MARKUP:
- {
- const bool enableMarkup = propertyValue.Get<bool>();
- mController->SetMarkupProcessorEnabled( enableMarkup );
- break;
- }
- case Toolkit::TextVisual::Property::ENABLE_AUTO_SCROLL:
- {
- const bool enableAutoScroll = propertyValue.Get<bool>();
-
- // If request to auto scroll is the same as current state then do nothing.
- if( enableAutoScroll != mController->IsAutoScrollEnabled() )
- {
- // If request is disable (false) and auto scrolling is enabled then need to stop it
- if( !enableAutoScroll )
- {
- StopTextAutoScrolling(); // Causes the current animation to finish playing.
- }
- // If request is enable (true) then start autoscroll as not already running
- else
- {
- mController->GetLayoutEngine().SetTextEllipsisEnabled( false );
- mController->SetAutoScrollEnabled( enableAutoScroll );
- mController->RequestRelayout();
- }
- }
- break;
- }
- case Toolkit::TextVisual::Property::AUTO_SCROLL_SPEED:
- {
- mController->SetAutoscrollSpeed( propertyValue.Get<int>() );
- break;
- }
- case Toolkit::TextVisual::Property::AUTO_SCROLL_LOOP_COUNT:
- {
- const int loopCount = propertyValue.Get<int>();
- if( loopCount > 0 )
- {
- mController->SetAutoScrollLoopCount( loopCount );
- }
- else
- {
- StopTextAutoScrolling(); // Causes the current animation to finish playing.
- }
- break;
- }
- case Toolkit::TextVisual::Property::AUTO_SCROLL_GAP:
- {
- mController->SetAutoScrollWrapGap( propertyValue.Get<float>() );
- break;
- }
- case Toolkit::TextVisual::Property::LINE_SPACING:
- {
- const float lineSpacing = propertyValue.Get<float>();
- mController->SetDefaultLineSpacing( lineSpacing );
- mRenderer.Reset();
- break;
- }
- case Toolkit::TextVisual::Property::UNDERLINE:
- {
- // TODO : This switch can be removed when the deprecated SHADOW_OFFSET and SHADOW_COLOR properties are finally removed.
- // Only the code for the STRING case should be kept.
- switch( propertyValue.GetType() )
- {
- case Property::VECTOR4:
- {
- const Vector4 color = propertyValue.Get<Vector4>();
- if( mController->GetUnderlineColor() != color )
- {
- mController->SetUnderlineColor( color );
- mRenderer.Reset();
- }
- break;
- }
- case Property::FLOAT:
- {
- float height = propertyValue.Get<float>();
- if( fabsf( mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
- {
- mController->SetUnderlineHeight( height );
- mRenderer.Reset();
- }
- break;
- }
- case Property::BOOLEAN:
- {
- const bool enabled = propertyValue.Get<bool>();
- if( mController->IsUnderlineEnabled() != enabled )
- {
- mController->SetUnderlineEnabled( enabled );
- mRenderer.Reset();
- }
- break;
- }
- case Property::STRING:
- {
- const bool update = SetUnderlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
- if( update )
- {
- mRenderer.Reset();
- }
- break;
- }
- default:
- {
- // Nothing to do.
- break;
- }
- }
-
- break;
- }
- case Toolkit::TextVisual::Property::SHADOW:
- {
- // TODO : This switch can be removed when the deprecated SHADOW_OFFSET and SHADOW_COLOR properties are finally removed.
- // Only the code for the STRING case should be kept.
- switch( propertyValue.GetType() )
- {
- case Property::VECTOR2:
- {
- const Vector2 shadowOffset = propertyValue.Get<Vector2>();
- if( mController->GetShadowOffset() != shadowOffset )
- {
- mController->SetShadowOffset( shadowOffset );
- mRenderer.Reset();
- }
- break;
- }
- case Property::VECTOR4:
- {
- const Vector4 shadowColor = propertyValue.Get<Vector4>();
- if( mController->GetShadowColor() != shadowColor )
- {
- mController->SetShadowColor( shadowColor );
- mRenderer.Reset();
- }
- break;
- }
- case Property::STRING:
- {
- const bool update = SetShadowProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
- if( update )
- {
- mRenderer.Reset();
- }
- break;
- }
- default:
- {
- // Nothing to do.
- break;
- }
- }
- break;
- }
- case Toolkit::TextVisual::Property::EMBOSS:
- {
- const bool update = SetEmbossProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
- if( update )
- {
- mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextVisual::Property::OUTLINE:
- {
- const bool update = SetOutlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
- if( update )
- {
- mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextVisual::Property::BATCHING_ENABLED:
- {
- // TODO
- break;
- }
- default:
- {
- // Should not arrive here.
- DALI_ASSERT_DEBUG( false );
- }