/*
- * 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.
#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/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
{
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
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);
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);
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);
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();
return GetImplementation(*this).HoveredSignal();
}
-Actor::MouseWheelEventSignalType& Actor::MouseWheelEventSignal()
+Actor::WheelEventSignalType& Actor::WheelEventSignal()
{
- return GetImplementation(*this).MouseWheelEventSignal();
+ return GetImplementation(*this).WheelEventSignal();
}
Actor::OnStageSignalType& Actor::OnStageSignal()
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