Stop using deprecated API from Popup and fix typo in Control
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control.cpp
index 6f75dfc..415ffb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 
 namespace Dali
@@ -33,8 +39,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 +62,88 @@ 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 )
+void Control::SetKeyInputFocus()
 {
-  GetImplementation().SetMaximumSize( size );
+  Internal::GetImplementation(*this).SetKeyInputFocus();
 }
 
-const Vector3& Control::GetMaximumSize() const
+bool Control::HasKeyInputFocus()
 {
-  return GetImplementation().GetMaximumSize();
+  return Internal::GetImplementation(*this).HasKeyInputFocus();
 }
 
-Vector3 Control::GetNaturalSize()
+void Control::ClearKeyInputFocus()
 {
-  return GetImplementation().GetNaturalSize();
+  Internal::GetImplementation(*this).ClearKeyInputFocus();
 }
 
-float Control::GetHeightForWidth( float width )
+PinchGestureDetector Control::GetPinchGestureDetector() const
 {
-  return GetImplementation().GetHeightForWidth( width );
+  return Internal::GetImplementation(*this).GetPinchGestureDetector();
 }
 
-float Control::GetWidthForHeight( float height )
+PanGestureDetector Control::GetPanGestureDetector() const
 {
-  return GetImplementation().GetWidthForHeight( height );
+  return Internal::GetImplementation(*this).GetPanGestureDetector();
 }
 
-void Control::SetKeyInputFocus()
+TapGestureDetector Control::GetTapGestureDetector() const
 {
-  GetImplementation().SetKeyInputFocus();
+  return Internal::GetImplementation(*this).GetTapGestureDetector();
 }
 
-bool Control::HasKeyInputFocus()
+LongPressGestureDetector Control::GetLongPressGestureDetector() const
 {
-  return GetImplementation().HasKeyInputFocus();
+  return Internal::GetImplementation(*this).GetLongPressGestureDetector();
 }
 
-void Control::ClearKeyInputFocus()
+void Control::SetStyleName( const std::string& styleName )
 {
-  GetImplementation().ClearKeyInputFocus();
+  Internal::GetImplementation(*this).SetStyleName( styleName );
 }
 
-PinchGestureDetector Control::GetPinchGestureDetector() const
+const std::string& Control::GetStyleName() const
 {
-  return GetImplementation().GetPinchGestureDetector();
+  return Internal::GetImplementation(*this).GetStyleName();
 }
 
-PanGestureDetector Control::GetPanGestureDetector() const
+void Control::SetBackgroundColor( const Vector4& color )
 {
-  return GetImplementation().GetPanGestureDetector();
-}
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
 
-TapGestureDetector Control::GetTapGestureDetector() const
-{
-  return GetImplementation().GetTapGestureDetector();
+  Internal::GetImplementation(*this).SetBackgroundColor( color );
 }
 
-LongPressGestureDetector Control::GetLongPressGestureDetector() const
+Vector4 Control::GetBackgroundColor() const
 {
-  return GetImplementation().GetLongPressGestureDetector();
-}
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
 
-void Control::SetBackgroundColor( const Vector4& color )
-{
-  GetImplementation().SetBackgroundColor( color );
+  return Internal::GetImplementation(*this).GetBackgroundColor();
 }
 
-Vector4 Control::GetBackgroundColor() const
+void Control::SetBackgroundImage( Image image )
 {
-  return GetImplementation().GetBackgroundColor();
+  Internal::GetImplementation(*this).SetBackgroundImage( image );
 }
 
-void Control::SetBackground( Image image )
+void Control::ClearBackground()
 {
-  GetImplementation().SetBackground( image );
+  Internal::GetImplementation(*this).ClearBackground();
 }
 
-void Control::ClearBackground()
+Control::KeyEventSignalType& Control::KeyEventSignal()
 {
-  GetImplementation().ClearBackground();
+  return Internal::GetImplementation(*this).KeyEventSignal();
 }
 
-Actor Control::GetBackgroundActor() const
+Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
 {
-  return GetImplementation().GetBackgroundActor();
+  return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
 }
 
-Control::KeyEventSignalType& Control::KeyEventSignal()
+Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
 {
-  return GetImplementation().KeyEventSignal();
+  return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
 }
 
 Control::Control(Internal::Control& implementation)