Remove deprecated APIs in Tizen 3.0
[platform/core/uifw/dali-core.git] / dali / public-api / actors / actor.cpp
index 38c93b0..88a1cd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/radian.h>
 #include <dali/public-api/math/vector2.h>
 
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/actors/layer-impl.h>
-#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
+#include <dali/internal/event/rendering/renderer-impl.h>
 #include <dali/internal/event/animation/constraint-impl.h>
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
 
 namespace Dali
 {
@@ -75,7 +75,7 @@ void Actor::SetName(const std::string& name)
   GetImplementation(*this).SetName(name);
 }
 
-unsigned int Actor::GetId() const
+uint32_t Actor::GetId() const
 {
   return GetImplementation(*this).GetId();
 }
@@ -105,11 +105,6 @@ void Actor::Add(Actor actor)
   GetImplementation(*this).Add(GetImplementation(actor));
 }
 
-void Actor::Insert(unsigned int index, Actor actor)
-{
-  GetImplementation(*this).Insert(index, GetImplementation(actor));
-}
-
 void Actor::Remove(Actor actor)
 {
   GetImplementation(*this).Remove(GetImplementation(actor));
@@ -120,26 +115,27 @@ void Actor::Unparent()
   GetImplementation(*this).Unparent();
 }
 
-unsigned int Actor::GetChildCount() const
+uint32_t Actor::GetChildCount() const
 {
   return GetImplementation(*this).GetChildCount();
 }
 
-Actor Actor::GetChildAt(unsigned int index) const
+Actor Actor::GetChildAt( uint32_t index ) const
 {
-  return GetImplementation(*this).GetChildAt(index);
+  Internal::ActorPtr child = GetImplementation(*this).GetChildAt( index );
+  return Actor( child.Get() );
 }
 
 Actor Actor::FindChildByName(const std::string& actorName)
 {
-  Internal::ActorPtr child = GetImplementation(*this).FindChildByName(actorName);
-  return Actor(child.Get());
+  Internal::ActorPtr child = GetImplementation(*this).FindChildByName( actorName );
+  return Actor( child.Get() );
 }
 
-Actor Actor::FindChildById(const unsigned int id)
+Actor Actor::FindChildById( const uint32_t id )
 {
-  Internal::ActorPtr child = GetImplementation(*this).FindChildById(id);
-  return Actor(child.Get());
+  Internal::ActorPtr child = GetImplementation(*this).FindChildById( id );
+  return Actor( child.Get() );
 }
 
 Actor Actor::GetParent() const
@@ -181,17 +177,17 @@ void Actor::SetSize(float width, float height, float depth)
 
 void Actor::SetSize(const Vector2& size)
 {
-  GetImplementation(*this).SetSize(size);
+  GetImplementation(*this).SetSize( size );
 }
 
 void Actor::SetSize(const Vector3& size)
 {
-  GetImplementation(*this).SetSize(size);
+  GetImplementation(*this).SetSize( size );
 }
 
-Vector3 Actor::GetSize() const
+Vector3 Actor::GetTargetSize() const
 {
-  return GetImplementation(*this).GetSize();
+  return GetImplementation(*this).GetTargetSize();
 }
 
 Vector3 Actor::GetCurrentSize() const
@@ -249,21 +245,6 @@ Vector3 Actor::GetCurrentWorldPosition() const
   return GetImplementation(*this).GetCurrentWorldPosition();
 }
 
-void Actor::SetPositionInheritanceMode( PositionInheritanceMode mode )
-{
-  GetImplementation(*this).SetPositionInheritanceMode( mode );
-}
-
-PositionInheritanceMode Actor::GetPositionInheritanceMode() const
-{
-  return GetImplementation(*this).GetPositionInheritanceMode();
-}
-
-void Actor::SetOrientation(const Degree& angle, const Vector3& axis)
-{
-  GetImplementation(*this).SetOrientation(Radian(angle), axis);
-}
-
 void Actor::SetOrientation(const Radian& angle, const Vector3& axis)
 {
   GetImplementation(*this).SetOrientation(angle, axis);
@@ -274,11 +255,6 @@ void Actor::SetOrientation(const Quaternion& orientation)
   GetImplementation(*this).SetOrientation(orientation);
 }
 
