[dali_1.0.46] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / public-api / actors / actor.cpp
index 38c93b0..1f413fb 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.
@@ -22,7 +22,6 @@
 #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>
 
@@ -30,6 +29,7 @@
 #include <dali/internal/event/actors/layer-impl.h>
 #include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
 #include <dali/internal/event/animation/constraint-impl.h>
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
 
 namespace Dali
 {
@@ -181,17 +181,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
@@ -259,11 +259,6 @@ 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 +269,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 +339,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,6 +444,95 @@ bool Actor::IsKeyboardFocusable() const
   return GetImplementation(*this).IsKeyboardFocusable();
 }
 
+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 ) );
+}
+
 Actor::TouchSignalType& Actor::TouchedSignal()
 {
   return GetImplementation(*this).TouchedSignal();
@@ -474,9 +543,9 @@ 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 +558,14 @@ Actor::OffStageSignalType& Actor::OffStageSignal()
   return GetImplementation(*this).OffStageSignal();
 }
 
-Actor::Actor(Internal::Actor* internal)
-: Handle(internal)
+Actor::OnRelayoutSignalType& Actor::OnRelayoutSignal()
 {
+  return GetImplementation(*this).OnRelayoutSignal();
 }
 
-void UnparentAndReset( Actor& actor )
+Actor::Actor(Internal::Actor* internal)
+: Handle(internal)
 {
-  if( actor )
-  {
-    actor.Unparent();
-    actor.Reset();
-  }
 }
 
 } // namespace Dali