(Control Base) Add GetVisual() & GetPlacementActor() methods
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.cpp
index 8c5eb2a..23745bb 100644 (file)
@@ -511,6 +511,7 @@ void Control::ClearBackground()
 {
   Actor self( Self() );
   mImpl->mBackgroundVisual.RemoveAndReset( self );
+  mImpl->mBackgroundColor = Color::TRANSPARENT;
 }
 
 void Control::EnableGestureDetection(Gesture::Type type)
@@ -690,6 +691,35 @@ void Control::UnregisterVisual( Property::Index index )
    }
 }
 
+Toolkit::Visual::Base Control::GetVisual( Property::Index index )
+{
+  std::vector< RegisteredVisual >::iterator iter;
+  if ( FindVisual( index, mImpl->mVisuals, iter ) )
+  {
+    return (*iter).visual;
+  }
+
+  return Toolkit::Visual::Base();
+}
+
+Actor Control::GetPlacementActor( Property::Index index )
+{
+  std::vector< RegisteredVisual >::iterator iter;
+  if ( FindVisual( index, mImpl->mVisuals, iter ) )
+  {
+    if( (*iter).placementActor )
+    {
+      return (*iter).placementActor;
+    }
+    else
+    {
+      return Self();
+    }
+  }
+
+  return Actor();
+}
+
 bool Control::OnAccessibilityActivated()
 {
   return false; // Accessibility activation is not handled by default