X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Factor.h;h=1d6035bfdc835211de79070674d746fd95cc35bb;hb=ebe1a7337f5b09ac1f7616fbc61a67a30dddabf2;hp=28f5be1da00a0bed8fab0b6354951e1f2e032c1e;hpb=8f2c7a1c1ad470b02521b862607a60d966e217f1;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index 28f5be1..1d6035b 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) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,15 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES -#include -#include #include #include -#include -#include +#include +#include +#include +#include namespace Dali { @@ -39,31 +38,18 @@ class Actor; } class Actor; -class Animation; -class Constraint; struct Degree; -class DynamicsBody; -class DynamicsBodyConfig; -class DynamicsJoint; class Quaternion; class Layer; -struct Radian; struct KeyEvent; 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 /** * @brief Actor is the primary object with which Dali applications interact. @@ -85,6 +71,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. * @@ -227,82 +217,96 @@ typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for D * Key events are received by an actor once set to grab key events, only one actor can be set as focused. * * @nosubgrouping + * + * Signals + * | %Signal Name | Method | + * |-------------------|------------------------------| + * | touched | @ref TouchedSignal() | + * | hovered | @ref HoveredSignal() | + * | wheel-event | @ref WheelEventSignal() | + * | on-stage | @ref OnStageSignal() | + * | off-stage | @ref OffStageSignal() | + * + * Actions + * | %Action Name | %Actor method called | + * |-------------------|------------------------------| + * | show | %SetVisible( true ) | + * | hide | %SetVisible( false ) | */ -class DALI_IMPORT_API Actor : public Constrainable +class DALI_IMPORT_API Actor : public Handle { public: + /** + * @brief An enumeration of properties belonging to the Actor class. + */ + struct Property + { + enum + { + PARENT_ORIGIN = DEFAULT_ACTOR_PROPERTY_START_INDEX, ///< name "parent-origin", type Vector3 + PARENT_ORIGIN_X, ///< name "parent-origin-x", type float + PARENT_ORIGIN_Y, ///< name "parent-origin-y", type float + PARENT_ORIGIN_Z, ///< name "parent-origin-z", type float + ANCHOR_POINT, ///< name "anchor-point", type Vector3 + ANCHOR_POINT_X, ///< name "anchor-point-x", type float + ANCHOR_POINT_Y, ///< name "anchor-point-y", type float + ANCHOR_POINT_Z, ///< name "anchor-point-z", type float + SIZE, ///< name "size", type Vector3 + SIZE_WIDTH, ///< name "size-width", type float + SIZE_HEIGHT, ///< name "size-height", type float + SIZE_DEPTH, ///< name "size-depth", type float + POSITION, ///< name "position", type Vector3 + POSITION_X, ///< name "position-x", type float + POSITION_Y, ///< name "position-y", type float + POSITION_Z, ///< name "position-z", type float + WORLD_POSITION, ///< name "world-position", type Vector3 (read-only) + WORLD_POSITION_X, ///< name "world-position-x", type float (read-only) + WORLD_POSITION_Y, ///< name "world-position-y", type float (read-only) + WORLD_POSITION_Z, ///< name "world-position-z", type float (read-only) + ORIENTATION, ///< name "orientation", type Quaternion + WORLD_ORIENTATION, ///< name "world-orientation", type Quaternion (read-only) + SCALE, ///< name "scale", type Vector3 + SCALE_X, ///< name "scale-x", type float + SCALE_Y, ///< name "scale-y", type float + SCALE_Z, ///< name "scale-z", type float + WORLD_SCALE, ///< name "world-scale", type Vector3 (read-only) + VISIBLE, ///< name "visible", type bool + COLOR, ///< name "color", type Vector4 + COLOR_RED, ///< name "color-red", type float + COLOR_GREEN, ///< name "color-green", type float + COLOR_BLUE, ///< name "color-blue", type float + COLOR_ALPHA, ///< name "color-alpha", type float + WORLD_COLOR, ///< name "world-color", type Vector4 (read-only) + WORLD_MATRIX, ///< name "world-matrix", type Matrix (read-only) + NAME, ///< name "name", type std::string + SENSITIVE, ///< name "sensitive", type bool + LEAVE_REQUIRED, ///< name "leave-required", type bool + INHERIT_ORIENTATION, ///< name "inherit-orientation", type bool + INHERIT_SCALE, ///< name "inherit-scale", type bool + COLOR_MODE, ///< name "color-mode", type std::string + POSITION_INHERITANCE, ///< name "position-inheritance", type std::string + DRAW_MODE, ///< name "draw-mode", type std::string + SIZE_MODE_FACTOR, ///< name "size-mode-factor", type Vector3 + WIDTH_RESIZE_POLICY, ///< name "width-resize-policy", type String + HEIGHT_RESIZE_POLICY, ///< name "height-resize-policy", type String + SIZE_SCALE_POLICY, ///< name "size-scale-policy", type String + WIDTH_FOR_HEIGHT, ///< name "width-for-height", type Boolean + HEIGHT_FOR_WIDTH, ///< name "height-for-width", type Boolean + PADDING, ///< name "padding", type Vector4 + MINIMUM_SIZE, ///< name "minimum-size", type Vector2 + MAXIMUM_SIZE, ///< name "maximum-size", type Vector2 + }; + }; + // Typedefs - typedef SignalV2< bool (Actor, const TouchEvent&)> TouchSignalV2; ///< Touch signal type - typedef SignalV2< bool (Actor, const HoverEvent&)> HoverSignalV2; ///< Hover signal type - typedef SignalV2< bool (Actor, const MouseWheelEvent&) > MouseWheelEventSignalV2;///< Mousewheel signal type - typedef SignalV2< void (Actor, const Vector3&) > SetSizeSignalV2; ///< SetSize signal type - typedef SignalV2< void (Actor) > OnStageSignalV2; ///< Stage connection signal type - typedef SignalV2< void (Actor) > OffStageSignalV2; ///< 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 - /** @} */ - - /// @name Signals - /** @{ */ - static const char* const SIGNAL_TOUCHED; ///< name "touched", @see TouchedSignal() - static const char* const SIGNAL_HOVERED; ///< name "hovered", @see HoveredSignal() - static const char* const SIGNAL_MOUSE_WHEEL_EVENT; ///< name "mouse-wheel-event", @see MouseWheelEventSignal() - static const char* const SIGNAL_SET_SIZE; ///< name "set-size", @see SetSizeSignal() - static const char* const SIGNAL_ON_STAGE; ///< name "on-stage", @see OnStageSignal() - static const char* const SIGNAL_OFF_STAGE; ///< name "off-stage", @see OffStageSignal() - /** @} */ - - /// @name Actions - /** @{ */ - static const char* const ACTION_SHOW; ///< name "show", @see SetVisible() - static const char* const ACTION_HIDE; ///< name "hide", @see SetVisible() - /** @} */ + 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 WheelEvent&) > WheelEventSignalType; ///< Wheel signal type + typedef Signal< void (Actor) > OnStageSignalType; ///< Stage connection signal type + typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type + typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out // Creation @@ -425,7 +429,6 @@ public: * @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); @@ -444,7 +447,6 @@ public: * @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. */ void Insert(unsigned int index, Actor child); @@ -455,7 +457,6 @@ public: * @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); @@ -464,7 +465,6 @@ public: * * If the actor has no parent, this method does nothing. * @pre The (child) actor has been initialized. - * @post This may invalidate ActorContainer iterators. */ void Unparent(); @@ -496,18 +496,6 @@ public: 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); - - /** * @brief Search through this actor's hierarchy for an actor with the given unique ID. * * The actor itself is also considered in the search @@ -558,7 +546,7 @@ 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. + * An actor's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point. * @see Dali::AnchorPoint for predefined anchor point values * @pre The Actor has been initialized. * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentAnchorPoint(). @@ -631,7 +619,7 @@ public: * @note This return is the value that was set using SetSize or the target size of an animation * @return The actor's current size. */ - Vector3 GetSize() const; + Vector3 GetTargetSize() const; /** * @brief Retrieve the actor's size. @@ -710,12 +698,12 @@ public: 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. * @param[in] distance The actor will move by this distance. */ - void MoveBy(const Vector3& distance); + void TranslateBy(const Vector3& distance); /** * @brief Retrieve the position of the Actor. @@ -755,51 +743,58 @@ public: PositionInheritanceMode GetPositionInheritanceMode() const; /** - * @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. * @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(). + * @param [in] angle The new orientation angle in degrees. + * @param [in] axis The new axis of orientation. */ - 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. * @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(). + * @param [in] angle The new orientation angle in radians. + * @param [in] axis The new axis of orientation. */ - 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. * @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(). + * @param [in] orientation The new orientation. */ - void SetRotation(const Quaternion& rotation); + void SetOrientation(const Quaternion& orientation); /** * @brief Apply a relative rotation to an actor. * * @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. + * @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. */ - 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. * * @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. + * @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. */ void RotateBy(const Radian& angle, const Vector3& axis); @@ -807,28 +802,28 @@ public: * @brief Apply a relative rotation to an actor. * * @pre The actor has been initialized. - * @param[in] relativeRotation The rotation to combine with the existing rotation. + * @param[in] relativeRotation The rotation to combine with the existing orientation. */ void RotateBy(const Quaternion& relativeRotation); /** - * @brief Retreive the Actor's rotation. + * @brief Retreive the Actor's 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(). + * @return The current orientation. */ - 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. + * Switching this off means that using SetOrientation() sets the actor's world orientation. * @pre The Actor has been initialized. * @param[in] inherit - true if the actor should inherit orientation, false otherwise. */ - void SetInheritRotation(bool inherit); + void SetInheritOrientation(bool inherit); /** * @brief Returns whether the actor inherit's it's parent's orientation. @@ -836,16 +831,16 @@ public: * @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. + * @note The actor will not have a world-orientation, unless it has previously been added to the stage. * @pre The Actor has been initialized. - * @return The Actor's current rotation in the world. + * @return The Actor's current orientation in the world. */ - Quaternion GetCurrentWorldRotation() const; + Quaternion GetCurrentWorldOrientation() const; /** * @brief Set the scale factor applied to an actor. @@ -965,14 +960,6 @@ public: 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. * * @pre The actor has been initialized. @@ -992,14 +979,6 @@ public: 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. @@ -1141,7 +1120,7 @@ public: /** * @brief Sets whether the actor should be focusable by keyboard navigation. * - * The default is true. + * The default is false. * @pre The Actor has been initialized. * @param[in] focusable - true if the actor should be focusable by keyboard navigation, * false otherwise. @@ -1156,6 +1135,131 @@ public: */ bool IsKeyboardFocusable() const; + // SIZE NEGOTIATION + + /** + * Set the resize policy to be used for the given dimension(s) + * + * @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 ); + + /** + * Return the resize policy used for a single dimension + * + * @param[in] dimension The dimension to get policy for + * @return Return the dimension resize policy + */ + 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. + * + * @param[in] policy The policy to use for when the size is set + */ + void SetSizeScalePolicy( SizeScalePolicy::Type policy ); + + /** + * @brief Return the size set policy in use + * + * @return Return the size set 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). + * + * @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 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. + * + * @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. + * + * @param height Height to use + * @return Return the width based on the height + */ + float GetWidthForHeight( float height ); + + /** + * Return the value of negotiated dimension for the given dimension + * + * @param dimension The dimension to retrieve + * @return Return the value of the negotiated dimension + */ + float GetRelayoutSize( Dimension::Type dimension ) const; + + /** + * @brief Set the padding for use in layout + * + * @param[in] padding Padding for the actor + */ + void SetPadding( const Padding& padding ); + + /** + * Return the value of the padding + * + * @param paddingOut The returned padding data + */ + void GetPadding( Padding& paddingOut ) const; + + /** + * @brief Set the minimum size an actor can be assigned in size negotiation + * + * @param[in] size The minimum size + */ + void SetMinimumSize( const Vector2& size ); + + /** + * @brief Return the minimum relayout size + * + * @return Return the mininmum size + */ + Vector2 GetMinimumSize(); + + /** + * @brief Set the maximum size an actor can be assigned in size negotiation + * + * @param[in] size The maximum size + */ + void SetMaximumSize( const Vector2& size ); + + /** + * @brief Return the maximum relayout size + * + * @return Return the maximum size + */ + Vector2 GetMaximumSize(); + public: // Signals /** @@ -1170,7 +1274,7 @@ public: // Signals * @pre The Actor has been initialized. * @return The signal to connect to. */ - TouchSignalV2& TouchedSignal(); + TouchSignalType& TouchedSignal(); /** * @brief This signal is emitted when hover input is received. @@ -1184,36 +1288,21 @@ public: // Signals * @pre The Actor has been initialized. * @return The signal to connect to. */ - HoverSignalV2& HoveredSignal(); + 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. * @return The signal to connect to. */ - MouseWheelEventSignalV2& MouseWheelEventSignal(); - - /** - * @brief Signal to indicate when the actor's size is set by application code. - * - * This signal is emitted when actors size is being set by application code. - * This signal is not emitted when size is animated - * Note! GetCurrentSize might not return this same size as the set size message may still be queued - * A callback of the following type may be connected: - * @code - * void YourCallback(Actor actor, const Vector3& newSize); - * @endcode - * @pre The Actor has been initialized. - * @return The signal to connect to. - */ - SetSizeSignalV2& SetSizeSignal(); + WheelEventSignalType& WheelEventSignal(); /** * @brief This signal is emitted after the actor has been connected to the stage. @@ -1234,7 +1323,7 @@ public: // Signals * * @return The signal */ - OnStageSignalV2& OnStageSignal(); + OnStageSignalType& OnStageSignal(); /** * @brief This signal is emitted after the actor has been disconnected from the stage. @@ -1254,90 +1343,14 @@ public: // Signals * * @return The signal */ - OffStageSignalV2& 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 - */ - const 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. - * - * 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 + * @return Return the signal */ - DynamicsBody GetDynamicsBody(); + OnRelayoutSignalType& OnRelayoutSignal(); public: // Not intended for application developers