X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Factor.h;h=c5632d576ccaa0f7b365e1404896fd2da58d356a;hb=334442ab65c242cf6da1435749a5c5c5bb69f592;hp=248225a198efe505d97a752c938615ad5fd4d4e9;hpb=3b40105fa98689b9356125ffa3da85c85d07bc71;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index 248225a..3c06e53 100644 --- a/dali/public-api/actors/actor.h +++ b/dali/public-api/actors/actor.h @@ -1,8 +1,8 @@ -#ifndef __DALI_ACTOR_H__ -#define __DALI_ACTOR_H__ +#ifndef DALI_ACTOR_H +#define DALI_ACTOR_H /* - * 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. @@ -19,19 +19,22 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES -#include -#include #include #include +#include #include +#include #include namespace Dali { +/** + * @addtogroup dali_core_actors + * @{ + */ namespace Internal DALI_INTERNAL { @@ -39,31 +42,20 @@ class Actor; } class Actor; -class Animation; -class Constraint; +class Renderer; struct Degree; -class DynamicsBody; -class DynamicsBodyConfig; -class DynamicsJoint; class Quaternion; class Layer; -struct Radian; struct KeyEvent; +class TouchData; struct TouchEvent; struct HoverEvent; -struct MouseWheelEvent; +struct WheelEvent; struct Vector2; struct Vector3; struct Vector4; -/** - * @brief Actor container. - */ -typedef std::vector ActorContainer; -typedef ActorContainer::iterator ActorIter; ///< Iterator for Dali::ActorContainer -typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for Dali::ActorContainer - - +typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 /** * @brief Actor is the primary object with which Dali applications interact. @@ -85,6 +77,10 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * * Hit Test Algorithm: * + * - Stage + * - Gets the first down and the last up touch events to the screen, regardless of actor touch event consumption. + * - Stage's root layer can be used to catch unconsumed touch events. + * * - RenderTasks * - Hit testing is dependent on the camera used, which is specific to each RenderTask. * @@ -104,11 +100,12 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * { * // Only hit-test the actor and its children if it is sensitive and visible * IF ( ACTOR-IS-SENSITIVE && - * ACTOR-IS-VISIBLE ) + * ACTOR-IS-VISIBLE && + * ACTOR-IS-ON-STAGE ) * { * // Depth-first traversal within current layer, visiting parent first * - * // Check whether current actor should be hit-tested + * // Check whether current actor should be hit-tested. * IF ( ( TOUCH-SIGNAL-NOT-EMPTY || HOVER-SIGNAL-NOT-EMPTY ) && * ACTOR-HAS-NON-ZERO-SIZE && * ACTOR-WORLD-COLOR-IS-NOT-TRANSPARENT ) @@ -118,13 +115,13 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * { * IF ( ACTOR-IS-OVERLAY || ( DISTANCE-TO-ACTOR < DISTANCE-TO-LAST-HIT-ACTOR ) ) * { - * // The current actor is the closest actor that was underneath the touch + * // The current actor is the closest actor that was underneath the touch. * LAST-HIT-ACTOR = CURRENT-ACTOR * } * } * } * - * // Keep checking children, in case we hit something closer + * // Keep checking children, in case we hit something closer. * FOR-EACH CHILD (in order) * { * IF ( CHILD-IS-NOT-A-LAYER ) @@ -132,7 +129,7 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * // Continue traversal for this child's sub-tree * HIT-TEST-WITHIN-LAYER ( CHILD ) * } - * // else we skip hit-testing the child's sub-tree altogether + * // else we skip hit-testing the child's sub-tree altogether. * } * } * } @@ -151,13 +148,7 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * * Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest. * @endcode - * - Stencil Actors can be used to influence the result of hits on renderable actors within a layer. - * If a Stencil Actor exists on a layer and that Actor is marked visible then a successful - * hit on a renderable actor can only take place in the area that the stencil Actor marks as visible. - * The hit can be in any Stencil Actor in that layer, but must be in the region of one of them. - * Stencil Actor inheritance behaves as with rendering in that any child of a Stencil Actor will - * also be considered a Stencil Actor. - * Non-renderable actors can be hit regardless of whether a stencil actor is hit or not. + * For more information, see SetDrawMode(). * * Touch or hover Event Delivery: * @@ -194,7 +185,7 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * * IF ( NOT-CONSUMED ) * { - * // If event is not consumed then deliver it to the parent unless we reach the root actor + * // If event is not consumed then deliver it to the parent unless we reach the root actor. * IF ( ACTOR-PARENT ) * { * EMIT-HOVER-SIGNAL( ACTOR-PARENT ) @@ -222,6 +213,7 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * touch signals are also emitted from the touch-down actor with an "Interrupted" state. * - If the consumed actor on hover-start is not the same as the consumed actor on hover-finished, then * hover signals are also emitted from the hover-started actor with an "Interrupted" state. + * *

Key Events:

