X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Factor.h;h=97756b0be0b26324dd8fb32c4aa37a4abdfbe775;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hp=a4801c6e4b4897f2f81a1f86c92cdda9b0a8207e;hpb=9e0ad010ee535b9d5187d81016f3b6bd0387b40b;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index a4801c6..97756b0 100644 --- a/dali/public-api/actors/actor.h +++ b/dali/public-api/actors/actor.h @@ -2,7 +2,7 @@ #define DALI_ACTOR_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // uint32_t // INTERNAL INCLUDES #include @@ -70,10 +71,10 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * * - An actor is only hittable if the actor's touch or hover signal has a connection. * - An actor is only hittable when it is between the camera's near and far planes. - * - If an actor is made insensitive, then the actor and its children are not hittable; see IsSensitive() - * - If an actor's visibility flag is unset, then none of its children are hittable either; see IsVisible() + * - If an actor is made insensitive, then the actor and its children are not hittable; see IsSensitive(). + * - If an actor's visibility flag is unset, then none of its children are hittable either; see IsVisible(). * - To be hittable, an actor must have a non-zero size. - * - If an actor's world color is fully transparent, then it is not hittable; see GetCurrentWorldColor() + * - If an actor's world color is fully transparent, then it is not hittable; see GetCurrentWorldColor(). * * Hit Test Algorithm: * @@ -194,7 +195,7 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * } * @endcode * - If there are several touch points, then the delivery is only to the first touch point's hit - * actor (and its parents). There will be NO touch or hover signal delivery for the hit actors of the + * actor (and its parents). There will be NO touch or hover signal delivery for the hit actors of the * other touch points. * - The local coordinates are from the top-left (0.0f, 0.0f, 0.5f) of the hit actor. * @@ -238,16 +239,20 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * @SINCE_1_0.0 */ -class DALI_IMPORT_API Actor : public Handle +class DALI_CORE_API Actor : public Handle { public: /** - * @brief An enumeration of properties belonging to the Actor class. + * @brief Enumeration for the instance of properties belonging to the Actor class. * @SINCE_1_0.0 */ struct Property { + /** + * @brief Enumeration for instance of properties belonging to the Actor class. + * @SINCE_1_0.0 + */ enum { PARENT_ORIGIN = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parentOrigin", type Vector3 (constraint-input) @SINCE_1_0.0 @@ -304,7 +309,21 @@ public: 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 - BATCH_PARENT, ///< name "batchParent", type bool @SINCE_1_2.0 + + /** + * @brief The direction of the layout. + * @details Name "layoutDirection", type LayoutDirection::Type (Property::INTEGER) or Property::STRING. + * @SINCE_1_2.60 + * @see LayoutDirection::Type for supported values. + */ + LAYOUT_DIRECTION, + + /** + * @brief Determines whether child actors inherit the layout direction from a parent. + * @details Name "layoutDirectionInheritance", type Property::BOOLEAN. + * @SINCE_1_2.60 + */ + INHERIT_LAYOUT_DIRECTION, }; }; @@ -317,11 +336,12 @@ public: 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 + typedef Signal< void ( Actor, LayoutDirection::Type ) > LayoutDirectionChangedSignalType; ///< Layout direction changes signal type. @SINCE_1_2.60 // Creation /** - * @brief Create an uninitialized Actor; this can be initialized with Actor::New(). + * @brief Creates an uninitialized Actor; this can be initialized with Actor::New(). * * Calling member functions with an uninitialized Actor handle is not allowed. * @SINCE_1_0.0 @@ -329,18 +349,18 @@ public: Actor(); /** - * @brief Create an initialized Actor. + * @brief Creates an initialized Actor. * * @SINCE_1_0.0 - * @return A handle to a newly allocated Dali resource. + * @return A handle to a newly allocated Dali resource */ static Actor New(); /** - * @brief Downcast a handle to Actor handle. + * @brief Downcasts 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. + * If handle points to an 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 @@ -349,7 +369,7 @@ public: static Actor DownCast( BaseHandle handle ); /** - * @brief Dali::Actor is intended as a base class + * @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 @@ -357,10 +377,10 @@ public: ~Actor(); /** - * @brief Copy constructor + * @brief Copy constructor. * * @SINCE_1_0.0 - * @param [in] copy The actor to copy. + * @param[in] copy The actor to copy */ Actor(const Actor& copy); @@ -368,16 +388,16 @@ public: * @brief Assignment operator * * @SINCE_1_0.0 - * @param [in] rhs The actor to copy. + * @param[in] rhs The actor to copy * @return A reference to this */ Actor& operator=(const Actor& rhs); /** - * @brief Retrieve the Actor's name. + * @brief Retrieves the Actor's name. * * @SINCE_1_0.0 - * @return The Actor's name. + * @return The Actor's name * @pre The Actor has been initialized. */ const std::string& GetName() const; @@ -386,47 +406,47 @@ public: * @brief Sets the Actor's name. * * @SINCE_1_0.0 - * @param [in] name The new name. + * @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. + * @brief Retrieves the unique ID of the actor. * * @SINCE_1_0.0 - * @return The ID. + * @return The ID * @pre The Actor has been initialized. */ - unsigned int GetId() const; + uint32_t GetId() const; // Containment /** - * @brief Query whether an actor is the root actor, which is owned by the Stage. + * @brief Queries whether an actor is the root actor, which is owned by the Stage. * * @SINCE_1_0.0 - * @return True if the actor is the root actor. + * @return True if the actor is the root actor * @pre The Actor has been initialized. */ bool IsRoot() const; /** - * @brief Query whether the actor is connected to the Stage. + * @brief Queries whether the actor is 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 True if the actor is connected to the Stage. + * @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. + * @brief Queries whether the actor is of class Dali::Layer. * * @SINCE_1_0.0 - * @return True if the actor is a layer. + * @return True if the actor is a layer * @pre The Actor has been initialized. */ bool IsLayer() const; @@ -435,7 +455,7 @@ public: * @brief Gets the layer in which the actor is present. * * @SINCE_1_0.0 - * @return The layer, which will be uninitialized if the actor is off-stage. + * @return The layer, which will be uninitialized if the actor is off-stage * @pre The Actor has been initialized. */ Layer GetLayer(); @@ -444,15 +464,15 @@ public: * @brief Adds a child Actor to this Actor. * * @SINCE_1_0.0 - * @param [in] child The child. + * @param[in] child The child * @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. * @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. - * @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, + * @note If the child already has a parent, it will be removed from old parent + * and reparented to this actor. This may change child's position, color, * scale etc as it now inherits them from this actor. */ void Add(Actor child); @@ -462,7 +482,7 @@ public: * * If the actor was not a child of this actor, this is a no-op. * @SINCE_1_0.0 - * @param [in] child The child. + * @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. */ @@ -478,31 +498,31 @@ public: void Unparent(); /** - * @brief Retrieve the number of children held by the actor. + * @brief Retrieves the number of children held by the actor. * * @SINCE_1_0.0 * @return The number of children * @pre The Actor has been initialized. */ - unsigned int GetChildCount() const; + uint32_t GetChildCount() const; /** * @brief Retrieve and child actor by index. * * @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 + * @return The actor for the given index or empty handle if children not initialized * @pre The Actor has been initialized. */ - Actor GetChildAt(unsigned int index) const; + Actor GetChildAt( uint32_t 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. * @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. + * @param[in] actorName The name 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 FindChildByName(const std::string& actorName); @@ -512,17 +532,17 @@ public: * * 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. + * @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); + Actor FindChildById( const uint32_t id ); /** - * @brief Retrieve the actor's parent. + * @brief Retrieves the actor's parent. * * @SINCE_1_0.0 - * @return A handle to the actor's parent. If the actor has no parent, this handle will be invalid. + * @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; @@ -530,56 +550,52 @@ public: // Positioning /** - * @brief Set the origin of an actor, within its parent's area. + * @brief Sets the origin of an actor, within its parent's area. * * This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, * 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. + * An actor's position is the distance between this origin, and the actor's anchor-point. * @image html parent-origin.png * @SINCE_1_0.0 - * @param [in] origin The new parent-origin. + * @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(). * @see Dali::ParentOrigin for predefined parent origin values */ void SetParentOrigin(const Vector3& origin); /** - * @brief Retrieve the parent-origin of an actor. + * @brief Retrieves the parent-origin of an actor. * * @SINCE_1_0.0 - * @return The current parent-origin. + * @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(). */ Vector3 GetCurrentParentOrigin() const; /** - * @brief Set the anchor-point of an actor. + * @brief Sets the anchor-point of an actor. * * This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) * is the top-left corner of the actor, and (1.0, 1.0, 0.5) is the - * bottom-right corner. The default anchor point is + * 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 position is the distance between its parent-origin and this anchor-point. * An actor's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point. * @image html anchor-point.png * @SINCE_1_0.0 - * @param [in] anchorPoint The new anchor-point. + * @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(). * @see Dali::AnchorPoint for predefined anchor point values */ void SetAnchorPoint(const Vector3& anchorPoint); /** - * @brief Retrieve the anchor-point of an actor. + * @brief Retrieves the anchor-point of an actor. * * @SINCE_1_0.0 - * @return The current anchor-point. + * @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(). */ Vector3 GetCurrentAnchorPoint() const; @@ -590,10 +606,9 @@ public: * 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] width The new width. - * @param [in] height The new height. + * @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); @@ -603,11 +618,10 @@ 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] 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. + * @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); @@ -618,9 +632,8 @@ public: * 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. + * @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(). */ void SetSize(const Vector2& size); @@ -630,34 +643,33 @@ 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. + * @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(). */ void SetSize(const Vector3& size); /** - * @brief Retrieve the actor's size. + * @brief Retrieves the actor's size. * * @SINCE_1_0.0 - * @return The actor's target size. + * @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. */ Vector3 GetTargetSize() const; /** - * @brief Retrieve the actor's size. + * @brief Retrieves the actor's size. * * @SINCE_1_0.0 - * @return The actor's current size. + * @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(). */ Vector3 GetCurrentSize() const; /** - * @brief Return the natural size of the actor. + * @brief Returns the natural size of the actor. * * Deriving classes stipulate the natural size and by default an actor has a ZERO natural size. * @@ -667,101 +679,110 @@ public: Vector3 GetNaturalSize() const; /** - * @brief Sets the position of the actor. + * @brief Sets the position of the Actor. + * + * By default, sets the position vector between the parent origin and anchor point (default). * + * If Position inheritance if disabled, sets the world position. @see SetInheritPosition + * + * @image html actor-position.png * The Actor's z position will be set to 0.0f. * @SINCE_1_0.0 - * @param [in] x The new x position - * @param [in] y The new y position + * @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. * + * By default, sets the position vector between the parent origin and anchor point (default). + * + * If Position inheritance if disabled, sets the world position. @see SetInheritPosition + * + * @image html actor-position.png * @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 + * @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. * + * By default, sets the position vector between the parent origin and anchor point (default). + * + * If Position inheritance if disabled, sets the world position. @see SetInheritPosition + * + * @image html actor-position.png * @SINCE_1_0.0 - * @param [in] position The new position + * @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(). */ void SetPosition(const Vector3& position); /** - * @brief Set the position of an actor along the X-axis. + * @brief Sets the position of an actor along the X-axis. * * @SINCE_1_0.0 - * @param [in] x The new x position + * @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(). */ void SetX(float x); /** - * @brief Set the position of an actor along the Y-axis. + * @brief Sets the position of an actor along the Y-axis. * * @SINCE_1_0.0 - * @param [in] y The new y 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 SetY(float y); /** - * @brief Set the position of an actor along the Z-axis. + * @brief Sets the position of an actor along the Z-axis. * * @SINCE_1_0.0 - * @param [in] z The new z 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 SetZ(float z); /** - * @brief Translate an actor relative to its existing position. + * @brief Translates an actor relative to its existing position. * * @SINCE_1_0.0 - * @param[in] distance The actor will move by this distance. + * @param[in] distance The actor will move by this distance * @pre The actor has been initialized. */ void TranslateBy(const Vector3& distance); /** - * @brief Retrieve the position of the Actor. + * @brief Retrieves the position of the Actor. * * @SINCE_1_0.0 - * @return the Actor's current position. + * @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(). */ Vector3 GetCurrentPosition() const; /** - * @brief Retrieve the world-position of the Actor. + * @brief Retrieves the world-position of the Actor. * * @SINCE_1_0.0 - * @return The Actor's current position in world coordinates. + * @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. + * @note The actor may not have a world-position unless it has been added to the stage. */ Vector3 GetCurrentWorldPosition() const; /** * @DEPRECATED_1_1.24 Use SetInheritPosition instead - * @brief Set the actors position inheritance mode. + * @brief Sets the actors position inheritance mode. * * The default is to inherit. * Switching this off means that using SetPosition() sets the actor's world position. @@ -770,15 +791,16 @@ public: * @pre The Actor has been initialized. * @see PositionInheritanceMode */ - void SetPositionInheritanceMode( PositionInheritanceMode mode ); + void SetPositionInheritanceMode( PositionInheritanceMode mode ) DALI_DEPRECATED_API; /** - * @brief Set whether a child actor inherits it's parent's position. + * @brief Sets 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 + * Switching this off means that using SetPosition() sets the actor's world position, i.e. translates from + * the world origin (0,0,0) to the anchor point of the actor. * @SINCE_1_1.24 - * @param[in] inherit - true if the actor should inherit position, false otherwise. + * @param[in] inherit - @c true if the actor should inherit position, @c false otherwise * @pre The Actor has been initialized. */ inline void SetInheritPosition( bool inherit ) @@ -791,16 +813,16 @@ public: * @brief Returns the actors position inheritance mode. * * @SINCE_1_0.0 - * @return Return the position inheritance mode. + * @return Return the position inheritance mode * @pre The Actor has been initialized. */ - PositionInheritanceMode GetPositionInheritanceMode() const; + PositionInheritanceMode GetPositionInheritanceMode() const DALI_DEPRECATED_API; /** * @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. + * @return @c true if the actor inherits its parent position, @c false if it uses world position * @pre The Actor has been initialized. */ inline bool IsPositionInherited() const @@ -813,8 +835,8 @@ public: * * 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. + * @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 GetCurrentOrientation(). */ @@ -828,8 +850,8 @@ public: * * 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. + * @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 GetCurrentOrientation(). */ @@ -840,18 +862,18 @@ public: * * 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. + * @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 GetCurrentOrientation(). */ void SetOrientation(const Quaternion& orientation); /** - * @brief Apply a relative rotation to an actor. + * @brief Applies 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. + * @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. */ void RotateBy( const Degree& angle, const Vector3& axis ) @@ -860,41 +882,41 @@ public: } /** - * @brief Apply a relative rotation to an actor. + * @brief Applies 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. + * @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. */ void RotateBy(const Radian& angle, const Vector3& axis); /** - * @brief Apply a relative rotation to an actor. + * @brief Applies a relative rotation to an actor. * * @SINCE_1_0.0 - * @param[in] relativeRotation The rotation to combine with the existing orientation. + * @param[in] relativeRotation The rotation to combine with the existing orientation * @pre The actor has been initialized. */ void RotateBy(const Quaternion& relativeRotation); /** - * @brief Retreive the Actor's orientation. + * @brief Retrieves the Actor's orientation. * * @SINCE_1_0.0 - * @return The current orientation. + * @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 SetOrientation(). */ Quaternion GetCurrentOrientation() const; /** - * @brief Set whether a child actor inherits it's parent's orientation. + * @brief Sets whether a child actor inherits it's parent's orientation. * * Default is to inherit. * 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. + * @param[in] inherit - @c true if the actor should inherit orientation, @c false otherwise * @pre The Actor has been initialized. */ void SetInheritOrientation(bool inherit); @@ -903,89 +925,89 @@ public: * @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. + * @return @c true if the actor inherits its parent orientation, @c false if it uses world orientation * @pre The Actor has been initialized. */ bool IsOrientationInherited() const; /** - * @brief Retrieve the world-orientation of the Actor. + * @brief Retrieves the world-orientation of the Actor. * * @SINCE_1_0.0 - * @return The Actor's current orientation in the world. + * @return The Actor's current orientation in the world * @pre The Actor has been initialized. * @note The actor will not have a world-orientation, unless it has previously been added to the stage. */ Quaternion GetCurrentWorldOrientation() const; /** - * @brief Set the scale factor applied to an actor. + * @brief Sets the scale factor applied to an actor. * * @SINCE_1_0.0 - * @param [in] scale The scale factor applied on all axes. + * @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(). */ void SetScale(float scale); /** - * @brief Set the scale factor applied to an actor. + * @brief Sets the scale factor applied to an actor. * * @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. + * @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. + * @brief Sets the scale factor applied to an actor. * * @SINCE_1_0.0 - * @param [in] scale A vector representing the scale factor for each axis. + * @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(). */ void SetScale(const Vector3& scale); /** - * @brief Apply a relative scale to an actor. + * @brief Applies a relative scale to an actor. * * @SINCE_1_0.0 - * @param[in] relativeScale The scale to combine with the actor's existing scale. + * @param[in] relativeScale The scale to combine with the actor's existing scale * @pre The actor has been initialized. */ void ScaleBy(const Vector3& relativeScale); /** - * @brief Retrieve the scale factor applied to an actor. + * @brief Retrieves the scale factor applied to an actor. * * @SINCE_1_0.0 - * @return A vector representing the scale factor for each axis. + * @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(). */ Vector3 GetCurrentScale() const; /** - * @brief Retrieve the world-scale of the Actor. + * @brief Retrieves the world-scale of the Actor. * * @SINCE_1_0.0 - * @return The Actor's current scale in the world. + * @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; /** - * @brief Set whether a child actor inherits it's parent's scale. + * @brief Sets whether a child actor inherits it's parent's scale. * * Default is to inherit. * Switching this off means that using SetScale() sets the actor's world scale. * @SINCE_1_0.0 - * @param[in] inherit - true if the actor should inherit scale, false otherwise. + * @param[in] inherit - @c true if the actor should inherit scale, @c false otherwise * @pre The Actor has been initialized. */ void SetInheritScale( bool inherit ); @@ -994,7 +1016,7 @@ public: * @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. + * @return @c true if the actor inherits its parent scale, @c false if it uses world scale * @pre The Actor has been initialized. */ bool IsScaleInherited() const; @@ -1015,7 +1037,7 @@ public: * @brief Sets the visibility flag of an actor. * * @SINCE_1_0.0 - * @param [in] visible The new visibility flag. + * @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. @@ -1025,10 +1047,10 @@ public: void SetVisible(bool visible); /** - * @brief Retrieve the visibility flag of an actor. + * @brief Retrieves the visibility flag of an actor. * * @SINCE_1_0.0 - * @return The visibility flag. + * @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. @@ -1041,17 +1063,17 @@ public: * @brief Sets the opacity of an actor. * * @SINCE_1_0.0 - * @param [in] opacity The new opacity. + * @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(). */ void SetOpacity(float opacity); /** - * @brief Retrieve the actor's opacity. + * @brief Retrieves the actor's opacity. * * @SINCE_1_0.0 - * @return The actor's opacity. + * @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(). */ @@ -1062,18 +1084,18 @@ public: * * The final color of the actor depends on its color mode. * @SINCE_1_0.0 - * @param [in] color The new color. + * @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(). */ void SetColor(const Vector4& color); /** - * @brief Retrieve the actor's color. + * @brief Retrieves the actor's color. * * Actor's own color is not clamped. * @SINCE_1_0.0 - * @return The color. + * @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(). */ @@ -1085,7 +1107,7 @@ public: * This specifies whether the Actor uses its own color, or inherits * its parent color. The default is USE_OWN_MULTIPLY_PARENT_ALPHA. * @SINCE_1_0.0 - * @param [in] colorMode to use. + * @param[in] colorMode ColorMode to use * @pre The Actor has been initialized. */ void SetColorMode( ColorMode colorMode ); @@ -1094,23 +1116,23 @@ public: * @brief Returns the actor's color mode. * * @SINCE_1_0.0 - * @return currently used colorMode. + * @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. + * @brief Retrieves the world-color of the Actor, where each component is clamped within the 0->1 range. * * @SINCE_1_0.0 - * @return The Actor's current color in the world. + * @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; /** - * @brief Set how the actor and its children should be drawn. + * @brief Sets how the actor and its children should be drawn. * * Not all actors are renderable, but DrawMode can be inherited from any actor. * If an object is in a 3D layer, it will be depth-tested against @@ -1122,16 +1144,16 @@ public: * and depth-testing will not be used. * @SINCE_1_0.0 - * @param[in] drawMode The new draw-mode to use. + * @param[in] drawMode The new draw-mode to use * @note Layers do not inherit the DrawMode from their parents. */ void SetDrawMode( DrawMode::Type drawMode ); /** - * @brief Query how the actor and its children will be drawn. + * @brief Queries how the actor and its children will be drawn. * * @SINCE_1_0.0 - * @return Return the draw mode type. + * @return Return the draw mode type */ DrawMode::Type GetDrawMode() const; @@ -1155,7 +1177,7 @@ public: * @endcode * * @SINCE_1_0.0 - * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise. + * @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 @@ -1165,10 +1187,10 @@ public: void SetSensitive(bool sensitive); /** - * @brief Query whether an actor emits touch or hover event signals. + * @brief Queries 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. + * @return @c true, if emission of touch or hover event signals is enabled, @c 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 @@ -1180,11 +1202,11 @@ public: * @brief Converts screen coordinates into the actor's coordinate system using the default camera. * * @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. + * @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) */ @@ -1195,7 +1217,7 @@ public: * the boundary of the actor. * * @SINCE_1_0.0 - * @param[in] required Should be set to true if a Leave event is required + * @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 TouchedSignal() or HoveredSignal() to actually receive this event. @@ -1208,7 +1230,7 @@ public: * the boundary of the actor. * * @SINCE_1_0.0 - * @return True if a Leave event is required, false otherwise. + * @return @c true if a Leave event is required, @c false otherwise * @pre The Actor has been initialized. */ bool GetLeaveRequired() const; @@ -1219,7 +1241,7 @@ public: * The default is false. * @SINCE_1_0.0 * @param[in] focusable - true if the actor should be focusable by keyboard navigation, - * false otherwise. + * false otherwise * @pre The Actor has been initialized. */ void SetKeyboardFocusable( bool focusable ); @@ -1228,33 +1250,91 @@ public: * @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. + * @return @c true if the actor is focusable by keyboard navigation, @c false if not * @pre The Actor has been initialized. */ bool IsKeyboardFocusable() const; + /** + * @brief Raise actor above the next sibling actor. + * + * @SINCE_1_2.60 + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + */ + void Raise(); + + /** + * @brief Lower the actor below the previous sibling actor. + * + * @SINCE_1_2.60 + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + */ + void Lower(); + + /** + * @brief Raise actor above all other sibling actors. + * + * @SINCE_1_2.60 + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + */ + void RaiseToTop(); + + /** + * @brief Lower actor to the bottom of all other sibling actors. + * + * @SINCE_1_2.60 + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + */ + void LowerToBottom(); + + /** + * @brief Raises the actor above the target actor. + * + * @SINCE_1_2.60 + * @param[in] target The target actor + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + * @pre The target actor is a sibling. + */ + void RaiseAbove( Actor target ); + + /** + * @brief Lower the actor to below the target actor. + * + * @SINCE_1_2.60 + * @param[in] target The target actor + * @pre The Actor has been initialized. + * @pre The Actor has been parented. + * @pre The target actor is a sibling. + */ + void LowerBelow( Actor target ); + // SIZE NEGOTIATION /** - * @brief Set the resize policy to be used for the given dimension(s). + * @brief Sets 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. + * @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. + * @brief Returns 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. + * @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. + * @brief Sets 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 @@ -1262,10 +1342,10 @@ public: void SetSizeScalePolicy( SizeScalePolicy::Type policy ); /** - * @brief Return the size scale policy in use. + * @brief Returns the size scale policy in use. * * @SINCE_1_0.0 - * @return Return the size scale policy. + * @return Return the size scale policy */ SizeScalePolicy::Type GetSizeScalePolicy() const; @@ -1274,59 +1354,59 @@ public: * * 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, + * This actor's size is set to the actor's size multiplied 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. + * @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. + * @brief Retrieves the relative to parent size factor of the actor. * * @SINCE_1_0.0 - * @return The Actor's current relative size factor. + * @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. + * @brief Calculates 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. + * @param[in] 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. + * @brief Calculates 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. + * @param[in] 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. + * @brief Returns 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. + * @param[in] 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. + * @brief Sets the padding for use in layout. * * @SINCE_1_0.0 * @param[in] padding Padding for the actor @@ -1334,15 +1414,15 @@ public: void SetPadding( const Padding& padding ); /** - * @brief Return the value of the padding. + * @brief Returns the value of the padding. * * @SINCE_1_0.0 - * @param paddingOut The returned padding data + * @param[in] paddingOut The returned padding data */ void GetPadding( Padding& paddingOut ) const; /** - * @brief Set the minimum size an actor can be assigned in size negotiation. + * @brief Sets the minimum size an actor can be assigned in size negotiation. * * @SINCE_1_0.0 * @param[in] size The minimum size @@ -1350,15 +1430,15 @@ public: void SetMinimumSize( const Vector2& size ); /** - * @brief Return the minimum relayout size. + * @brief Returns the minimum relayout size. * * @SINCE_1_0.0 - * @return Return the mininmum size. + * @return Return the minimum size */ Vector2 GetMinimumSize(); /** - * @brief Set the maximum size an actor can be assigned in size negotiation. + * @brief Sets the maximum size an actor can be assigned in size negotiation. * * @SINCE_1_0.0 * @param[in] size The maximum size @@ -1366,25 +1446,25 @@ public: void SetMaximumSize( const Vector2& size ); /** - * @brief Return the maximum relayout size. + * @brief Returns the maximum relayout size. * * @SINCE_1_0.0 - * @return Return the maximum size. + * @return Return the maximum size */ Vector2 GetMaximumSize(); /** - * @brief Get depth in the hierarchy for the actor. + * @brief Gets 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 + * @return The current depth in the hierarchy of the actor, or @c -1 if actor is not in the hierarchy */ - int GetHierarchyDepth(); + int32_t GetHierarchyDepth(); public: // Renderer /** - * @brief Add a renderer to this actor. + * @brief Adds a renderer to this actor. * * @SINCE_1_0.0 * @param[in] renderer Renderer to add to the actor @@ -1392,18 +1472,18 @@ public: // Renderer * @pre The renderer must be initialized. * */ - unsigned int AddRenderer( Renderer& renderer ); + uint32_t AddRenderer( Renderer& renderer ); /** - * @brief Get the number of renderers on this actor. + * @brief Gets the number of renderers on this actor. * * @SINCE_1_0.0 - * @return the number of renderers on this actor + * @return The number of renderers on this actor */ - unsigned int GetRendererCount() const; + uint32_t GetRendererCount() const; /** - * @brief Get a Renderer by index. + * @brief Gets a Renderer by index. * * @SINCE_1_0.0 * @param[in] index The index of the renderer to fetch @@ -1411,10 +1491,10 @@ public: // Renderer * @pre The index must be between 0 and GetRendererCount()-1 * */ - Renderer GetRendererAt( unsigned int index ); + Renderer GetRendererAt( uint32_t index ); /** - * @brief Remove an renderer from the actor. + * @brief Removes a renderer from the actor. * * @SINCE_1_0.0 * @param[in] renderer Handle to the renderer that is to be removed @@ -1422,14 +1502,14 @@ public: // Renderer void RemoveRenderer( Renderer& renderer ); /** - * @brief Remove an renderer from the actor by index. + * @brief Removes a 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 ); + void RemoveRenderer( uint32_t index ); public: // Signals @@ -1444,10 +1524,10 @@ public: // Signals * 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. * @SINCE_1_0.0 - * @return The signal to connect to. + * @return The signal to connect to * @pre The Actor has been initialized. */ - TouchSignalType& TouchedSignal(); + TouchSignalType& TouchedSignal() DALI_DEPRECATED_API; /** * @brief This signal is emitted when touch input is received. @@ -1459,7 +1539,7 @@ public: // Signals * 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. + * @return The signal to connect to * @pre The Actor has been initialized. */ TouchDataSignalType& TouchSignal(); @@ -1474,7 +1554,7 @@ public: // Signals * 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. * @SINCE_1_0.0 - * @return The signal to connect to. + * @return The signal to connect to * @pre The Actor has been initialized. */ HoverSignalType& HoveredSignal(); @@ -1489,7 +1569,7 @@ public: // Signals * 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. * @SINCE_1_0.0 - * @return The signal to connect to. + * @return The signal to connect to * @pre The Actor has been initialized. */ WheelEventSignalType& WheelEventSignal(); @@ -1499,7 +1579,7 @@ public: // Signals * * 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. + * @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 @@ -1524,7 +1604,7 @@ 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. + * @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. @@ -1550,6 +1630,22 @@ public: // Signals */ OnRelayoutSignalType& OnRelayoutSignal(); + /** + * @brief This signal is emitted when the layout direction property of this or a parent actor is changed. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( Actor actor, LayoutDirection::Type type ); + * @endcode + * actor: The actor, or child of actor, whose layout direction has changed + * type: Whether the actor's layout direction property has changed or a parent's. + * + * @SINCE_1_2.60 + * @return The signal to connect to + * @pre The Actor has been initialized. + */ + LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal(); + public: // Not intended for application developers /// @cond internal @@ -1569,7 +1665,7 @@ public: // Not intended for application developers * If the handle is empty, this method does nothing. Otherwise * 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. + * @param[in,out] actor A handle to an actor, or an empty handle */ inline void UnparentAndReset( Actor& actor ) {