Control::UnregisterVisual does not remove renderers from actor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control.cpp
index 6f75dfc..18eaeeb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+// CLASS HEADER
 #include <dali-toolkit/public-api/controls/control.h>
+
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 
 namespace Dali
@@ -33,8 +36,8 @@ Control::Control()
 {
 }
 
-Control::Control(const Control& uiControl)
-: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL)
+Control::Control( const Control& uiControl )
+: CustomActor( uiControl  )
 {
 }
 
@@ -56,124 +59,84 @@ Control Control::DownCast( BaseHandle handle )
   return DownCast< Control, Internal::Control >(handle);
 }
 
-Internal::Control& Control::GetImplementation()
-{
-  return static_cast<Internal::Control&>(CustomActor::GetImplementation());
-}
-
-const Internal::Control& Control::GetImplementation() const
-{
-  return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
-}
-
-void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy )
-{
-  GetImplementation().SetSizePolicy( widthPolicy, heightPolicy );
-}
-
-void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const
-{
-  GetImplementation().GetSizePolicy( widthPolicy, heightPolicy );
-}
-
-void Control::SetMinimumSize( const Vector3& size )
-{
-  GetImplementation().SetMinimumSize( size );
-}
-
-const Vector3& Control::GetMinimumSize() const
-{
-  return GetImplementation().GetMinimumSize();
-}
-
-void Control::SetMaximumSize( const Vector3& size )
-{
-  GetImplementation().SetMaximumSize( size );
-}
-
-const Vector3& Control::GetMaximumSize() const
-{
-  return GetImplementation().GetMaximumSize();
-}
-
-Vector3 Control::GetNaturalSize()
-{
-  return GetImplementation().GetNaturalSize();
-}
-
-float Control::GetHeightForWidth( float width )
-{
-  return GetImplementation().GetHeightForWidth( width );
-}
-
-float Control::GetWidthForHeight( float height )
-{
-  return GetImplementation().GetWidthForHeight( height );
-}
-
 void Control::SetKeyInputFocus()
 {
-  GetImplementation().SetKeyInputFocus();
+  Internal::GetImplementation(*this).SetKeyInputFocus();
 }
 
 bool Control::HasKeyInputFocus()
 {
-  return GetImplementation().HasKeyInputFocus();
+  return Internal::GetImplementation(*this).HasKeyInputFocus();
 }
 
 void Control::ClearKeyInputFocus()
 {
-  GetImplementation().ClearKeyInputFocus();
+  Internal::GetImplementation(*this).ClearKeyInputFocus();
 }
 
 PinchGestureDetector Control::GetPinchGestureDetector() const
 {
-  return GetImplementation().GetPinchGestureDetector();
+  return Internal::GetImplementation(*this).GetPinchGestureDetector();
 }
 
 PanGestureDetector Control::GetPanGestureDetector() const
 {
-  return GetImplementation().GetPanGestureDetector();
+  return Internal::GetImplementation(*this).GetPanGestureDetector();
 }
 
 TapGestureDetector Control::GetTapGestureDetector() const
 {
-  return GetImplementation().GetTapGestureDetector();
+  return Internal::GetImplementation(*this).GetTapGestureDetector();
 }
 
 LongPressGestureDetector Control::GetLongPressGestureDetector() const
 {
-  return GetImplementation().GetLongPressGestureDetector();
+  return Internal::GetImplementation(*this).GetLongPressGestureDetector();
+}
+
+void Control::SetStyleName( const std::string& styleName )
+{
+  Internal::GetImplementation(*this).SetStyleName( styleName );
+}
+
+const std::string& Control::GetStyleName() const
+{
+  return Internal::GetImplementation(*this).GetStyleName();
 }
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
-  GetImplementation().SetBackgroundColor( color );
+  Internal::GetImplementation(*this).SetBackgroundColor( color );
 }
 
 Vector4 Control::GetBackgroundColor() const
 {
-  return GetImplementation().GetBackgroundColor();
+  return Internal::GetImplementation(*this).GetBackgroundColor();
 }
 
-void Control::SetBackground( Image image )
+void Control::SetBackgroundImage( Image image )
 {
-  GetImplementation().SetBackground( image );
+  Internal::GetImplementation(*this).SetBackgroundImage( image );
 }
 
 void Control::ClearBackground()
 {
-  GetImplementation().ClearBackground();
+  Internal::GetImplementation(*this).ClearBackground();
 }
 
-Actor Control::GetBackgroundActor() const
+Control::KeyEventSignalType& Control::KeyEventSignal()
 {
-  return GetImplementation().GetBackgroundActor();
+  return Internal::GetImplementation(*this).KeyEventSignal();
 }
 
-Control::KeyEventSignalType& Control::KeyEventSignal()
+Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
+{
+  return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
+}
+
+Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
 {
-  return GetImplementation().KeyEventSignal();
+  return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
 }
 
 Control::Control(Internal::Control& implementation)