* * Key events are received by an actor once set to grab key events, only one actor can be set as focused. @@ -233,98 +225,123 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * |-------------------|------------------------------| * | touched | @ref TouchedSignal() | * | hovered | @ref HoveredSignal() | - * | mouse-wheel-event | @ref MouseWheelEventSignal() | - * | on-stage | @ref OnStageSignal() | - * | off-stage | @ref OffStageSignal() | + * | wheelEvent | @ref WheelEventSignal() | + * | onStage | @ref OnStageSignal() | + * | offStage | @ref OffStageSignal() | + * | onRelayout | @ref OnRelayoutSignal() | * * Actions * | %Action Name | %Actor method called | * |-------------------|------------------------------| * | show | %SetVisible( true ) | * | hide | %SetVisible( false ) | + * @SINCE_1_0.0 */ + class DALI_IMPORT_API Actor : public Handle { public: + /** + * @brief An enumeration of properties belonging to the Actor class. + * @SINCE_1_0.0 + */ + struct Property + { + enum + { + PARENT_ORIGIN = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parentOrigin", type Vector3 (constraint-input) @SINCE_1_0.0 + PARENT_ORIGIN_X, ///< name "parentOriginX", type float (constraint-input) @SINCE_1_0.0 + PARENT_ORIGIN_Y, ///< name "parentOriginY", type float (constraint-input) @SINCE_1_0.0 + PARENT_ORIGIN_Z, ///< name "parentOriginZ", type float (constraint-input) @SINCE_1_0.0 + ANCHOR_POINT, ///< name "anchorPoint", type Vector3 (constraint-input) @SINCE_1_0.0 + ANCHOR_POINT_X, ///< name "anchorPointX", type float (constraint-input) @SINCE_1_0.0 + ANCHOR_POINT_Y, ///< name "anchorPointY", type float (constraint-input) @SINCE_1_0.0 + ANCHOR_POINT_Z, ///< name "anchorPointZ", type float (constraint-input) @SINCE_1_0.0 + SIZE, ///< name "size", type Vector3 (animatable / constraint-input) @SINCE_1_0.0 + SIZE_WIDTH, ///< name "sizeWidth", type float (animatable / constraint-input) @SINCE_1_0.0 + SIZE_HEIGHT, ///< name "sizeHeight", type float (animatable / constraint-input) @SINCE_1_0.0 + SIZE_DEPTH, ///< name "sizeDepth", type float (animatable / constraint-input) @SINCE_1_0.0 + POSITION, ///< name "position", type Vector3 (animatable / constraint-input) @SINCE_1_0.0 + POSITION_X, ///< name "positionX", type float (animatable / constraint-input) @SINCE_1_0.0 + POSITION_Y, ///< name "positionY", type float (animatable / constraint-input) @SINCE_1_0.0 + POSITION_Z, ///< name "positionZ", type float (animatable / constraint-input) @SINCE_1_0.0 + WORLD_POSITION, ///< name "worldPosition", type Vector3 (read-only / constraint-input) @SINCE_1_0.0 + WORLD_POSITION_X, ///< name "worldPositionX", type float (read-only / constraint-input) @SINCE_1_0.0 + WORLD_POSITION_Y, ///< name "worldPositionY", type float (read-only / constraint-input) @SINCE_1_0.0 + WORLD_POSITION_Z, ///< name "worldPositionZ", type float (read-only / constraint-input) @SINCE_1_0.0 + ORIENTATION, ///< name "orientation", type Quaternion (animatable / constraint-input) @SINCE_1_0.0 + WORLD_ORIENTATION, ///< name "worldOrientation", type Quaternion (read-only / constraint-input) @SINCE_1_0.0 + SCALE, ///< name "scale", type Vector3 (animatable / constraint-input) @SINCE_1_0.0 + SCALE_X, ///< name "scaleX", type float (animatable / constraint-input) @SINCE_1_0.0 + SCALE_Y, ///< name "scaleY", type float (animatable / constraint-input) @SINCE_1_0.0 + SCALE_Z, ///< name "scaleZ", type float (animatable / constraint-input) @SINCE_1_0.0 + WORLD_SCALE, ///< name "worldScale", type Vector3 (read-only / constraint-input) @SINCE_1_0.0 + VISIBLE, ///< name "visible", type bool (animatable / constraint-input) @SINCE_1_0.0 + COLOR, ///< name "color", type Vector4 (animatable / constraint-input) @SINCE_1_0.0 + COLOR_RED, ///< name "colorRed", type float (animatable / constraint-input) @SINCE_1_0.0 + COLOR_GREEN, ///< name "colorGreen", type float (animatable / constraint-input) @SINCE_1_0.0 + COLOR_BLUE, ///< name "colorBlue", type float (animatable / constraint-input) @SINCE_1_0.0 + COLOR_ALPHA, ///< name "colorAlpha", type float (animatable / constraint-input) @SINCE_1_0.0 + WORLD_COLOR, ///< name "worldColor", type Vector4 (read-only / constraint-input) @SINCE_1_0.0 + WORLD_MATRIX, ///< name "worldMatrix", type Matrix (read-only / constraint-input) @SINCE_1_0.0 + NAME, ///< name "name", type std::string @SINCE_1_0.0 + SENSITIVE, ///< name "sensitive", type bool @SINCE_1_0.0 + LEAVE_REQUIRED, ///< name "leaveRequired", type bool @SINCE_1_0.0 + INHERIT_ORIENTATION, ///< name "inheritOrientation", type bool @SINCE_1_0.0 + INHERIT_SCALE, ///< name "inheritScale", type bool @SINCE_1_0.0 + COLOR_MODE, ///< name "colorMode", type std::string @SINCE_1_0.0 + POSITION_INHERITANCE, ///< name "positionInheritance", type std::string @DEPRECATED_1_1.24 Use INHERIT_POSITION instead + DRAW_MODE, ///< name "drawMode", type std::string @SINCE_1_0.0 + SIZE_MODE_FACTOR, ///< name "sizeModeFactor", type Vector3 @SINCE_1_0.0 + WIDTH_RESIZE_POLICY, ///< name "widthResizePolicy", type String @SINCE_1_0.0 + HEIGHT_RESIZE_POLICY, ///< name "heightResizePolicy", type String @SINCE_1_0.0 + SIZE_SCALE_POLICY, ///< name "sizeScalePolicy", type String @SINCE_1_0.0 + WIDTH_FOR_HEIGHT, ///< name "widthForHeight", type bool @SINCE_1_0.0 + HEIGHT_FOR_WIDTH, ///< name "heightForWidth", type bool @SINCE_1_0.0 + PADDING, ///< name "padding", type Vector4 @SINCE_1_0.0 + MINIMUM_SIZE, ///< name "minimumSize", type Vector2 @SINCE_1_0.0 + MAXIMUM_SIZE, ///< name "maximumSize", type Vector2 @SINCE_1_0.0 + INHERIT_POSITION, ///< name "inheritPosition", type bool @SINCE_1_1.24 + CLIPPING_MODE, ///< name "clippingMode", type String @SINCE_1_2_5 + }; + }; + // Typedefs - typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType; ///< Touch signal type - typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType; ///< Hover signal type - typedef Signal< bool (Actor, const MouseWheelEvent&) > MouseWheelEventSignalType;///< Mousewheel signal type - typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type - typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type - - /// @name Properties - /** @{ */ - static const Property::Index PARENT_ORIGIN; ///< name "parent-origin", type VECTOR3 - static const Property::Index PARENT_ORIGIN_X; ///< name "parent-origin-x", type FLOAT - static const Property::Index PARENT_ORIGIN_Y; ///< name "parent-origin-y", type FLOAT - static const Property::Index PARENT_ORIGIN_Z; ///< name "parent-origin-z", type FLOAT - static const Property::Index ANCHOR_POINT; ///< name "anchor-point", type VECTOR3 - static const Property::Index ANCHOR_POINT_X; ///< name "anchor-point-x", type FLOAT - static const Property::Index ANCHOR_POINT_Y; ///< name "anchor-point-y", type FLOAT - static const Property::Index ANCHOR_POINT_Z; ///< name "anchor-point-z", type FLOAT - static const Property::Index SIZE; ///< name "size", type VECTOR3 - static const Property::Index SIZE_WIDTH; ///< name "size-width", type FLOAT - static const Property::Index SIZE_HEIGHT; ///< name "size-height", type FLOAT - static const Property::Index SIZE_DEPTH; ///< name "size-depth", type FLOAT - static const Property::Index POSITION; ///< name "position", type VECTOR3 - static const Property::Index POSITION_X; ///< name "position-x", type FLOAT - static const Property::Index POSITION_Y; ///< name "position-y", type FLOAT - static const Property::Index POSITION_Z; ///< name "position-z", type FLOAT - static const Property::Index WORLD_POSITION; ///< name "world-position", type VECTOR3 (read-only) - static const Property::Index WORLD_POSITION_X; ///< name "world-position-x", type FLOAT (read-only) - static const Property::Index WORLD_POSITION_Y; ///< name "world-position-y", type FLOAT (read-only) - static const Property::Index WORLD_POSITION_Z; ///< name "world-position-z", type FLOAT (read-only) - static const Property::Index ROTATION; ///< name "rotation", type ROTATION - static const Property::Index WORLD_ROTATION; ///< name "world-rotation", type ROTATION (read-only) - static const Property::Index SCALE; ///< name "scale", type VECTOR3 - static const Property::Index SCALE_X; ///< name "scale-x", type FLOAT - static const Property::Index SCALE_Y; ///< name "scale-y", type FLOAT - static const Property::Index SCALE_Z; ///< name "scale-z", type FLOAT - static const Property::Index WORLD_SCALE; ///< name "world-scale", type VECTOR3 (read-only) - static const Property::Index VISIBLE; ///< name "visible", type BOOLEAN - static const Property::Index COLOR; ///< name "color", type VECTOR4 - static const Property::Index COLOR_RED; ///< name "color-red", type FLOAT - static const Property::Index COLOR_GREEN; ///< name "color-green", type FLOAT - static const Property::Index COLOR_BLUE; ///< name "color-blue", type FLOAT - static const Property::Index COLOR_ALPHA; ///< name "color-alpha", type FLOAT - static const Property::Index WORLD_COLOR; ///< name "world-color", type VECTOR4 (read-only) - static const Property::Index WORLD_MATRIX; ///< name "world-matrix", type MATRIX (read-only) - static const Property::Index NAME; ///< name "name", type STRING - static const Property::Index SENSITIVE; ///< name "sensitive", type BOOLEAN - static const Property::Index LEAVE_REQUIRED; ///< name "leave-required", type BOOLEAN - static const Property::Index INHERIT_ROTATION; ///< name "inherit-rotation", type BOOLEAN - static const Property::Index INHERIT_SCALE; ///< name "inherit-scale", type BOOLEAN - static const Property::Index COLOR_MODE; ///< name "color-mode", type STRING - static const Property::Index POSITION_INHERITANCE; ///< name "position-inheritance", type STRING - static const Property::Index DRAW_MODE; ///< name "draw-mode", type STRING - static const Property::Index SIZE_MODE; ///< name "size-mode", type STRING - static const Property::Index SIZE_MODE_FACTOR; ///< name "size-mode-factor", type VECTOR3 - /** @} */ + + typedef Signal< bool (Actor, const TouchEvent&) > TouchSignalType; ///< @DEPRECATED_1_1.37 @brief Touch signal type @SINCE_1_0.0 + typedef Signal< bool (Actor, const TouchData&) > TouchDataSignalType; ///< Touch signal type @SINCE_1_1.37 + typedef Signal< bool (Actor, const HoverEvent&) > HoverSignalType; ///< Hover signal type @SINCE_1_0.0 + typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType; ///< Wheel signal type @SINCE_1_0.0 + typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type @SINCE_1_0.0 + typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type @SINCE_1_0.0 + typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out @SINCE_1_0.0 // Creation /** * @brief Create an uninitialized Actor; this can be initialized with Actor::New(). * - * Calling member functions with an uninitialized Dali::Object is not allowed. + * Calling member functions with an uninitialized Actor handle is not allowed. + * @SINCE_1_0.0 */ Actor(); /** * @brief Create an initialized Actor. * + * @SINCE_1_0.0 * @return A handle to a newly allocated Dali resource. */ static Actor New(); /** - * @brief Downcast an Object handle to Actor handle. + * @brief Downcast a handle to Actor handle. * * If handle points to a Actor object the downcast produces valid * handle. If not the returned handle is left uninitialized. * + * @SINCE_1_0.0 * @param[in] handle to An object * @return handle to a Actor object or an uninitialized handle */ @@ -334,12 +351,14 @@ public: * @brief Dali::Actor is intended as a base class * * This is non-virtual since derived Handle types must not contain data or virtual methods. + * @SINCE_1_0.0 */ ~Actor(); /** * @brief Copy constructor * + * @SINCE_1_0.0 * @param [in] copy The actor to copy. */ Actor(const Actor& copy); @@ -347,31 +366,36 @@ public: /** * @brief Assignment operator * + * @SINCE_1_0.0 * @param [in] rhs The actor to copy. + * @return A reference to this */ Actor& operator=(const Actor& rhs); /** * @brief Retrieve the Actor's name. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The Actor's name. + * @pre The Actor has been initialized. */ const std::string& GetName() const; /** * @brief Sets the Actor's name. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param [in] name The new name. + * @pre The Actor has been initialized. */ void SetName(const std::string& name); /** * @brief Retrieve the unique ID of the actor. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The ID. + * @pre The Actor has been initialized. */ unsigned int GetId() const; @@ -380,8 +404,9 @@ public: /** * @brief Query whether an actor is the root actor, which is owned by the Stage. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return True if the actor is the root actor. + * @pre The Actor has been initialized. */ bool IsRoot() const; @@ -389,72 +414,56 @@ public: * @brief Query whether the actor is connected to the Stage. * * When an actor is connected, it will be directly or indirectly parented to the root Actor. - * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return True if the actor is connected to the Stage. + * @pre The Actor has been initialized. + * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected. */ bool OnStage() const; /** * @brief Query whether the actor is of class Dali::Layer. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return True if the actor is a layer. + * @pre The Actor has been initialized. */ bool IsLayer() const; /** * @brief Gets the layer in which the actor is present. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The layer, which will be uninitialized if the actor is off-stage. + * @pre The Actor has been initialized. */ Layer GetLayer(); /** * @brief Adds a child Actor to this Actor. * - * NOTE! if the child already has a parent, it will be removed from old parent - * and reparented to this actor. This may change childs position, color, - * scale etc as it now inherits them from this actor - * @pre This Actor (the parent) has been initialized. - * @pre The child actor has been initialized. - * @pre The child actor is not the same as the parent actor. - * @pre The actor is not the Root actor + * @SINCE_1_0.0 * @param [in] child The child. - * @post The child will be referenced by its parent. This means that the child will be kept alive, - * even if the handle passed into this method is reset or destroyed. - * @post This may invalidate ActorContainer iterators. - */ - void Add(Actor child); - - /** - * @brief Inserts a child Actor to this actor's list of children at the given index - * - * NOTE! if the child already has a parent, it will be removed from old parent - * and reparented to this actor. This may change childs position, color, - * scale etc as it now inherits them from this actor * @pre This Actor (the parent) has been initialized. * @pre The child actor has been initialized. * @pre The child actor is not the same as the parent actor. - * @pre The actor is not the Root actor - * @param [in] index of actor to insert before - * @param [in] child The child. + * @pre The actor is not the Root actor. * @post The child will be referenced by its parent. This means that the child will be kept alive, * even if the handle passed into this method is reset or destroyed. - * @post If the index is greater than the current child count, it will be ignored and added at the end. - * @post This may invalidate ActorContainer iterators. + * @note if the child already has a parent, it will be removed from old parent + * and reparented to this actor. This may change childs position, color, + * scale etc as it now inherits them from this actor. */ - void Insert(unsigned int index, Actor child); + void Add(Actor child); /** * @brief Removes a child Actor from this Actor. * * If the actor was not a child of this actor, this is a no-op. + * @SINCE_1_0.0 + * @param [in] child The child. * @pre This Actor (the parent) has been initialized. * @pre The child actor is not the same as the parent actor. - * @param [in] child The child. - * @post This may invalidate ActorContainer iterators. */ void Remove(Actor child); @@ -462,65 +471,58 @@ public: * @brief Removes an actor from its parent. * * If the actor has no parent, this method does nothing. + * @SINCE_1_0.0 * @pre The (child) actor has been initialized. - * @post This may invalidate ActorContainer iterators. */ void Unparent(); /** * @brief Retrieve the number of children held by the actor. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The number of children + * @pre The Actor has been initialized. */ unsigned int GetChildCount() const; /** * @brief Retrieve and child actor by index. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param[in] index The index of the child to retrieve * @return The actor for the given index or empty handle if children not initialised + * @pre The Actor has been initialized. */ Actor GetChildAt(unsigned int index) const; /** * @brief Search through this actor's hierarchy for an actor with the given name. * - * The actor itself is also considered in the search - * @pre The Actor has been initialized. + * The actor itself is also considered in the search. + * @SINCE_1_0.0 * @param[in] actorName the name of the actor to find * @return A handle to the actor if found, or an empty handle if not. - */ - Actor FindChildByName(const std::string& actorName); - - /** - * @brief Search through this actor's hierarchy for an actor with the given name or alias. - * - * Actors can customize this function to provide actors with preferred alias' - * For example 'previous' could return the last selected child. - * If no aliased actor is found then FindChildByName() is called. * @pre The Actor has been initialized. - * @param[in] actorAlias the name of the actor to find - * @return A handle to the actor if found, or an empty handle if not. */ - Actor FindChildByAlias(const std::string& actorAlias); + Actor FindChildByName(const std::string& actorName); /** * @brief Search through this actor's hierarchy for an actor with the given unique ID. * - * The actor itself is also considered in the search - * @pre The Actor has been initialized. + * The actor itself is also considered in the search. + * @SINCE_1_0.0 * @param[in] id the ID of the actor to find * @return A handle to the actor if found, or an empty handle if not. + * @pre The Actor has been initialized. */ Actor FindChildById(const unsigned int id); /** * @brief Retrieve the actor's parent. * - * @pre The actor has been initialized. + * @SINCE_1_0.0 * @return A handle to the actor's parent. If the actor has no parent, this handle will be invalid. + * @pre The actor has been initialized. */ Actor GetParent() const; @@ -533,19 +535,21 @@ public: * and (1.0, 1.0, 0.5) is the bottom-right corner. * The default parent-origin is Dali::ParentOrigin::TOP_LEFT (0.0, 0.0, 0.5). * An actor position is the distance between this origin, and the actors anchor-point. - * @see Dali::ParentOrigin for predefined parent origin values + * @SINCE_1_0.0 + * @param [in] origin The new parent-origin. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentParentOrigin(). - * @param [in] origin The new parent-origin. + * @see Dali::ParentOrigin for predefined parent origin values */ void SetParentOrigin(const Vector3& origin); /** * @brief Retrieve the parent-origin of an actor. * + * @SINCE_1_0.0 + * @return The current parent-origin. * @pre The Actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetParentOrigin(). - * @return The current parent-origin. */ Vector3 GetCurrentParentOrigin() const; @@ -557,20 +561,22 @@ public: * bottom-right corner. The default anchor point is * Dali::AnchorPoint::CENTER (0.5, 0.5, 0.5). * An actor position is the distance between its parent-origin, and this anchor-point. - * An actor's rotation is centered around its anchor-point. - * @see Dali::AnchorPoint for predefined anchor point values + * An actor's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point. + * @SINCE_1_0.0 + * @param [in] anchorPoint The new anchor-point. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentAnchorPoint(). - * @param [in] anchorPoint The new anchor-point. + * @see Dali::AnchorPoint for predefined anchor point values */ void SetAnchorPoint(const Vector3& anchorPoint); /** * @brief Retrieve the anchor-point of an actor. * + * @SINCE_1_0.0 + * @return The current anchor-point. * @pre The Actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetAnchorPoint(). - * @return The current anchor-point. */ Vector3 GetCurrentAnchorPoint() const; @@ -580,10 +586,11 @@ public: * Geometry can be scaled to fit within this area. * This does not interfere with the actors scale factor. * The actors default depth is the minimum of width & height. - * @pre The actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). + * @SINCE_1_0.0 * @param [in] width The new width. * @param [in] height The new height. + * @pre The actor has been initialized. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). */ void SetSize(float width, float height); @@ -592,11 +599,12 @@ public: * * Geometry can be scaled to fit within this area. * This does not interfere with the actors scale factor. - * @pre The actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). + * @SINCE_1_0.0 * @param [in] width The size of the actor along the x-axis. * @param [in] height The size of the actor along the y-axis. * @param [in] depth The size of the actor along the z-axis. + * @pre The actor has been initialized. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). */ void SetSize(float width, float height, float depth); @@ -606,9 +614,10 @@ public: * Geometry can be scaled to fit within this area. * This does not interfere with the actors scale factor. * The actors default depth is the minimum of width & height. + * @SINCE_1_0.0 + * @param [in] size The new size. * @pre The actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). - * @param [in] size The new size. */ void SetSize(const Vector2& size); @@ -617,35 +626,39 @@ public: * * Geometry can be scaled to fit within this area. * This does not interfere with the actors scale factor. + * @SINCE_1_0.0 + * @param [in] size The new size. * @pre The actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentSize(). - * @param [in] size The new size. */ void SetSize(const Vector3& size); /** * @brief Retrieve the actor's size. * + * @SINCE_1_0.0 + * @return The actor's target size. * @pre The actor has been initialized. - * @note This return is the value that was set using SetSize or the target size of an animation - * @return The actor's current size. + * @note This return is the value that was set using SetSize or the target size of an animation. */ - Vector3 GetSize() const; + Vector3 GetTargetSize() const; /** * @brief Retrieve the actor's size. * + * @SINCE_1_0.0 + * @return The actor's current size. * @pre The actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetSize(). - * @return The actor's current size. */ Vector3 GetCurrentSize() const; /** - * Return the natural size of the actor. + * @brief Return the natural size of the actor. * * Deriving classes stipulate the natural size and by default an actor has a ZERO natural size. * + * @SINCE_1_0.0 * @return The actor's natural size */ Vector3 GetNaturalSize() const; @@ -654,250 +667,312 @@ public: * @brief Sets the position of the actor. * * The Actor's z position will be set to 0.0f. - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). + * @SINCE_1_0.0 * @param [in] x The new x position * @param [in] y The new y position + * @pre The Actor has been initialized. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). */ void SetPosition(float x, float y); /** * @brief Sets the position of the Actor. * - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). + * @SINCE_1_0.0 * @param [in] x The new x position * @param [in] y The new y position * @param [in] z The new z position + * @pre The Actor has been initialized. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). */ void SetPosition(float x, float y, float z); /** * @brief Sets the position of the Actor. * + * @SINCE_1_0.0 + * @param [in] position The new position * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). - * @param [in] position The new position */ void SetPosition(const Vector3& position); /** * @brief Set the position of an actor along the X-axis. * + * @SINCE_1_0.0 + * @param [in] x The new x position * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). - * @param [in] x The new x position */ void SetX(float x); /** * @brief Set the position of an actor along the Y-axis. * + * @SINCE_1_0.0 + * @param [in] y The new y position. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). - * @param [in] y The new y position. */ void SetY(float y); /** * @brief Set the position of an actor along the Z-axis. * + * @SINCE_1_0.0 + * @param [in] z The new z position * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentPosition(). - * @param [in] z The new z position */ void SetZ(float z); /** - * @brief Move an actor relative to its existing position. + * @brief Translate an actor relative to its existing position. * - * @pre The actor has been initialized. + * @SINCE_1_0.0 * @param[in] distance The actor will move by this distance. + * @pre The actor has been initialized. */ - void MoveBy(const Vector3& distance); + void TranslateBy(const Vector3& distance); /** * @brief Retrieve the position of the Actor. * + * @SINCE_1_0.0 + * @return the Actor's current position. * @pre The Actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetPosition(). - * @return the Actor's current position. */ Vector3 GetCurrentPosition() const; /** * @brief Retrieve the world-position of the Actor. * - * @note The actor will not have a world-position, unless it has previously been added to the stage. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The Actor's current position in world coordinates. + * @pre The Actor has been initialized. + * @note The actor will not have a world-position, unless it has previously been added to the stage. */ Vector3 GetCurrentWorldPosition() const; /** + * @DEPRECATED_1_1.24 Use SetInheritPosition instead * @brief Set the actors position inheritance mode. * * The default is to inherit. * Switching this off means that using SetPosition() sets the actor's world position. - * @see PositionInheritanceMode - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param[in] mode to use + * @pre The Actor has been initialized. + * @see PositionInheritanceMode */ void SetPositionInheritanceMode( PositionInheritanceMode mode ); /** + * @brief Set whether a child actor inherits it's parent's position. + * + * Default is to inherit. + * Switching this off means that using SetPosition() sets the actor's world position3 + * @SINCE_1_1.24 + * @param[in] inherit - true if the actor should inherit position, false otherwise. + * @pre The Actor has been initialized. + */ + inline void SetInheritPosition( bool inherit ) + { + SetProperty(Property::INHERIT_POSITION, inherit ); + } + + /** + * @DEPRECATED_1_1.24 Use IsPositionInherited * @brief Returns the actors position inheritance mode. * + * @SINCE_1_0.0 + * @return Return the position inheritance mode. * @pre The Actor has been initialized. - * @return true if the actor inherit's it's parent orientation, false if it uses world orientation. */ PositionInheritanceMode GetPositionInheritanceMode() const; /** - * @brief Sets the rotation of the Actor. + * @brief Returns whether the actor inherits its parent's position. + * + * @SINCE_1_1.24 + * @return True if the actor inherits its parent position, false if it uses world position. + * @pre The Actor has been initialized. + */ + inline bool IsPositionInherited() const + { + return GetProperty(Property::INHERIT_POSITION ).Get(); + } + + /** + * @brief Sets the orientation of the Actor. * - * An actor's rotation is centered around its anchor point. + * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. + * @SINCE_1_0.0 + * @param [in] angle The new orientation angle in degrees. + * @param [in] axis The new axis of orientation. * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentRotation(). - * @param [in] angle The new rotation angle in degrees. - * @param [in] axis The new axis of rotation. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). */ - void SetRotation(const Degree& angle, const Vector3& axis); + void SetOrientation( const Degree& angle, const Vector3& axis ) + { + SetOrientation( Radian( angle ), axis ); + } /** - * @brief Sets the rotation of the Actor. + * @brief Sets the orientation of the Actor. * - * An actor's rotation is centered around its anchor point. + * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. + * @SINCE_1_0.0 + * @param [in] angle The new orientation angle in radians. + * @param [in] axis The new axis of orientation. * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentRotation(). - * @param [in] angle The new rotation angle in radians. - * @param [in] axis The new axis of rotation. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). */ - void SetRotation(const Radian& angle, const Vector3& axis); + void SetOrientation(const Radian& angle, const Vector3& axis); /** - * @brief Sets the rotation of the Actor. + * @brief Sets the orientation of the Actor. * + * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point. + * @SINCE_1_0.0 + * @param [in] orientation The new orientation. * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentRotation(). - * @param [in] rotation The new rotation. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation(). */ - void SetRotation(const Quaternion& rotation); + void SetOrientation(const Quaternion& orientation); /** * @brief Apply a relative rotation to an actor. * + * @SINCE_1_0.0 + * @param[in] angle The angle to the rotation to combine with the existing orientation. + * @param[in] axis The axis of the rotation to combine with the existing orientation. * @pre The actor has been initialized. - * @param[in] angle The angle to the rotation to combine with the existing rotation. - * @param[in] axis The axis of the rotation to combine with the existing rotation. */ - void RotateBy(const Degree& angle, const Vector3& axis); + void RotateBy( const Degree& angle, const Vector3& axis ) + { + RotateBy( Radian( angle ), axis ); + } /** * @brief Apply a relative rotation to an actor. * + * @SINCE_1_0.0 + * @param[in] angle The angle to the rotation to combine with the existing orientation. + * @param[in] axis The axis of the rotation to combine with the existing orientation. * @pre The actor has been initialized. - * @param[in] angle The angle to the rotation to combine with the existing rotation. - * @param[in] axis The axis of the rotation to combine with the existing rotation. */ void RotateBy(const Radian& angle, const Vector3& axis); /** * @brief Apply a relative rotation to an actor. * + * @SINCE_1_0.0 + * @param[in] relativeRotation The rotation to combine with the existing orientation. * @pre The actor has been initialized. - * @param[in] relativeRotation The rotation to combine with the existing rotation. */ void RotateBy(const Quaternion& relativeRotation); /** - * @brief Retreive the Actor's rotation. + * @brief Retreive the Actor's orientation. * + * @SINCE_1_0.0 + * @return The current orientation. * @pre The Actor has been initialized. - * @note This property can be animated; the return value may not match the value written with SetRotation(). - * @return The current rotation. + * @note This property can be animated; the return value may not match the value written with SetOrientation(). */ - Quaternion GetCurrentRotation() const; + Quaternion GetCurrentOrientation() const; /** * @brief Set whether a child actor inherits it's parent's orientation. * * Default is to inherit. - * Switching this off means that using SetRotation() sets the actor's world orientation. - * @pre The Actor has been initialized. + * Switching this off means that using SetOrientation() sets the actor's world orientation. + * @SINCE_1_0.0 * @param[in] inherit - true if the actor should inherit orientation, false otherwise. + * @pre The Actor has been initialized. */ - void SetInheritRotation(bool inherit); + void SetInheritOrientation(bool inherit); /** - * @brief Returns whether the actor inherit's it's parent's orientation. + * @brief Returns whether the actor inherits its parent's orientation. * + * @SINCE_1_0.0 + * @return True if the actor inherits its parent orientation, false if it uses world orientation. * @pre The Actor has been initialized. - * @return true if the actor inherit's it's parent orientation, false if it uses world orientation. */ - bool IsRotationInherited() const; + bool IsOrientationInherited() const; /** - * @brief Retrieve the world-rotation of the Actor. + * @brief Retrieve the world-orientation of the Actor. * - * @note The actor will not have a world-rotation, unless it has previously been added to the stage. + * @SINCE_1_0.0 + * @return The Actor's current orientation in the world. * @pre The Actor has been initialized. - * @return The Actor's current rotation in the world. + * @note The actor will not have a world-orientation, unless it has previously been added to the stage. */ - Quaternion GetCurrentWorldRotation() const; + Quaternion GetCurrentWorldOrientation() const; /** * @brief Set the scale factor applied to an actor. * + * @SINCE_1_0.0 + * @param [in] scale The scale factor applied on all axes. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentScale(). - * @param [in] scale The scale factor applied on all axes. */ void SetScale(float scale); /** * @brief Set the scale factor applied to an actor. * - * @pre The Actor has been initialized. - * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentScale(). + * @SINCE_1_0.0 * @param [in] scaleX The scale factor applied along the x-axis. * @param [in] scaleY The scale factor applied along the y-axis. * @param [in] scaleZ The scale factor applied along the z-axis. + * @pre The Actor has been initialized. + * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentScale(). */ void SetScale(float scaleX, float scaleY, float scaleZ); /** * @brief Set the scale factor applied to an actor. * + * @SINCE_1_0.0 + * @param [in] scale A vector representing the scale factor for each axis. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentScale(). - * @param [in] scale A vector representing the scale factor for each axis. */ void SetScale(const Vector3& scale); /** * @brief Apply a relative scale to an actor. * + * @SINCE_1_0.0 + * @param[in] relativeScale The scale to combine with the actor's existing scale. * @pre The actor has been initialized. - * @param[in] relativeScale The scale to combine with the actors existing scale. */ void ScaleBy(const Vector3& relativeScale); /** * @brief Retrieve the scale factor applied to an actor. * + * @SINCE_1_0.0 + * @return A vector representing the scale factor for each axis. * @pre The Actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetScale(). - * @return A vector representing the scale factor for each axis. */ Vector3 GetCurrentScale() const; /** * @brief Retrieve the world-scale of the Actor. * - * @note The actor will not have a world-scale, unless it has previously been added to the stage. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The Actor's current scale in the world. + * @pre The Actor has been initialized. + * @note The actor will not have a world-scale, unless it has previously been added to the stage. */ Vector3 GetCurrentWorldScale() const; @@ -906,77 +981,28 @@ public: * * Default is to inherit. * Switching this off means that using SetScale() sets the actor's world scale. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param[in] inherit - true if the actor should inherit scale, false otherwise. + * @pre The Actor has been initialized. */ void SetInheritScale( bool inherit ); /** - * @brief Returns whether the actor inherit's it's parent's scale. + * @brief Returns whether the actor inherits its parent's scale. * + * @SINCE_1_0.0 + * @return True if the actor inherits its parent scale, false if it uses world scale. * @pre The Actor has been initialized. - * @return true if the actor inherit's it's parent scale, false if it uses world scale. */ bool IsScaleInherited() const; /** - * @brief Defines how a child actor's size is affected by its parent's size. - * - * The default is to ignore the parent's size and use the size property of this actor. - * - * If USE_OWN_SIZE is used, this option is bypassed and the actor's size - * property is used. - * - * If SIZE_EQUAL_TO_PARENT is used, this actor's size will be equal to that - * of its parent. The actor's size property is ignored. - * - * If SIZE_RELATIVE_TO_PARENT is used, this actor's size will be based on - * its parent's size by multiplying the parent size by - * SizeModeFactor. - * - * If SIZE_FIXED_OFFSET_FROM_PARENT is used, this actor's size will be based on - * its parent's size plus SizeModeFactor. - * - * @pre The Actor has been initialized. - * @param[in] mode The size relative to parent mode to use. - */ - void SetSizeMode(const SizeMode mode); - - /** - * @brief Returns the actor's mode for modifying its size relative to its parent. - * - * @pre The Actor has been initialized. - * @return The mode used. - */ - SizeMode GetSizeMode() const; - - /** - * @brief Sets the relative to parent size factor of the actor. - * - * This factor is only used when SizeMode is set to either: - * SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT. - * This actor's size is set to the actor's parent size multipled by or added to this factor, - * depending on SideMode (See SetSizeMode). - * - * @pre The Actor has been initialized. - * @param [in] factor A Vector3 representing the relative factor to be applied to each axis. - */ - void SetSizeModeFactor(const Vector3& factor); - - /** - * @brief Retrieve the relative to parent size factor of the actor. - * - * @pre The Actor has been initialized. - * @return The Actor's current relative size factor. - */ - Vector3 GetSizeModeFactor() const; - - /** * @brief Retrieves the world-matrix of the actor. * - * @note The actor will not have a world-matrix, unless it has previously been added to the stage. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The Actor's current world matrix + * @pre The Actor has been initialized. + * @note The actor will not have a world-matrix, unless it has previously been added to the stage. */ Matrix GetCurrentWorldMatrix() const; @@ -985,50 +1011,46 @@ public: /** * @brief Sets the visibility flag of an actor. * + * @SINCE_1_0.0 + * @param [in] visible The new visibility flag. * @pre The actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with IsVisible(). * @note If an actor's visibility flag is set to false, then the actor and its children will not be rendered. * This is regardless of the individual visibility values of the children i.e. an actor will only be * rendered if all of its parents have visibility set to true. - * @param [in] visible The new visibility flag. */ void SetVisible(bool visible); /** * @brief Retrieve the visibility flag of an actor. * + * @SINCE_1_0.0 + * @return The visibility flag. * @pre The actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetVisible(). * @note If an actor is not visible, then the actor and its children will not be rendered. * This is regardless of the individual visibility values of the children i.e. an actor will only be * rendered if all of its parents have visibility set to true. - * @return The visibility flag. */ bool IsVisible() const; /** * @brief Sets the opacity of an actor. * + * @SINCE_1_0.0 + * @param [in] opacity The new opacity. * @pre The actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOpacity(). - * @param [in] opacity The new opacity. */ void SetOpacity(float opacity); /** - * @brief Apply a relative opacity change to an actor. - * - * @pre The actor has been initialized. - * @param[in] relativeOpacity The opacity to combine with the actors existing opacity. - */ - void OpacityBy(float relativeOpacity); - - /** * @brief Retrieve the actor's opacity. * + * @SINCE_1_0.0 + * @return The actor's opacity. * @pre The actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetOpacity(). - * @return The actor's opacity. */ float GetCurrentOpacity() const; @@ -1036,27 +1058,21 @@ public: * @brief Sets the actor's color; this is an RGBA value. * * The final color of the actor depends on its color mode. + * @SINCE_1_0.0 + * @param [in] color The new color. * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentColor(). - * @param [in] color The new color. */ void SetColor(const Vector4& color); /** - * @brief Apply a relative color change to an actor. - * - * @pre The actor has been initialized. - * @param[in] relativeColor The color to combine with the actors existing color. - */ - void ColorBy(const Vector4& relativeColor); - - /** * @brief Retrieve the actor's color. * * Actor's own color is not clamped. + * @SINCE_1_0.0 + * @return The color. * @pre The Actor has been initialized. * @note This property can be animated; the return value may not match the value written with SetColor(). - * @return The color. */ Vector4 GetCurrentColor() const; @@ -1065,25 +1081,28 @@ public: * * This specifies whether the Actor uses its own color, or inherits * its parent color. The default is USE_OWN_MULTIPLY_PARENT_ALPHA. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param [in] colorMode to use. + * @pre The Actor has been initialized. */ void SetColorMode( ColorMode colorMode ); /** * @brief Returns the actor's color mode. * - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return currently used colorMode. + * @pre The Actor has been initialized. */ ColorMode GetColorMode() const; /** * @brief Retrieve the world-color of the Actor, where each component is clamped within the 0->1 range. * - * @note The actor will not have a world-color, unless it has previously been added to the stage. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The Actor's current color in the world. + * @pre The Actor has been initialized. + * @note The actor will not have a world-color, unless it has previously been added to the stage. */ Vector4 GetCurrentWorldColor() const; @@ -1091,20 +1110,16 @@ public: * @brief Set how the actor and its children should be drawn. * * Not all actors are renderable, but DrawMode can be inherited from any actor. - * By default a renderable actor will be drawn as a 3D object. It will be depth-tested against + * If an object is in a 3D layer, it will be depth-tested against * other objects in the world i.e. it may be obscured if other objects are in front. * - * If DrawMode::OVERLAY is used, the actor and its children will be drawn as a 2D overlay. + * If DrawMode::OVERLAY_2D is used, the actor and its children will be drawn as a 2D overlay. * Overlay actors are drawn in a separate pass, after all non-overlay actors within the Layer. - * For overlay actors, the drawing order is determined by the hierachy (depth-first search order), + * For overlay actors, the drawing order is with respect to tree levels of Actors, * and depth-testing will not be used. - * - * If DrawMode::STENCIL is used, the actor and its children will be used to stencil-test other actors - * within the Layer. Stencil actors are therefore drawn into the stencil buffer before any other - * actors within the Layer. - * + + * @SINCE_1_0.0 * @param[in] drawMode The new draw-mode to use. - * @note Setting STENCIL will override OVERLAY, if that would otherwise have been inherited. * @note Layers do not inherit the DrawMode from their parents. */ void SetDrawMode( DrawMode::Type drawMode ); @@ -1112,14 +1127,15 @@ public: /** * @brief Query how the actor and its children will be drawn. * - * @return True if the Actor is an overlay. + * @SINCE_1_0.0 + * @return Return the draw mode type. */ DrawMode::Type GetDrawMode() const; // Input Handling /** - * @brief Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover(). + * @brief Sets whether an actor should emit touch or hover signals. * * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(), * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the @@ -1135,36 +1151,39 @@ public: * actor.SetSensitive(true); * @endcode * - * @see @see SignalTouch() and SignalHover(). + * @SINCE_1_0.0 + * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise. + * @pre The Actor has been initialized. * @note If an actor's sensitivity is set to false, then it's children will not be hittable either. * This is regardless of the individual sensitivity values of the children i.e. an actor will only be * hittable if all of its parents have sensitivity set to true. - * @pre The Actor has been initialized. - * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise. + * @see @see TouchedSignal() and HoveredSignal(). */ void SetSensitive(bool sensitive); /** * @brief Query whether an actor emits touch or hover event signals. * + * @SINCE_1_0.0 + * @return True, if emission of touch or hover event signals is enabled, false otherwise. + * @pre The Actor has been initialized. * @note If an actor is not sensitive, then it's children will not be hittable either. * This is regardless of the individual sensitivity values of the children i.e. an actor will only be * hittable if all of its parents have sensitivity set to true. - * @pre The Actor has been initialized. - * @return true, if emission of touch or hover event signals is enabled, false otherwise. */ bool IsSensitive() const; /** * @brief Converts screen coordinates into the actor's coordinate system using the default camera. * - * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5) - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @param[out] localX On return, the X-coordinate relative to the actor. * @param[out] localY On return, the Y-coordinate relative to the actor. * @param[in] screenX The screen X-coordinate. * @param[in] screenY The screen Y-coordinate. * @return True if the conversion succeeded. + * @pre The Actor has been initialized. + * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5) */ bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const; @@ -1172,11 +1191,12 @@ public: * @brief Sets whether the actor should receive a notification when touch or hover motion events leave * the boundary of the actor. * + * @SINCE_1_0.0 + * @param[in] required Should be set to true if a Leave event is required + * @pre The Actor has been initialized. * @note By default, this is set to false as most actors do not require this. - * @note Need to connect to the SignalTouch or SignalHover to actually receive this event. + * @note Need to connect to the TouchedSignal() or HoveredSignal() to actually receive this event. * - * @pre The Actor has been initialized. - * @param[in] required Should be set to true if a Leave event is required */ void SetLeaveRequired(bool required); @@ -1184,32 +1204,234 @@ public: * @brief This returns whether the actor requires touch or hover events whenever touch or hover motion events leave * the boundary of the actor. * + * @SINCE_1_0.0 + * @return True if a Leave event is required, false otherwise. * @pre The Actor has been initialized. - * @return true if a Leave event is required, false otherwise. */ bool GetLeaveRequired() const; /** * @brief Sets whether the actor should be focusable by keyboard navigation. * - * The default is true. - * @pre The Actor has been initialized. + * The default is false. + * @SINCE_1_0.0 * @param[in] focusable - true if the actor should be focusable by keyboard navigation, * false otherwise. + * @pre The Actor has been initialized. */ void SetKeyboardFocusable( bool focusable ); /** * @brief Returns whether the actor is focusable by keyboard navigation. * + * @SINCE_1_0.0 + * @return True if the actor is focusable by keyboard navigation, false if not. * @pre The Actor has been initialized. - * @return true if the actor is focusable by keyboard navigation, false if not. */ bool IsKeyboardFocusable() const; + // SIZE NEGOTIATION + + /** + * @brief Set the resize policy to be used for the given dimension(s). + * + * @SINCE_1_0.0 + * @param[in] policy The resize policy to use + * @param[in] dimension The dimension(s) to set policy for. Can be a bitfield of multiple dimensions. + */ + void SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ); + + /** + * @brief Return the resize policy used for a single dimension. + * + * @SINCE_1_0.0 + * @param[in] dimension The dimension to get policy for + * @return Return the dimension resize policy. If more than one dimension is requested, just return the first one found. + */ + ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const; + + /** + * @brief Set the policy to use when setting size with size negotiation. Defaults to SizeScalePolicy::USE_SIZE_SET. + * + * @SINCE_1_0.0 + * @param[in] policy The policy to use for when the size is set + */ + void SetSizeScalePolicy( SizeScalePolicy::Type policy ); + + /** + * @brief Return the size scale policy in use. + * + * @SINCE_1_0.0 + * @return Return the size scale policy. + */ + SizeScalePolicy::Type GetSizeScalePolicy() const; + + /** + * @brief Sets the relative to parent size factor of the actor. + * + * This factor is only used when ResizePolicy is set to either: + * ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT. + * This actor's size is set to the actor's size multipled by or added to this factor, + * depending on ResizePolicy ( See SetResizePolicy() ). + * + * @SINCE_1_0.0 + * @param [in] factor A Vector3 representing the relative factor to be applied to each axis. + * @pre The Actor has been initialized. + */ + void SetSizeModeFactor( const Vector3& factor ); + + /** + * @brief Retrieve the relative to parent size factor of the actor. + * + * @SINCE_1_0.0 + * @return The Actor's current relative size factor. + * @pre The Actor has been initialized. + */ + Vector3 GetSizeModeFactor() const; + + /** + * @brief Calculate the height of the actor given a width. + * + * The natural size is used for default calculation. + * size 0 is treated as aspect ratio 1:1. + * + * @SINCE_1_0.0 + * @param width Width to use + * @return Return the height based on the width. + */ + float GetHeightForWidth( float width ); + + /** + * @brief Calculate the width of the actor given a height. + * + * The natural size is used for default calculation. + * size 0 is treated as aspect ratio 1:1. + * + * @SINCE_1_0.0 + * @param height Height to use + * @return Return the width based on the height. + */ + float GetWidthForHeight( float height ); + + /** + * @brief Return the value of negotiated dimension for the given dimension. + * + * @SINCE_1_0.0 + * @param dimension The dimension to retrieve + * @return Return the value of the negotiated dimension. If more than one dimension is requested, just return the first one found. + */ + float GetRelayoutSize( Dimension::Type dimension ) const; + + /** + * @brief Set the padding for use in layout. + * + * @SINCE_1_0.0 + * @param[in] padding Padding for the actor + */ + void SetPadding( const Padding& padding ); + + /** + * @brief Return the value of the padding. + * + * @SINCE_1_0.0 + * @param paddingOut The returned padding data + */ + void GetPadding( Padding& paddingOut ) const; + + /** + * @brief Set the minimum size an actor can be assigned in size negotiation. + * + * @SINCE_1_0.0 + * @param[in] size The minimum size + */ + void SetMinimumSize( const Vector2& size ); + + /** + * @brief Return the minimum relayout size. + * + * @SINCE_1_0.0 + * @return Return the mininmum size. + */ + Vector2 GetMinimumSize(); + + /** + * @brief Set the maximum size an actor can be assigned in size negotiation. + * + * @SINCE_1_0.0 + * @param[in] size The maximum size + */ + void SetMaximumSize( const Vector2& size ); + + /** + * @brief Return the maximum relayout size. + * + * @SINCE_1_0.0 + * @return Return the maximum size. + */ + Vector2 GetMaximumSize(); + + /** + * @brief Get depth in the hierarchy for the actor. + * + * @SINCE_1_0.0 + * @return The current depth in the hierarchy of the actor, or -1 if actor is not in the hierarchy + */ + int GetHierarchyDepth(); + +public: // Renderer + + /** + * @brief Add a renderer to this actor. + * + * @SINCE_1_0.0 + * @param[in] renderer Renderer to add to the actor + * @return The index of the Renderer that was added + * @pre The renderer must be initialized. + * + */ + unsigned int AddRenderer( Renderer& renderer ); + + /** + * @brief Get the number of renderers on this actor. + * + * @SINCE_1_0.0 + * @return the number of renderers on this actor + */ + unsigned int GetRendererCount() const; + + /** + * @brief Get a Renderer by index. + * + * @SINCE_1_0.0 + * @param[in] index The index of the renderer to fetch + * @return The renderer at the specified index + * @pre The index must be between 0 and GetRendererCount()-1 + * + */ + Renderer GetRendererAt( unsigned int index ); + + /** + * @brief Remove an renderer from the actor. + * + * @SINCE_1_0.0 + * @param[in] renderer Handle to the renderer that is to be removed + */ + void RemoveRenderer( Renderer& renderer ); + + /** + * @brief Remove an renderer from the actor by index. + * + * @SINCE_1_0.0 + * @param[in] index Index of the renderer that is to be removed + * @pre The index must be between 0 and GetRendererCount()-1 + * + */ + void RemoveRenderer( unsigned int index ); + public: // Signals /** + * @DEPRECATED_1_1.37 Use TouchSignal() instead. * @brief This signal is emitted when touch input is received. * * A callback of the following type may be connected: @@ -1218,12 +1440,28 @@ public: // Signals * @endcode * The return value of True, indicates that the touch event should be consumed. * Otherwise the signal will be emitted on the next sensitive parent of the actor. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The signal to connect to. + * @pre The Actor has been initialized. */ TouchSignalType& TouchedSignal(); /** + * @brief This signal is emitted when touch input is received. + * + * A callback of the following type may be connected: + * @code + * bool YourCallbackName( Actor actor, TouchData& touch ); + * @endcode + * The return value of True, indicates that the touch event has been consumed. + * Otherwise the signal will be emitted on the next sensitive parent of the actor. + * @SINCE_1_1.37 + * @return The signal to connect to. + * @pre The Actor has been initialized. + */ + TouchDataSignalType& TouchSignal(); + + /** * @brief This signal is emitted when hover input is received. * * A callback of the following type may be connected: @@ -1232,43 +1470,48 @@ public: // Signals * @endcode * The return value of True, indicates that the hover event should be consumed. * Otherwise the signal will be emitted on the next sensitive parent of the actor. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The signal to connect to. + * @pre The Actor has been initialized. */ HoverSignalType& HoveredSignal(); /** - * @brief This signal is emitted when mouse wheel event is received. + * @brief This signal is emitted when wheel event is received. * * A callback of the following type may be connected: * @code - * bool YourCallbackName(Actor actor, const MouseWheelEvent& event); + * bool YourCallbackName(Actor actor, const WheelEvent& event); * @endcode - * The return value of True, indicates that the mouse wheel event should be consumed. + * The return value of True, indicates that the wheel event should be consumed. * Otherwise the signal will be emitted on the next sensitive parent of the actor. - * @pre The Actor has been initialized. + * @SINCE_1_0.0 * @return The signal to connect to. + * @pre The Actor has been initialized. */ - MouseWheelEventSignalType& MouseWheelEventSignal(); + WheelEventSignalType& WheelEventSignal(); /** * @brief This signal is emitted after the actor has been connected to the stage. * * When an actor is connected, it will be directly or indirectly parented to the root Actor. + * @SINCE_1_0.0 + * @return The signal to connect to. * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected. * * @note When the parent of a set of actors is connected to the stage, then all of the children * will received this callback. - * * For the following actor tree, the callback order will be A, B, D, E, C, and finally F. * + * @code + * * A (parent) * / \ * B C * / \ \ * D E F * - * @return The signal + * @endcode */ OnStageSignalType& OnStageSignal(); @@ -1277,123 +1520,66 @@ public: // Signals * * If an actor is disconnected it either has no parent, or is parented to a disconnected actor. * + * @SINCE_1_0.0 + * @return The signal to connect to. * @note When the parent of a set of actors is disconnected to the stage, then all of the children * will received this callback, starting with the leaf actors. - * * For the following actor tree, the callback order will be D, E, B, F, C, and finally A. * + * @code + * * A (parent) * / \ * B C * / \ \ * D E F * - * @return The signal - */ - OffStageSignalType& OffStageSignal(); - -public: // Dynamics - - /** - * @brief Enable dynamics for this actor. - * - * The actor will behave as a rigid/soft body in the simulation - * @pre The actor is not already acting as a DynamicsBody and IsDynamicsRoot() returns false - * - * @param [in] bodyConfig The DynamicsBodyConfig specifying the dynamics properties for this actor in the dynamics world. - * @return The DynamicsBody - */ - DynamicsBody EnableDynamics(DynamicsBodyConfig bodyConfig); - - /** - * @brief Add a joint constraint to this actor. - * - * @param[in] attachedActor The other actor in the joint - * @param[in] offset The offset (relative to this actor) of the origin of the joint - * @return The new joint - * @pre Both actors are dynamics enabled actors (IE Actor::EnableDynamics()) has been invoked for both actors). - * @post If the two actors are already connected by a joint, The existing joint is returned - * and offset is ignored. - */ - DynamicsJoint AddDynamicsJoint( Actor attachedActor, const Vector3& offset ); - - /** - * @brief Add a joint constraint to this actor. - * - * @param[in] attachedActor The other actor in the joint - * @param[in] offsetA The offset (relative to this actor) of the origin of the joint - * @param[in] offsetB The offset (relative to attachedActor) of the origin of the joint - * @return The new joint - * @pre Both actors are dynamics enabled actors (IE Actor::EnableDynamics()) has been invoked for both actors). - * @post If the two actors are already connected by a joint, The existing joint is returned - * and offset is ignored. - */ - DynamicsJoint AddDynamicsJoint( Actor attachedActor, const Vector3& offsetA, const Vector3& offsetB ); - - /** - * @brief Get the number of DynamicsJoint objects added to this actor. - * - * @return The number of DynamicsJoint objects added to this actor - */ - int GetNumberOfJoints() const; - - /** - * @brief Get a joint by index. - * - * @param[in] index The index of the joint. - * Use GetNumberOfJoints to get the valid range of indices. - * @return The joint. - */ - DynamicsJoint GetDynamicsJointByIndex( const int index ); - - /** - * @brief Get the joint between this actor and attachedActor. - * - * @param[in] attachedActor The other actor in the joint - * @return The joint. - */ - DynamicsJoint GetDynamicsJoint( Actor attachedActor ); - - /** - * @brief Remove a joint from this actor - * - * @param[in] joint The joint to be removed - */ - void RemoveDynamicsJoint( DynamicsJoint joint ); - - /** - * @brief Disable dynamics for this actor. + * @endcode * - * The actor will be detached from the DynamicsBody/DynamicsJoint associated with it through EnableDynamics */ - void DisableDynamics(); + OffStageSignalType& OffStageSignal(); /** - * @brief Get the associated DynamicsBody. + * @brief This signal is emitted after the size has been set on the actor during relayout * - * @return A DynamicsBody + * @SINCE_1_0.0 + * @return The signal */ - DynamicsBody GetDynamicsBody(); + OnRelayoutSignalType& OnRelayoutSignal(); public: // Not intended for application developers /** - * @brief This constructor is used by Dali New() methods. + * @internal + * @brief This constructor is used by Actor::New() methods. * + * @SINCE_1_0.0 * @param [in] actor A pointer to a newly allocated Dali resource */ explicit DALI_INTERNAL Actor(Internal::Actor* actor); }; /** + * @internal * @brief Helper for discarding an actor handle. * * If the handle is empty, this method does nothing. Otherwise - * actor.Unparent() will be called, followed by actor.Reset(). + * Actor::Unparent() will be called, followed by Actor::Reset(). + * @SINCE_1_0.0 * @param[in,out] actor A handle to an actor, or an empty handle. */ - DALI_IMPORT_API void UnparentAndReset( Actor& actor ); +inline void UnparentAndReset( Actor& actor ) +{ + if( actor ) + { + actor.Unparent(); + actor.Reset(); + } +} +/** + * @} + */ } // namespace Dali -#endif // __DALI_ACTOR_H__ +#endif // DALI_ACTOR_H