Added code for stylable transitions
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-base-impl.cpp
index 8356de5..922f561 100644 (file)
@@ -55,7 +55,7 @@ void Visual::Base::SetCustomShader( const Property::Map& shaderMap )
   }
   else
   {
-   mImpl->mCustomShader = new Impl::CustomShader( shaderMap );
+    mImpl->mCustomShader = new Impl::CustomShader( shaderMap );
   }
 }
 
@@ -74,6 +74,16 @@ void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap )
   DoInitialize( actor, propertyMap );
 }
 
+void Visual::Base::SetName( const std::string& name )
+{
+  mImpl->mName = name;
+}
+
+const std::string& Visual::Base::GetName()
+{
+  return mImpl->mName;
+}
+
 void Visual::Base::SetSize( const Vector2& size )
 {
   mImpl->mSize = size;
@@ -172,6 +182,42 @@ bool Visual::Base::GetIsFromCache() const
   return mImpl->mFlags & Impl::IS_FROM_CACHE;
 }
 
+void Visual::Base::SetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue )
+{
+  DALI_ASSERT_ALWAYS( ( index > Property::INVALID_INDEX ) &&
+                      ( index > VISUAL_PROPERTY_BASE_START_INDEX ) && // Change the type of visual is not allowed.
+                      "Property index is out of bounds" );
+
+  if( index < VISUAL_PROPERTY_START_INDEX )
+  {
+    // TODO set the properties of the visual base.
+  }
+  else
+  {
+    DoSetProperty( index, propertyValue );
+  }
+}
+
+Dali::Property::Value Visual::Base::GetProperty( Dali::Property::Index index )
+{
+  DALI_ASSERT_ALWAYS( ( index > Property::INVALID_INDEX ) &&
+                      ( index >= VISUAL_PROPERTY_BASE_START_INDEX ) &&
+                      "Property index is out of bounds" );
+
+  Dali::Property::Value value;
+
+  if( index < VISUAL_PROPERTY_START_INDEX )
+  {
+    // TODO retrieve the properties of the visual base.
+  }
+  else
+  {
+    value = DoGetProperty( index );
+  }
+
+  return value;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit