X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Factor.h;h=8d3e9b660b177c21227b9398daf8fda7af30f2d9;hb=adae31cf70bdeed19789edc694d4baaf2fc67f21;hp=e828e59b0f72da43849411df3c9a44c57826c456;hpb=54d72d6ca393e8237a3d179bf69dd365251e1717;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index e828e59..8d3e9b6 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) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ */ // EXTERNAL INCLUDES -#include #include // uint32_t +#include // INTERNAL INCLUDES #include @@ -49,16 +49,14 @@ class Renderer; struct Degree; class Quaternion; class Layer; -struct KeyEvent; -class TouchData; -struct TouchEvent; -struct HoverEvent; -struct WheelEvent; +class TouchEvent; +class HoverEvent; +class WheelEvent; struct Vector2; struct Vector3; struct Vector4; -typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 +using Padding = Rect; ///< Padding definition @SINCE_1_0.0 /** * @brief Actor is the primary object with which Dali applications interact. @@ -104,7 +102,7 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * // Only hit-test the actor and its children if it is sensitive and visible * IF ( ACTOR-IS-SENSITIVE && * ACTOR-IS-VISIBLE && - * ACTOR-IS-ON-STAGE ) + * ACTOR-IS-ON-SCENE ) * { * // Depth-first traversal within current layer, visiting parent first * @@ -217,10 +215,6 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * - 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. - * * @nosubgrouping * * Signals @@ -229,8 +223,8 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 * | touched | @ref TouchedSignal() | * | hovered | @ref HoveredSignal() | * | wheelEvent | @ref WheelEventSignal() | - * | onStage | @ref OnStageSignal() | - * | offStage | @ref OffStageSignal() | + * | onScene | @ref OnSceneSignal() | + * | offScene | @ref OffSceneSignal() | * | onRelayout | @ref OnRelayoutSignal() | * * Actions @@ -244,7 +238,6 @@ typedef Rect Padding; ///< Padding definition @SINCE_1_0.0 class DALI_CORE_API Actor : public Handle { public: - /** * @brief Enumeration for the instance of properties belonging to the Actor class. * @SINCE_1_0.0 @@ -731,19 +724,27 @@ public: * @SINCE_1_9.17 */ KEYBOARD_FOCUSABLE, + + /** + * @brief Sets the update area hint of the actor. + * @details Name "updateAreaHint", type Property::VECTOR4 (x, y, width, height). + * @note Overrides the area - the position and the size - used for the actor damaged area calculation. Affected by the actor model view matrix. + * The position is relative to the center of the actor and it is also the center of the damaged area. + * @SINCE_2_1.33 + */ + UPDATE_AREA_HINT }; }; // Typedefs - 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 - typedef Signal< void ( Actor, LayoutDirection::Type ) > LayoutDirectionChangedSignalType; ///< Layout direction changes signal type. @SINCE_1_2.60 + using TouchEventSignalType = Signal; ///< Touch signal type @SINCE_1_1.37 + using HoverSignalType = Signal; ///< Hover signal type @SINCE_1_0.0 + using WheelEventSignalType = Signal; ///< Wheel signal type @SINCE_1_0.0 + using OnSceneSignalType = Signal; ///< Scene connection signal type @SINCE_1_9.24 + using OffSceneSignalType = Signal; ///< Scene disconnection signal type @SINCE_1_9.24 + using OnRelayoutSignalType = Signal; ///< Called when the actor is relaid out @SINCE_1_0.0 + using LayoutDirectionChangedSignalType = Signal; ///< Layout direction changes signal type. @SINCE_1_2.60 // Creation @@ -773,7 +774,7 @@ public: * @param[in] handle to An object * @return handle to a Actor object or an uninitialized handle */ - static Actor DownCast( BaseHandle handle ); + static Actor DownCast(BaseHandle handle); /** * @brief Dali::Actor is intended as a base class. @@ -806,7 +807,7 @@ public: * @SINCE_1_9.22 * @param[in] rhs A reference to the actor to move */ - Actor( Actor&& rhs ); + Actor(Actor&& rhs) noexcept; /** * @brief Move assignment operator. @@ -815,7 +816,7 @@ public: * @param[in] rhs A reference to the actor to move * @return A reference to this */ - Actor& operator=( Actor&& rhs ); + Actor& operator=(Actor&& rhs) noexcept; // Containment @@ -882,18 +883,18 @@ public: * @return The actor for the given index or empty handle if children not initialized * @pre The Actor has been initialized. */ - Actor GetChildAt( uint32_t 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 + * @SINCE_2_0.9 * @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); + Actor FindChildByName(std::string_view actorName); /** * @brief Search through this actor's hierarchy for an actor with the given unique ID. @@ -904,7 +905,7 @@ public: * @return A handle to the actor if found, or an empty handle if not * @pre The Actor has been initialized. */ - Actor FindChildById( const uint32_t id ); + Actor FindChildById(const uint32_t id); /** * @brief Retrieves the actor's parent. @@ -955,9 +956,9 @@ public: * @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 ) + void RotateBy(const Degree& angle, const Vector3& axis) { - RotateBy( Radian( angle ), axis ); + RotateBy(Radian(angle), axis); } /** @@ -1049,7 +1050,7 @@ public: * @pre The Actor has been parented. * @pre The target actor is a sibling. */ - void RaiseAbove( Actor target ); + void RaiseAbove(Actor target); /** * @brief Lower the actor to below the target actor. @@ -1060,7 +1061,7 @@ public: * @pre The Actor has been parented. * @pre The target actor is a sibling. */ - void LowerBelow( Actor target ); + void LowerBelow(Actor target); // SIZE NEGOTIATION @@ -1071,7 +1072,7 @@ public: * @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 ); + void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension); /** * @brief Returns the resize policy used for a single dimension. @@ -1080,7 +1081,7 @@ public: * @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; + ResizePolicy::Type GetResizePolicy(Dimension::Type dimension) const; /** * @brief Calculates the height of the actor given a width. @@ -1092,7 +1093,7 @@ public: * @param[in] width Width to use * @return Return the height based on the width */ - float GetHeightForWidth( float width ); + float GetHeightForWidth(float width); /** * @brief Calculates the width of the actor given a height. @@ -1104,7 +1105,7 @@ public: * @param[in] height Height to use * @return Return the width based on the height */ - float GetWidthForHeight( float height ); + float GetWidthForHeight(float height); /** * @brief Returns the value of negotiated dimension for the given dimension. @@ -1113,10 +1114,9 @@ public: * @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; + float GetRelayoutSize(Dimension::Type dimension) const; public: // Renderer - /** * @brief Adds a renderer to this actor. * @@ -1126,7 +1126,7 @@ public: // Renderer * @pre The renderer must be initialized. * */ - uint32_t AddRenderer( Renderer& renderer ); + uint32_t AddRenderer(Renderer& renderer); /** * @brief Gets the number of renderers on this actor. @@ -1145,7 +1145,7 @@ public: // Renderer * @pre The index must be between 0 and GetRendererCount()-1 * */ - Renderer GetRendererAt( uint32_t index ); + Renderer GetRendererAt(uint32_t index); /** * @brief Removes a renderer from the actor. @@ -1153,7 +1153,7 @@ public: // Renderer * @SINCE_1_0.0 * @param[in] renderer Handle to the renderer that is to be removed */ - void RemoveRenderer( Renderer& renderer ); + void RemoveRenderer(Renderer& renderer); /** * @brief Removes a renderer from the actor by index. @@ -1163,40 +1163,23 @@ public: // Renderer * @pre The index must be between 0 and GetRendererCount()-1 * */ - void RemoveRenderer( uint32_t index ); + void RemoveRenderer(uint32_t 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: - * @code - * bool YourCallbackName(Actor actor, const TouchEvent& event); - * @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. - * @SINCE_1_0.0 - * @return The signal to connect to - * @pre The Actor has been initialized. - */ - TouchSignalType& TouchedSignal() DALI_DEPRECATED_API; - /** * @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 ); + * bool YourCallbackName( Actor actor, TouchEvent& 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 + * @SINCE_1_9.28 * @return The signal to connect to * @pre The Actor has been initialized. */ - TouchDataSignalType& TouchSignal(); + TouchEventSignalType& TouchedSignal(); /** * @brief This signal is emitted when hover input is received. @@ -1229,12 +1212,12 @@ public: // Signals WheelEventSignalType& WheelEventSignal(); /** - * @brief This signal is emitted after the actor has been connected to the stage. + * @brief This signal is emitted after the actor has been connected to the scene. * * When an actor is connected, it will be directly or indirectly parented to the root Actor. - * @SINCE_1_0.0 + * @SINCE_1_9.24 * @return The signal to connect to - * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected. + * @note The root Actor is provided automatically by the Scene, 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. @@ -1250,16 +1233,16 @@ public: // Signals * * @endcode */ - OnStageSignalType& OnStageSignal(); + OnSceneSignalType& OnSceneSignal(); /** - * @brief This signal is emitted after the actor has been disconnected from the stage. + * @brief This signal is emitted after the actor has been disconnected from the scene. * * If an actor is disconnected it either has no parent, or is parented to a disconnected actor. * - * @SINCE_1_0.0 + * @SINCE_1_9.24 * @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 + * @note When the parent of a set of actors is disconnected to the scene, 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. * @@ -1274,7 +1257,7 @@ public: // Signals * @endcode * */ - OffStageSignalType& OffStageSignal(); + OffSceneSignalType& OffSceneSignal(); /** * @brief This signal is emitted after the size has been set on the actor during relayout @@ -1301,7 +1284,6 @@ public: // Signals LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal(); public: // Not intended for application developers - /// @cond internal /** * @brief This constructor is used by Actor::New() methods. @@ -1321,9 +1303,9 @@ public: // Not intended for application developers * @SINCE_1_0.0 * @param[in,out] actor A handle to an actor, or an empty handle */ -inline void UnparentAndReset( Actor& actor ) +inline void UnparentAndReset(Actor& actor) { - if( actor ) + if(actor) { actor.Unparent(); actor.Reset();