Merge "Prevent Image visuals creating a renderer and putting it on stage even if...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-label-impl.cpp
index 955e0f2..273ffee 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/text/rendering-backend.h>
 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/devel-visual-properties.h>
 #include <dali-toolkit/internal/text/text-effects-style.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 
@@ -63,7 +64,7 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend",     INTEGER, RENDERING_BACKEND      )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text",                 STRING,  TEXT                   )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily",           STRING,  FONT_FAMILY            )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            STRING,  FONT_STYLE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle",            MAP,     FONT_STYLE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize",            FLOAT,   POINT_SIZE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine",            BOOLEAN, MULTI_LINE             )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment",  STRING,  HORIZONTAL_ALIGNMENT   )
@@ -80,10 +81,10 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed",      INTEGER,
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount",  INTEGER, AUTO_SCROLL_LOOP_COUNT )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap",        FLOAT,   AUTO_SCROLL_GAP        )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing",          FLOAT,   LINE_SPACING           )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline",            STRING,  UNDERLINE              )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow",               STRING,  SHADOW                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss",               STRING,  EMBOSS                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline",              STRING,  OUTLINE                )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline",            MAP,     UNDERLINE              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow",               MAP,     SHADOW                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss",               MAP,     EMBOSS                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline",              MAP,     OUTLINE                )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -172,11 +173,11 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool offsetDefined = false;
           Vector2 offset;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    colorDefined,
-                                                    color,
-                                                    offsetDefined,
-                                                    offset );
+          const bool empty = Text::ParseShadowProperties( value.Get<Property::Map>(),
+                                                          colorDefined,
+                                                          color,
+                                                          offsetDefined,
+                                                          offset );
 
           if( !empty )
           {
@@ -190,11 +191,11 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool offsetDefined = false;
           Vector2 offset;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    colorDefined,
-                                                    color,
-                                                    offsetDefined,
-                                                    offset );
+          const bool empty = Text::ParseShadowProperties( value.Get<Property::Map>(),
+                                                          colorDefined,
+                                                          color,
+                                                          offsetDefined,
+                                                          offset );
 
           if( !empty )
           {
@@ -209,12 +210,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty )
           {
@@ -229,12 +230,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty && colorDefined )
           {
@@ -249,12 +250,12 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
           Vector4 color;
           bool heightDefined = false;
           float height = 0.f;
-          const bool empty = Text::ParseProperties( value.Get<std::string>(),
-                                                    enabled,
-                                                    colorDefined,
-                                                    color,
-                                                    heightDefined,
-                                                    height );
+          const bool empty = Text::ParseUnderlineProperties( value.Get<Property::Map>(),
+                                                             enabled,
+                                                             colorDefined,
+                                                             color,
+                                                             heightDefined,
+                                                             height );
 
           if( !empty && heightDefined )
           {
@@ -285,7 +286,7 @@ void TextLabel::OnInitialize()
 
   // Creates the text's visual.
   Property::Map visualMap;
-  visualMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::TEXT;
+  visualMap[Toolkit::VisualProperty::TYPE] = Toolkit::Visual::TEXT;
   visualMap[Toolkit::TextVisual::Property::RENDERING_BACKEND] = static_cast<int>( DEFAULT_RENDERING_BACKEND );
 
   mVisual =  Toolkit::VisualFactory::Get().CreateVisual( visualMap );