-void Actor::RotateBy(const Degree& angle, const Vector3& axis)
-{
-  GetImplementation(*this).RotateBy(Radian(angle), axis);
-}
-
 void Actor::RotateBy(const Radian& angle, const Vector3& axis)
 {
   GetImplementation(*this).RotateBy(angle, axis);
@@ -349,16 +325,6 @@ bool Actor::IsScaleInherited() const
   return GetImplementation(*this).IsScaleInherited();
 }
 
-void Actor::SetSizeMode(SizeMode mode)
-{
-  GetImplementation(*this).SetSizeMode(mode);
-}
-
-SizeMode Actor::GetSizeMode() const
-{
-  return GetImplementation(*this).GetSizeMode();
-}
-
 void Actor::SetSizeModeFactor(const Vector3& factor)
 {
   GetImplementation(*this).SetSizeModeFactor(factor);
@@ -464,19 +430,150 @@ bool Actor::IsKeyboardFocusable() const
   return GetImplementation(*this).IsKeyboardFocusable();
 }
 
+void Actor::Raise()
+{
+  GetImplementation( *this ).Raise();
+}
+
+void Actor::Lower()
+{
+  GetImplementation( *this ).Lower();
+}
+
+void Actor::RaiseToTop()
+{
+  GetImplementation( *this ).RaiseToTop();
+}
+
+void Actor::LowerToBottom()
+{
+  GetImplementation( *this ).LowerToBottom();
+}
+
+void Actor::RaiseAbove( Actor target )
+{
+  GetImplementation( *this ).RaiseAbove( GetImplementation( target ) );
+}
+
+void Actor::LowerBelow( Actor target )
+{
+  GetImplementation( *this ).LowerBelow( GetImplementation( target ) );
+}
+
+void Actor::SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+{
+  GetImplementation(*this).SetResizePolicy( policy, dimension );
+}
+
+ResizePolicy::Type Actor::GetResizePolicy( Dimension::Type dimension ) const
+{
+  return GetImplementation(*this).GetResizePolicy( dimension );
+}
+
+void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy )
+{
+  GetImplementation(*this).SetSizeScalePolicy( policy );
+}
+
+SizeScalePolicy::Type Actor::GetSizeScalePolicy() const
+{
+  return GetImplementation(*this).GetSizeScalePolicy();
+}
+
+float Actor::GetHeightForWidth( float width )
+{
+  return GetImplementation(*this).GetHeightForWidth( width );
+}
+
+float Actor::GetWidthForHeight( float height )
+{
+  return GetImplementation(*this).GetWidthForHeight( height );
+}
+
+float Actor::GetRelayoutSize( Dimension::Type dimension ) const
+{
+  return GetImplementation(*this).GetRelayoutSize( dimension );
+}
+
+void Actor::SetPadding( const Padding& padding )
+{
+  Internal::Actor& impl = GetImplementation(*this);
+
+  Vector2 widthPadding( padding.left, padding.right );
+  impl.SetPadding( widthPadding, Dimension::WIDTH );
+
+  Vector2 heightPadding( padding.bottom, padding.top );
+  impl.SetPadding( heightPadding, Dimension::HEIGHT );
+}
+
+void Actor::GetPadding( Padding& paddingOut ) const
+{
+  const Internal::Actor& impl = GetImplementation(*this);
+
+  Vector2 widthPadding = impl.GetPadding( Dimension::WIDTH );
+  Vector2 heightPadding = impl.GetPadding( Dimension::HEIGHT );
+
+  paddingOut.left = widthPadding.x;
+  paddingOut.right = widthPadding.y;
+  paddingOut.bottom = heightPadding.x;
+  paddingOut.top = heightPadding.y;
+}
+
+void Actor::SetMinimumSize( const Vector2& size )
+{
+  Internal::Actor& impl = GetImplementation(*this);
+
+  impl.SetMinimumSize( size.x, Dimension::WIDTH );
+  impl.SetMinimumSize( size.y, Dimension::HEIGHT );
+}
+
+Vector2 Actor::GetMinimumSize()
+{
+  Internal::Actor& impl = GetImplementation(*this);
+
+  return Vector2( impl.GetMinimumSize( Dimension::WIDTH ), impl.GetMinimumSize( Dimension::HEIGHT ) );
+}
+
+void Actor::SetMaximumSize( const Vector2& size )
+{
+  Internal::Actor& impl = GetImplementation(*this);
+
+  impl.SetMaximumSize( size.x, Dimension::WIDTH );
+  impl.SetMaximumSize( size.y, Dimension::HEIGHT );
+}
+
+Vector2 Actor::GetMaximumSize()
+{
+  Internal::Actor& impl = GetImplementation(*this);
+
+  return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) );
+}
+
+int32_t Actor::GetHierarchyDepth()
+{
+  return GetImplementation(*this).GetHierarchyDepth();
+}
+
 Actor::TouchSignalType& Actor::TouchedSignal()
 {
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" );
+
   return GetImplementation(*this).TouchedSignal();
 }
 
