+
+ RelayoutRequest();
+
+ // If a GetTextLayoutInfo() or GetHeightForWidth() arrives, relayout the text synchronously is needed in order to retrieve the right values.
+ if( RELAYOUT_ALL != mRelayoutOperations )
+ {
+ mRelayoutOperations = static_cast<RelayoutOperationMask>( mRelayoutOperations |
+ RELAYOUT_TEXT_ACTOR_UPDATE |
+ RELAYOUT_ALIGNMENT |
+ RELAYOUT_VISIBILITY );
+ }
+}
+
+std::string TextView::OnHorizontalAlignmentPropertyGet()
+{
+ if( mLayoutParameters.mHorizontalAlignment == Toolkit::Alignment::HorizontalLeft )
+ {
+ return "HorizontalLeft";
+ }
+ else if( mLayoutParameters.mHorizontalAlignment == Toolkit::Alignment::HorizontalCenter )
+ {
+ return "HorizontalCenter";
+ }
+ else if( mLayoutParameters.mHorizontalAlignment == Toolkit::Alignment::HorizontalRight )
+ {
+ return "HorizontalRight";
+ }
+ else
+ {
+ DALI_ASSERT_ALWAYS( !"TextView::OnHorizontalAlignmentPropertyGet(). Invalid value." );
+ }
+}
+
+std::string TextView::OnVerticalAlignmentPropertyGet()
+{
+ if( mLayoutParameters.mVerticalAlignment == Toolkit::Alignment::VerticalTop )
+ {
+ return "VerticalTop";
+ }
+ else if( mLayoutParameters.mVerticalAlignment == Toolkit::Alignment::VerticalCenter )
+ {
+ return "VerticalCenter";
+ }
+ else if( mLayoutParameters.mVerticalAlignment == Toolkit::Alignment::VerticalBottom )
+ {
+ return "VerticalBottom";
+ }
+ else
+ {
+ DALI_ASSERT_ALWAYS( !"TextView::OnVerticalAlignmentPropertyGet(). Invalid value." );
+ }
+}
+
+void TextView::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
+{
+ Toolkit::TextView textView = Toolkit::TextView::DownCast( Dali::BaseHandle( object ) );
+
+ if( textView )
+ {
+ TextView& textViewImpl( GetImpl( textView ) );
+ switch( index )
+ {
+ case Toolkit::TextView::Property::MARKUP_ENABLED:
+ {
+ textViewImpl.OnMarkupEnabledPeopertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::TEXT:
+ {
+ textViewImpl.SetText( value.Get<std::string>() );
+ break;
+ }
+ case Toolkit::TextView::Property::MULTILINE_POLICY:
+ {
+ textViewImpl.OnMultilinePolicyPropertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
+ {
+ textViewImpl.OnWidthExceedPolicyPropertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
+ {
+ textViewImpl.OnHeightExceedPolicyPropertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::LINE_JUSTIFICATION:
+ {
+ textViewImpl.OnLineJustificationPropertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::FADE_BOUNDARY:
+ {
+ textViewImpl.OnFadeBoundaryPropertySet( value );
+ break;
+ }
+ case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
+ {
+ Dali::PointSize pointSize( value.Get<float>() );
+ textViewImpl.SetLineHeightOffset(pointSize);
+ break;
+ }
+ case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
+ case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
+ {
+ textViewImpl.OnAlignmentPropertySet( index, value );
+ break;
+ }
+ }
+ }
+}
+
+Property::Value TextView::GetProperty( BaseObject* object, Property::Index index )
+{
+ Property::Value value;
+
+ Toolkit::TextView textView = Toolkit::TextView::DownCast( Dali::BaseHandle( object ) );
+
+ if( textView )
+ {
+ TextView& textViewImpl( GetImpl( textView ) );
+ switch( index )
+ {
+ case Toolkit::TextView::Property::MARKUP_ENABLED:
+ {
+ value = textViewImpl.IsMarkupProcessingEnabled();
+ break;
+ }
+ case Toolkit::TextView::Property::TEXT:
+ {
+ value = textViewImpl.GetText();
+ break;
+ }
+ case Toolkit::TextView::Property::MULTILINE_POLICY:
+ {
+ value = MULTILINE_POLICY_NAME[ textViewImpl.GetMultilinePolicy() ];
+ break;
+ }
+ case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
+ {
+ value = EXCEED_POLICY_NAME[ textViewImpl.GetWidthExceedPolicy() ];
+ break;
+ }
+ case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
+ {
+ value = EXCEED_POLICY_NAME[ textViewImpl.GetHeightExceedPolicy() ];
+ break;
+ }
+ case Toolkit::TextView::Property::LINE_JUSTIFICATION:
+ {
+ value = LINE_JUSTIFICATION_NAME[ textViewImpl.GetLineJustification() ];
+ break;
+ }
+ case Toolkit::TextView::Property::FADE_BOUNDARY:
+ {
+ Toolkit::TextView::FadeBoundary boundary = textViewImpl.GetFadeBoundary();
+ value = Vector4( static_cast<float>( boundary.mLeft.value ),
+ static_cast<float>( boundary.mRight.value ),
+ static_cast<float>( boundary.mTop.value ),
+ static_cast<float>( boundary.mBottom.value ) );
+ break;
+ }
+ case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
+ {
+ value = textViewImpl.GetLineHeightOffset().value;
+ break;
+ }
+ case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
+ {
+ value = textViewImpl.OnHorizontalAlignmentPropertyGet();
+ break;
+ }
+ case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
+ {
+ value = textViewImpl.OnVerticalAlignmentPropertyGet();
+ break;
+ }
+ }
+ }
+ return value;