#define DALI_ACTOR_DEVEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// INTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/math/rect.h>
namespace Dali
{
-
namespace DevelActor
{
-
namespace Property
{
-
enum Type
{
- PARENT_ORIGIN = Dali::Actor::Property::PARENT_ORIGIN,
- PARENT_ORIGIN_X = Dali::Actor::Property::PARENT_ORIGIN_X,
- PARENT_ORIGIN_Y = Dali::Actor::Property::PARENT_ORIGIN_Y,
- PARENT_ORIGIN_Z = Dali::Actor::Property::PARENT_ORIGIN_Z,
- ANCHOR_POINT = Dali::Actor::Property::ANCHOR_POINT,
- ANCHOR_POINT_X = Dali::Actor::Property::ANCHOR_POINT_X,
- ANCHOR_POINT_Y = Dali::Actor::Property::ANCHOR_POINT_Y,
- ANCHOR_POINT_Z = Dali::Actor::Property::ANCHOR_POINT_Z,
- SIZE = Dali::Actor::Property::SIZE,
- SIZE_WIDTH = Dali::Actor::Property::SIZE_WIDTH,
- SIZE_HEIGHT = Dali::Actor::Property::SIZE_HEIGHT,
- SIZE_DEPTH = Dali::Actor::Property::SIZE_DEPTH,
- POSITION = Dali::Actor::Property::POSITION,
- POSITION_X = Dali::Actor::Property::POSITION_X,
- POSITION_Y = Dali::Actor::Property::POSITION_Y,
- POSITION_Z = Dali::Actor::Property::POSITION_Z,
- WORLD_POSITION = Dali::Actor::Property::WORLD_POSITION,
- WORLD_POSITION_X = Dali::Actor::Property::WORLD_POSITION_X,
- WORLD_POSITION_Y = Dali::Actor::Property::WORLD_POSITION_Y,
- WORLD_POSITION_Z = Dali::Actor::Property::WORLD_POSITION_Z,
- ORIENTATION = Dali::Actor::Property::ORIENTATION,
- WORLD_ORIENTATION = Dali::Actor::Property::WORLD_ORIENTATION,
- SCALE = Dali::Actor::Property::SCALE,
- SCALE_X = Dali::Actor::Property::SCALE_X,
- SCALE_Y = Dali::Actor::Property::SCALE_Y,
- SCALE_Z = Dali::Actor::Property::SCALE_Z,
- WORLD_SCALE = Dali::Actor::Property::WORLD_SCALE,
- VISIBLE = Dali::Actor::Property::VISIBLE,
- COLOR = Dali::Actor::Property::COLOR,
- COLOR_RED = Dali::Actor::Property::COLOR_RED,
- COLOR_GREEN = Dali::Actor::Property::COLOR_GREEN,
- COLOR_BLUE = Dali::Actor::Property::COLOR_BLUE,
- COLOR_ALPHA = Dali::Actor::Property::COLOR_ALPHA,
- WORLD_COLOR = Dali::Actor::Property::WORLD_COLOR,
- WORLD_MATRIX = Dali::Actor::Property::WORLD_MATRIX,
- NAME = Dali::Actor::Property::NAME,
- SENSITIVE = Dali::Actor::Property::SENSITIVE,
- LEAVE_REQUIRED = Dali::Actor::Property::LEAVE_REQUIRED,
- INHERIT_ORIENTATION = Dali::Actor::Property::INHERIT_ORIENTATION,
- INHERIT_SCALE = Dali::Actor::Property::INHERIT_SCALE,
- COLOR_MODE = Dali::Actor::Property::COLOR_MODE,
- POSITION_INHERITANCE = Dali::Actor::Property::POSITION_INHERITANCE,
- DRAW_MODE = Dali::Actor::Property::DRAW_MODE,
- SIZE_MODE_FACTOR = Dali::Actor::Property::SIZE_MODE_FACTOR,
- WIDTH_RESIZE_POLICY = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
- HEIGHT_RESIZE_POLICY = Dali::Actor::Property::HEIGHT_RESIZE_POLICY,
- SIZE_SCALE_POLICY = Dali::Actor::Property::SIZE_SCALE_POLICY,
- WIDTH_FOR_HEIGHT = Dali::Actor::Property::WIDTH_FOR_HEIGHT,
- HEIGHT_FOR_WIDTH = Dali::Actor::Property::HEIGHT_FOR_WIDTH,
- PADDING = Dali::Actor::Property::PADDING,
- MINIMUM_SIZE = Dali::Actor::Property::MINIMUM_SIZE,
- MAXIMUM_SIZE = Dali::Actor::Property::MAXIMUM_SIZE,
- INHERIT_POSITION = Dali::Actor::Property::INHERIT_POSITION,
- CLIPPING_MODE = Dali::Actor::Property::CLIPPING_MODE,
+ PARENT_ORIGIN = Dali::Actor::Property::PARENT_ORIGIN,
+ PARENT_ORIGIN_X = Dali::Actor::Property::PARENT_ORIGIN_X,
+ PARENT_ORIGIN_Y = Dali::Actor::Property::PARENT_ORIGIN_Y,
+ PARENT_ORIGIN_Z = Dali::Actor::Property::PARENT_ORIGIN_Z,
+ ANCHOR_POINT = Dali::Actor::Property::ANCHOR_POINT,
+ ANCHOR_POINT_X = Dali::Actor::Property::ANCHOR_POINT_X,
+ ANCHOR_POINT_Y = Dali::Actor::Property::ANCHOR_POINT_Y,
+ ANCHOR_POINT_Z = Dali::Actor::Property::ANCHOR_POINT_Z,
+ SIZE = Dali::Actor::Property::SIZE,
+ SIZE_WIDTH = Dali::Actor::Property::SIZE_WIDTH,
+ SIZE_HEIGHT = Dali::Actor::Property::SIZE_HEIGHT,
+ SIZE_DEPTH = Dali::Actor::Property::SIZE_DEPTH,
+ POSITION = Dali::Actor::Property::POSITION,
+ POSITION_X = Dali::Actor::Property::POSITION_X,
+ POSITION_Y = Dali::Actor::Property::POSITION_Y,
+ POSITION_Z = Dali::Actor::Property::POSITION_Z,
+ WORLD_POSITION = Dali::Actor::Property::WORLD_POSITION,
+ WORLD_POSITION_X = Dali::Actor::Property::WORLD_POSITION_X,
+ WORLD_POSITION_Y = Dali::Actor::Property::WORLD_POSITION_Y,
+ WORLD_POSITION_Z = Dali::Actor::Property::WORLD_POSITION_Z,
+ ORIENTATION = Dali::Actor::Property::ORIENTATION,
+ WORLD_ORIENTATION = Dali::Actor::Property::WORLD_ORIENTATION,
+ SCALE = Dali::Actor::Property::SCALE,
+ SCALE_X = Dali::Actor::Property::SCALE_X,
+ SCALE_Y = Dali::Actor::Property::SCALE_Y,
+ SCALE_Z = Dali::Actor::Property::SCALE_Z,
+ WORLD_SCALE = Dali::Actor::Property::WORLD_SCALE,
+ VISIBLE = Dali::Actor::Property::VISIBLE,
+ COLOR = Dali::Actor::Property::COLOR,
+ COLOR_RED = Dali::Actor::Property::COLOR_RED,
+ COLOR_GREEN = Dali::Actor::Property::COLOR_GREEN,
+ COLOR_BLUE = Dali::Actor::Property::COLOR_BLUE,
+ COLOR_ALPHA = Dali::Actor::Property::COLOR_ALPHA,
+ WORLD_COLOR = Dali::Actor::Property::WORLD_COLOR,
+ WORLD_MATRIX = Dali::Actor::Property::WORLD_MATRIX,
+ NAME = Dali::Actor::Property::NAME,
+ SENSITIVE = Dali::Actor::Property::SENSITIVE,
+ LEAVE_REQUIRED = Dali::Actor::Property::LEAVE_REQUIRED,
+ INHERIT_ORIENTATION = Dali::Actor::Property::INHERIT_ORIENTATION,
+ INHERIT_SCALE = Dali::Actor::Property::INHERIT_SCALE,
+ COLOR_MODE = Dali::Actor::Property::COLOR_MODE,
+ DRAW_MODE = Dali::Actor::Property::DRAW_MODE,
+ SIZE_MODE_FACTOR = Dali::Actor::Property::SIZE_MODE_FACTOR,
+ WIDTH_RESIZE_POLICY = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
+ HEIGHT_RESIZE_POLICY = Dali::Actor::Property::HEIGHT_RESIZE_POLICY,
+ SIZE_SCALE_POLICY = Dali::Actor::Property::SIZE_SCALE_POLICY,
+ WIDTH_FOR_HEIGHT = Dali::Actor::Property::WIDTH_FOR_HEIGHT,
+ HEIGHT_FOR_WIDTH = Dali::Actor::Property::HEIGHT_FOR_WIDTH,
+ PADDING = Dali::Actor::Property::PADDING,
+ MINIMUM_SIZE = Dali::Actor::Property::MINIMUM_SIZE,
+ MAXIMUM_SIZE = Dali::Actor::Property::MAXIMUM_SIZE,
+ INHERIT_POSITION = Dali::Actor::Property::INHERIT_POSITION,
+ CLIPPING_MODE = Dali::Actor::Property::CLIPPING_MODE,
+ LAYOUT_DIRECTION = Dali::Actor::Property::LAYOUT_DIRECTION,
+ INHERIT_LAYOUT_DIRECTION = Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION,
+ OPACITY = Dali::Actor::Property::OPACITY,
+ SCREEN_POSITION = Dali::Actor::Property::SCREEN_POSITION,
+ POSITION_USES_ANCHOR_POINT = Dali::Actor::Property::POSITION_USES_ANCHOR_POINT,
+ CULLED = Dali::Actor::Property::CULLED,
+ ID = Dali::Actor::Property::ID,
+ HIERARCHY_DEPTH = Dali::Actor::Property::HIERARCHY_DEPTH,
+ IS_ROOT = Dali::Actor::Property::IS_ROOT,
+ IS_LAYER = Dali::Actor::Property::IS_LAYER,
+ CONNECTED_TO_SCENE = Dali::Actor::Property::CONNECTED_TO_SCENE,
+ KEYBOARD_FOCUSABLE = Dali::Actor::Property::KEYBOARD_FOCUSABLE,
/**
* @brief Sets the sibling order of the actor so depth position can be defined within the same parent.
* @note Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the
* sibling order. The values set by this Property will likely change.
*/
- SIBLING_ORDER = CLIPPING_MODE + 1,
+ SIBLING_ORDER,
/**
- * @brief The opacity of the actor.
- * @details Name "opacity", type Property::FLOAT.
+ * @brief Sets the update size hint of the actor.
+ * @details Name "updateSizeHint", type Property::VECTOR2.
+ * @note Overrides the size used for the actor damaged area calculation. Affected by the actor model view matrix.
*/
- OPACITY = CLIPPING_MODE + 2,
+ UPDATE_SIZE_HINT,
/**
- * @brief Returns the screen position of the Actor
- * @details Name "screenPosition", type Property::VECTOR2. Read-only
- * @note This assumes default camera and default render-task and the Z position is ZERO.
- */
- SCREEN_POSITION = CLIPPING_MODE + 3,
+ * @brief If this actor receives a touch-start event, then all following touch events are sent to this actor until a touch-end.
+ * @details Name "captureAllTouchAfterStart", type Property::BOOLEAN
+ * @note Default is false, i.e. actor under touch event will receive the touch even if touch started on this actor
+ */
+ CAPTURE_ALL_TOUCH_AFTER_START,
+
+ /**
+ * @brief If you set the TOUCH_AREA_OFFSET on an actor, when you touch the actor, the touch area is expand from the size of actor.
+ * @details Name "touchAreaOffset", type Property::Rect<int> (left, right, bottom, top).
+ * For example
+ * @code{.cpp}
+ * Actor actor = Actor::New();
+ * actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+ * actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Rect<int>(-10, 20, 30, -40));
+ * actor.TouchedSignal().Connect(OnTouchCallback);
+ *
+ * +---------------------+
+ * | ^ |
+ * | | |
+ * | | -40 |
+ * | | |
+ * | | |
+ * | +----+----+ |
+ * | | | |
+ * | -10| | 20 |
+ * |<---+ +----->|
+ * | | | |
+ * | | | |
+ * | +----+----+ |
+ * | | |
+ * | | 30 |
+ * | | |
+ * | v |
+ * +---------------------+
+ * @endcode
+ * The actual touched size is actor.width + touchAreaOffset.right - touchAreaOffset.left and actor.height + touchAreaOffset.bottom - touchAreaOffset.top
+ */
+ TOUCH_AREA_OFFSET,
/**
- * @brief Determines whether the anchor point should be used to determine the position of the actor.
- * @details Name "positionUsesAnchorPoint", type Property::BOOLEAN.
- * @note This is true by default.
- * @note If false, then the top-left of the actor is used for the position.
- * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
+ * @brief Determines which blend equation will be used to render renderers of this actor.
+ * @pre To use Advanced Blend Equation(DevelBlendEquation::MULTIPLY ~ DevelBlendEquation::LUMINOSITY), the color to be rendered should be pre-multipled alpha.
+ * @details Name "blendEquation", type Property::INTEGER.
+ * @note Color of each renderer will be blended with rendering framebuffer.
+ * @note To check the blend equation is supported in the system, use Dali::Capabilities::IsBlendEquationSupported
*/
- POSITION_USES_ANCHOR_POINT = CLIPPING_MODE + 4,
+ BLEND_EQUATION,
/**
- * @brief The direction of layout.
- * @details Name "layoutDirection", type Property::STRING.
+ * @brief Sets whether this view can focus by touch. If user sets this to true, the actor will be focused when user touch it.
+ * @code
+ * Actor actor = Actor::New();
+ * actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true); // whether the view can have focus or not with keyboard navigation.
+ * actor.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true); // Whether the user can focus by touch, user can set focus by touching the actor.
+ * @endcode
+ * @details Name "touchFocusable", type Property::BOOLEAN.
*/
- LAYOUT_DIRECTION = CLIPPING_MODE + 5,
+ TOUCH_FOCUSABLE,
/**
- * @brief Determines whether child actors inherit the layout direction from a parent.
- * @details Name "layoutDirectionInheritance", type Property::BOOLEAN.
+ * @brief Whether the children of this actor can be focusable by keyboard navigation. If user sets this to false, the children of this actor will not be focused.
+ * @details Name "keyboardFocusableChildren", type Property::BOOLEAN.
+ * @note Default value is true.
*/
- LAYOUT_DIRECTION_INHERITANCE = CLIPPING_MODE + 6
+ KEYBOARD_FOCUSABLE_CHILDREN,
+
+ /**
+ * @brief The flag whether the actor should be enabled all user interaction including touch, focus and activation. this value have higher priority over the sensitve and focusable in negative action.
+ * @details Name "userInteractionEnabled", type Property::BOOLEAN.
+ * @note Default value is true.
+ */
+ USER_INTERACTION_ENABLED,
};
} // namespace Property
namespace VisibilityChange
{
-
enum Type
{
- SELF, ///< The visibility of the actor itself has changed.
- PARENT ///< The visibility of a parent has changed.
+ SELF, ///< The visibility of the actor itself has changed.
+ PARENT ///< The visibility of a parent has changed.
};
} // namespace VisibilityChange
-namespace LayoutDirection
-{
+using VisibilityChangedSignalType = Signal<void(Actor, bool, VisibilityChange::Type)>; ///< Signal type of VisibilityChangedSignalType
-enum Type
-{
- LTR, ///< Left to Right direction (Default).
- RTL ///< Right to Left direction.
-};
+/**
+ * @brief This signal is emitted when the visible property of this or a parent actor is changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Actor actor, bool visible, VisibilityChange::Type& type );
+ * @endcode
+ * actor: The actor, or child of actor, whose visibility has changed
+ * visible: Whether the actor is now visible or not
+ * type: Whether the actor's visible property has changed or a parent's.
+ * @return The signal to connect to
+ * @pre The Actor has been initialized.
+ * @note This signal is NOT emitted if the actor becomes transparent (or the reverse), it's only linked with Actor::Property::VISIBLE.
+ */
+DALI_CORE_API VisibilityChangedSignalType& VisibilityChangedSignal(Actor actor);
-} // namespace
+/**
+ * Calculates screen position and size.
+ *
+ * @return pair of two values, position of top-left corner on screen and size respectively.
+ */
+DALI_CORE_API Rect<> CalculateScreenExtents(Actor actor);
-typedef Signal< void ( Actor, bool, VisibilityChange::Type ) > VisibilityChangedSignalType; ///< Signal type of VisibilityChangedSignal
+using ChildChangedSignalType = Signal<void(Actor)>; ///< Called when the actor has a child added or removed
/**
- * @brief Raise actor above the next highest level of actor(s).
+ * @brief This signal is emitted when a child is added to this actor.
*
- * @param[in] actor The Actor to raise
- * @note Sibling order of actors within the parent will be updated automatically.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Initially actors added to a parent will have the same sibling order and shown in relation to insertion order.
- * Raising this actor above actors with the same sibling order as each other will raise this actor above them.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * A callback of the following type may be connected:
+ * @code
+ * void MyCallbackName( Actor child );
+ * @endcode
+ * child: The child that has been added.
*
+ * @note Use this signal with caution. Changing the parent of the actor
+ * within this callback is possible, but DALi will prevent further signals
+ * being sent.
+ *
+ * @return The signal to connect to
+ * @pre The Actor has been initialized
*/
-DALI_IMPORT_API void Raise( Actor actor );
+DALI_CORE_API ChildChangedSignalType& ChildAddedSignal(Actor actor);
/**
- * @brief Lower the actor to underneath the level below actor(s).
+ * @brief This signal is emitted when a child is removed from this actor.
*
- * @param[in] actor The Actor to lower
- * @note Sibling order of actors within the parent will be updated automatically.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Lowering this actor below actors with the same sibling order as each other will lower this actor above them.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * A callback of the following type may be connected:
+ * @code
+ * void MyCallbackName( Actor child );
+ * @endcode
+ * child: The child that has been removed.
+ *
+ * @note Use this signal with caution. Changing the parent of the actor
+ * within this callback is possible, but DALi will prevent further signals
+ * being sent.
+ *
+ * @note If the child actor is moved from one actor to another, then
+ * this signal will be emitted followed immediately by an
+ * ChildAddedSignal() on the new parent.
+ *
+ * @return The signal to connect to
+ * @pre The Actor has been initialized
*/
-DALI_IMPORT_API void Lower( Actor actor );
+DALI_CORE_API ChildChangedSignalType& ChildRemovedSignal(Actor actor);
+
+using ChildOrderChangedSignalType = Signal<void(Actor)>; ///< Used when the actor's children have changed order
/**
- * @brief Raise actor above all other actors.
+ * @brief This signal is emitted when an actor's children change their sibling order
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void MyCallbackName( Actor parent );
+ * @endcode
+ * parent The parent actor of the moved children
*
- * @param[in] actor The Actor to raise to the top
- * @note Sibling order of actors within the parent will be updated automatically.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * @return The signal to connect to
+ * @pre The Actor has been initialized
*/
-DALI_IMPORT_API void RaiseToTop( Actor actor );
+DALI_CORE_API ChildOrderChangedSignalType& ChildOrderChangedSignal(Actor actor);
/**
- * @brief Lower actor to the bottom of all actors.
+ * @brief This signal is emitted when intercepting the actor's touch event.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void MyCallbackName( Actor actor );
+ * @endcode
+ * actor The actor to intercept
+ *
+ * @note TouchEvent callbacks are called from the last child in the order of the parent's actor.
+ * The InterceptTouchEvent callback is to intercept the touch event in the parent.
+ * So, if the parent interepts the touch event, the child cannot receive the touch event.
+ *
+ * @note example
+ * Actor parent = Actor::New();
+ * Actor child = Actor::New();
+ * parent.Add(child);
+ * child.TouchedSignal().Connect(&application, childFunctor);
+ * parent.TouchedSignal().Connect(&application, parentFunctor);
+ * The touch event callbacks are called in the order childFunctor -> parentFunctor.
+ *
+ * If you connect interceptTouchSignal to parentActor.
+ * Dali::DevelActor::InterceptTouchedSignal(parent).Connect(&application, interceptFunctor);
*
- * @param[in] actor The Actor to lower to the bottom
- * @note Sibling order of actors within the parent will be updated automatically.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * When interceptFunctor returns false, the touch event callbacks are called in the same order childFunctor -> parentFunctor.
+ * If interceptFunctor returns true, it means that the TouchEvent was intercepted.
+ * So the child actor will not be able to receive touch events.
+ * Only the parentFunctor is called.
+ *
+ * @return The signal to connect to
+ * @pre The Actor has been initialized
*/
-DALI_IMPORT_API void LowerToBottom( Actor actor );
+DALI_CORE_API Actor::TouchEventSignalType& InterceptTouchedSignal(Actor actor);
/**
- * @brief Raise the actor to above the target actor.
- *
- * @param[in] actor The actor to raise
- * @param[in] target Will be raised above this actor
- * @note Sibling order of actors within the parent will be updated automatically.
- * Actors on the level above the target actor will still be shown above this actor.
- * Raising this actor above actors with the same sibling order as each other will raise this actor above them.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * @brief This is used when the parent actor wants to listen to gesture events.
+ *
+ * @note example The child is overlapped on the parent.
+ * Currently, if you tap a child, the parent cannot listen to the tap event.
+ * Now, If set to SetNeedGesturePropagation(true), the parent can receive gesture events.
+ * Please call this setting inside a gesture callback, it will be reset after the gesture callback is called.
+ * @code
+ * {
+ * Actor parent = Actor::New();
+ * Actor child = Actor::New();
+ * parent.Add(child);
+ * parentTapDetector = TapGestureDetector::New();
+ * childTapDetector = TapGestureDetector::New();
+ * parentTapDetector.Attach(parent);
+ * childTapDetector.Attach(child);
+ * parentTapDetector.DetectedSignal().Connect(this, &OnParentTap);
+ * childTapDetector.DetectedSignal().Connect(this, &OnChildTap);
+ * }
+ * void OnChildTap(Dali::Actor actor, const Dali::TapGesture& tap)
+ * {
+ * // If you set SetNeedGesturePropagation to true here, the parent actor can also listen to events
+ * Dali::DevelActor::SetNeedGesturePropagation(Self(), true);
+ * }
+ * @endcode
+ *
*/
-DALI_IMPORT_API void RaiseAbove( Actor actor, Dali::Actor target );
+DALI_CORE_API void SetNeedGesturePropagation(Actor actor, bool propagation);
/**
- * @brief Lower the actor to below the target actor.
- *
- * @param[in] actor The Actor to lower
- * @param[in] target Will be lowered below this actor
- * @note Sibling order of actors within the parent will be updated automatically.
- * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
- * Lowering this actor below actors with the same sibling order as each other will lower this actor above them.
- * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
+ * Switch parent in the same tree.
+ * This method changes the actor's parent with keeping on scene state.
+ * Both of current parent Actor and new parent Actor must already be added on Scene.
+ * This method don't emit notification about add/remove and on/off scene.
+ * @param [in] actor This actor
+ * @param [in] newParent An actor to be a new parent of this actor.
*/
-DALI_IMPORT_API void LowerBelow( Actor actor, Dali::Actor target );
+DALI_CORE_API void SwitchParent(Actor actor, Actor newParent);
/**
- * @brief This signal is emitted when the visible property of this or a parent actor is changed.
+ * @brief This signal is emitted when an actor is hit through hit-test.
*
* A callback of the following type may be connected:
* @code
- * void YourCallbackName( Actor actor, bool visible, VisibilityChange::Type& type );
+ * void MyCallbackName( Actor actor );
* @endcode
- * actor: The actor, or child of actor, whose visibility has changed
- * visible: Whether the actor is now visible or not
- * type: Whether the actor's visible property has changed or a parent's.
+ * actor The actor to intercept
+ *
+ * @note This callback is called when the actor is hit.
+ * If true is returned, TouchEvent is called from the this actor.
+ * If false is returned, the hit test starts again from the next lower actor.
+ *
+ * @note example
+ * Actor topActor = Actor::New();
+ * Actor bottomActor = Actor::New();
+ * topActor.TouchedSignal().Connect(&application, topActorFunctor);
+ * bottomActor.TouchedSignal().Connect(&application, bottomActorFunctor);
+ * The two actors have no relationship.
+ * So when the topActor is touched, the event cannot be propagated to the bottomActor.
+ *
+ * If you connect HitTestResultSignal to topActor.
+ * Dali::DevelActor::HitTestResultSignal(topActor).Connect(&application, hitTestResultFunctor);
+ *
+ * If the hitTestResult Functor returns false, it passes the hit-test and starts the hit-test again from the next lower actor.
+ * So the bottomActor can be hit and receive touch events.
+ * If hitTestResult returns true, it means that it has been hit. So it receives a TouchEvent from itself.
+ *
* @return The signal to connect to
- * @pre The Actor has been initialized.
- * @note This signal is NOT emitted if the actor becomes transparent (or the reverse), it's only linked with Actor::Property::VISIBLE.
+ * @pre The Actor has been initialized
*/
-DALI_IMPORT_API VisibilityChangedSignalType& VisibilityChangedSignal( Actor actor );
+DALI_CORE_API Actor::TouchEventSignalType& HitTestResultSignal(Actor actor);
} // namespace DevelActor