+Actor::TouchDataSignalType& Actor::TouchSignal()
+{
+  return GetImplementation( *this ).TouchSignal();
+}
+
 Actor::HoverSignalType& Actor::HoveredSignal()
 {
   return GetImplementation(*this).HoveredSignal();
 }
 
-Actor::MouseWheelEventSignalType& Actor::MouseWheelEventSignal()
+Actor::WheelEventSignalType& Actor::WheelEventSignal()
 {
-  return GetImplementation(*this).MouseWheelEventSignal();
+  return GetImplementation(*this).WheelEventSignal();
 }
 
 Actor::OnStageSignalType& Actor::OnStageSignal()
@@ -489,18 +586,45 @@ Actor::OffStageSignalType& Actor::OffStageSignal()
   return GetImplementation(*this).OffStageSignal();
 }
 
-Actor::Actor(Internal::Actor* internal)
-: Handle(internal)
+uint32_t Actor::AddRenderer( Renderer& renderer )
+{
+  return GetImplementation(*this).AddRenderer( GetImplementation( renderer ) );
+}
+
+uint32_t Actor::GetRendererCount() const
+{
+  return GetImplementation(*this).GetRendererCount();
+}
+
+Renderer Actor::GetRendererAt( uint32_t index )
 {
+  Internal::RendererPtr renderer = GetImplementation(*this).GetRendererAt( index );
+  return Renderer( renderer.Get() );
 }
 
-void UnparentAndReset( Actor& actor )
+void Actor::RemoveRenderer( Renderer& renderer )
+{
+  GetImplementation(*this).RemoveRenderer( GetImplementation( renderer ) );
+}
+
+void Actor::RemoveRenderer( uint32_t index )
+{
+  GetImplementation(*this).RemoveRenderer( index );
+}
+
+Actor::OnRelayoutSignalType& Actor::OnRelayoutSignal()
+{
+  return GetImplementation(*this).OnRelayoutSignal();
+}
+
+Actor::LayoutDirectionChangedSignalType& Actor::LayoutDirectionChangedSignal()
+{
+  return GetImplementation( *this ).LayoutDirectionChangedSignal();
+}
+
+Actor::Actor(Internal::Actor* internal)
+: Handle(internal)
 {
-  if( actor )
-  {
-    actor.Unparent();
-    actor.Reset();
-  }
 }
 
 } // namespace Dali