1 #ifndef DALI_INTERNAL_ACTOR_H
2 #define DALI_INTERNAL_ACTOR_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
25 #include <dali/public-api/actors/actor.h>
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/public-api/common/vector-wrapper.h>
28 #include <dali/public-api/events/gesture.h>
29 #include <dali/public-api/math/viewport.h>
30 #include <dali/public-api/object/ref-object.h>
31 #include <dali/public-api/size-negotiation/relayout-container.h>
33 #include <dali/devel-api/actors/actor-devel.h>
34 #include <dali/devel-api/rendering/renderer-devel.h>
36 #include <dali/integration-api/events/touch-event-integ.h>
38 #include <dali/internal/common/const-string.h>
39 #include <dali/internal/common/internal-constants.h>
40 #include <dali/internal/common/memory-pool-object-allocator.h>
41 #include <dali/internal/event/actors/actor-declarations.h>
42 #include <dali/internal/event/actors/actor-parent-impl.h>
43 #include <dali/internal/event/actors/actor-parent.h>
44 #include <dali/internal/event/actors/actor-renderer-container.h>
45 #include <dali/internal/event/actors/actor-sizer.h>
46 #include <dali/internal/event/common/object-impl.h>
47 #include <dali/internal/event/common/stage-def.h>
48 #include <dali/internal/update/nodes/node-declarations.h>
60 class ActorGestureData;
67 * Actor is the primary object with which Dali applications interact.
68 * UI controls can be built by combining multiple actors.
69 * Multi-Touch events are received through signals emitted by the actor tree.
71 * An Actor is a proxy for a Node in the scene graph.
72 * When an Actor is added to the Stage, it creates a node and connects it to the scene graph.
73 * The scene-graph can be updated in a separate thread, so the connection is done using an asynchronous message.
74 * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
76 class Actor : public Object, public ActorParent
81 * @return A smart-pointer to the newly allocated Actor.
83 static ActorPtr New();
86 * Helper to create node for derived classes who don't have their own node type
87 * @return pointer to newly created unique node
89 static const SceneGraph::Node* CreateNode();
92 * Retrieve the name of the actor.
95 std::string_view GetName() const
97 return mName.GetStringView();
101 * Set the name of the actor.
102 * @param[in] name The new name.
104 void SetName(std::string_view name);
107 * @copydoc Dali::Actor::GetId
109 uint32_t GetId() const;
114 * Query whether an actor is the root actor, which is owned by the Stage.
115 * @return True if the actor is a root actor.
123 * Query whether the actor is connected to the Scene.
131 * Query whether the actor has any renderers.
132 * @return True if the actor is renderable.
134 bool IsRenderable() const
136 // inlined as this is called a lot in hit testing
137 return mRenderers && !mRenderers->IsEmpty();
141 * Query whether the actor is of class Dali::Layer
142 * @return True if the actor is a layer.
146 // inlined as this is called a lot in hit testing
151 * Gets the layer in which the actor is present
152 * @return The layer, which will be uninitialized if the actor is off-stage.
154 Dali::Layer GetLayer();
157 * @copydoc Dali::Internal::ActorParent::Add()
159 void Add(Actor& child, bool notify = true) override;
162 * @copydoc Dali::Internal::ActorParent::Remove()
164 void Remove(Actor& child, bool notify = true) override;
167 * @copydoc Dali::DevelActor::SwitchParent()
169 void SwitchParent(Actor& newParent);
172 * @copydoc Dali::Actor::Unparent
177 * @copydoc Dali::Internal::ActorParent::GetChildCount()
179 uint32_t GetChildCount() const override;
182 * @copydoc Dali::Internal::ActorParent::GetChildAt
184 ActorPtr GetChildAt(uint32_t index) const override;
187 * Retrieve a reference to Actor's children.
188 * @note Not for public use.
189 * @return A reference to the container of children.
190 * @note The internal container is lazily initialized so ensure you check the child count before using the value returned by this method.
192 ActorContainer& GetChildrenInternal();
195 * @copydoc Dali::Internal::ActorParent::FindChildByName
197 ActorPtr FindChildByName(ConstString actorName) override;
200 * @copydoc Dali::Internal::ActorParent::FindChildById
202 ActorPtr FindChildById(const uint32_t id) override;
205 * @copydoc Dali::Internal::ActorParent::UnparentChildren
207 void UnparentChildren() override;
210 * Retrieve the parent of an Actor.
211 * @return The parent actor, or NULL if the Actor does not have a parent.
213 Actor* GetParent() const
215 return static_cast<Actor*>(mParent);
219 * @brief Calculate the current position of the actor in screen coordinates using event-side properties.
221 * @return Returns the screen position of actor
223 const Vector2 CalculateScreenPosition() const;
226 * Calculates screen position and size using event-side properties.
228 * @return pair of two values, position of top-left corner on screen and size respectively.
230 Rect<> CalculateScreenExtents() const;
233 * Calculates screen position and size from current values.
235 * @return pair of two values, position of top-left corner on screen and size respectively.
237 Rect<> CalculateCurrentScreenExtents() const;
240 * @copydoc DevelActor::SetNeedGesturePropagation.
242 void SetNeedGesturePropagation(bool propagation)
244 mNeedGesturePropagation = propagation;
248 * Retrieve need gesture propagation value
249 * @return The actor's need gesture propagation value.
251 bool NeedGesturePropagation() const
253 return mNeedGesturePropagation;
257 * Sets the size of an actor.
258 * This does not interfere with the actors scale factor.
259 * @param [in] width The new width.
260 * @param [in] height The new height.
262 void SetSize(float width, float height);
265 * Sets the size of an actor.
266 * This does not interfere with the actors scale factor.
267 * @param [in] width The size of the actor along the x-axis.
268 * @param [in] height The size of the actor along the y-axis.
269 * @param [in] depth The size of the actor along the z-axis.
271 void SetSize(float width, float height, float depth);
274 * Sets the size of an actor.
275 * This does not interfere with the actors scale factor.
276 * @param [in] size The new size.
278 void SetSize(const Vector2& size);
281 * Sets the size of an actor.
282 * This does not interfere with the actors scale factor.
283 * @param [in] size The new size.
285 void SetSize(const Vector3& size);
288 * Set the width component of the Actor's size.
289 * @param [in] width The new width component.
291 void SetWidth(float width);
294 * Set the height component of the Actor's size.
295 * @param [in] height The new height component.
297 void SetHeight(float height);
300 * Set the depth component of the Actor's size.
301 * @param [in] depth The new depth component.
303 void SetDepth(float depth);
306 * Retrieve the Actor's size from event side.
307 * This size will be the size set or if animating then the target size.
308 * @return The Actor's size.
310 Vector3 GetTargetSize() const;
313 * Retrieve the Actor's size from update side.
314 * This size will be the size set or animating but will be a frame behind.
315 * @return The Actor's size.
317 const Vector3& GetCurrentSize() const;
320 * Return the natural size of the actor
322 * @return The actor's natural size
324 virtual Vector3 GetNaturalSize() const;
327 * Set the origin of an actor, within its parent's area.
328 * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
329 * and (1.0, 1.0, 0.5) is the bottom-right corner.
330 * The default parent-origin is top-left (0.0, 0.0, 0.5).
331 * An actor position is the distance between this origin, and the actors anchor-point.
332 * @param [in] origin The new parent-origin.
334 void SetParentOrigin(const Vector3& origin);
337 * Retrieve the parent-origin of an actor.
338 * @return The parent-origin.
340 const Vector3& GetCurrentParentOrigin() const;
343 * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
344 * (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.
345 * The default anchor point is top-left (0.0, 0.0, 0.5).
346 * An actor position is the distance between its parent-origin, and this anchor-point.
347 * An actor's rotation is centered around its anchor-point.
348 * @param [in] anchorPoint The new anchor-point.
350 void SetAnchorPoint(const Vector3& anchorPoint);
353 * Retrieve the anchor-point of an actor.
354 * @return The anchor-point.
356 const Vector3& GetCurrentAnchorPoint() const;
359 * If the position uses the anchor point, return the anchor point, otherwise
361 * @return The anchor point for positioning.
363 Vector3 GetAnchorPointForPosition() const;
366 * Sets the position of the Actor.
367 * The coordinates are relative to the Actor's parent.
368 * The Actor's z position will be set to 0.0f.
369 * @param [in] x The new x position
370 * @param [in] y The new y position
372 void SetPosition(float x, float y);
375 * Sets the position of the Actor.
376 * The coordinates are relative to the Actor's parent.
377 * @param [in] x The new x position
378 * @param [in] y The new y position
379 * @param [in] z The new z position
381 void SetPosition(float x, float y, float z);
384 * Sets the position of the Actor.
385 * The coordinates are relative to the Actor's parent.
386 * @param [in] position The new position.
388 void SetPosition(const Vector3& position);
391 * Set the position of an actor along the X-axis.
392 * @param [in] x The new x position
397 * Set the position of an actor along the Y-axis.
398 * @param [in] y The new y position.
403 * Set the position of an actor along the Z-axis.
404 * @param [in] z The new z position
409 * Translate an actor relative to its existing position.
410 * @param[in] distance The actor will move by this distance.
412 void TranslateBy(const Vector3& distance);
415 * Retrieve the position of the Actor.
416 * The coordinates are relative to the Actor's parent.
417 * @return the Actor's position.
419 const Vector3& GetCurrentPosition() const;
422 * Retrieve the target position of the Actor.
423 * The coordinates are relative to the Actor's parent.
424 * @return the Actor's position.
426 const Vector3& GetTargetPosition() const
428 return mTargetPosition;
432 * @copydoc Dali::Actor::GetCurrentWorldPosition()
434 const Vector3& GetCurrentWorldPosition() const;
437 * @copydoc Dali::Actor::SetInheritPosition()
439 void SetInheritPosition(bool inherit);
442 * @copydoc Dali::Actor::IsPositionInherited()
444 bool IsPositionInherited() const
446 return mInheritPosition;
450 * Sets the orientation of the Actor.
451 * @param [in] angleRadians The new orientation angle in radians.
452 * @param [in] axis The new axis of orientation.
454 void SetOrientation(const Radian& angleRadians, const Vector3& axis);
457 * Sets the orientation of the Actor.
458 * @param [in] orientation The new orientation.
460 void SetOrientation(const Quaternion& orientation);
463 * Rotate an actor around its existing rotation axis.
464 * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
465 * @param[in] axis The axis of the rotation to combine with the existing rotation.
467 void RotateBy(const Radian& angleRadians, const Vector3& axis);
470 * Apply a relative rotation to an actor.
471 * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
473 void RotateBy(const Quaternion& relativeRotation);
476 * Retreive the Actor's orientation.
477 * @return the orientation.
479 const Quaternion& GetCurrentOrientation() const;
482 * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
483 * Switching this off means that using SetOrientation() sets the actor's world orientation.
484 * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
486 void SetInheritOrientation(bool inherit);
489 * Returns whether the actor inherit's it's parent's orientation.
490 * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
492 bool IsOrientationInherited() const
494 return mInheritOrientation;
498 * Sets the factor of the parents size used for the child actor.
499 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
500 * @param[in] factor The vector to multiply the parents size by to get the childs size.
502 void SetSizeModeFactor(const Vector3& factor);
505 * Gets the factor of the parents size used for the child actor.
506 * Note: Only used if ResizePolicy is ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
507 * @return The vector being used to multiply the parents size by to get the childs size.
509 const Vector3& GetSizeModeFactor() const;
512 * @copydoc Dali::Actor::GetCurrentWorldOrientation()
514 const Quaternion& GetCurrentWorldOrientation() const;
517 * Sets a scale factor applied to an actor.
518 * @param [in] scale The scale factor applied on all axes.
520 void SetScale(float scale);
523 * Sets a scale factor applied to an actor.
524 * @param [in] scaleX The scale factor applied along the x-axis.
525 * @param [in] scaleY The scale factor applied along the y-axis.
526 * @param [in] scaleZ The scale factor applied along the z-axis.
528 void SetScale(float scaleX, float scaleY, float scaleZ);
531 * Sets a scale factor applied to an actor.
532 * @param [in] scale A vector representing the scale factor for each axis.
534 void SetScale(const Vector3& scale);
537 * Set the x component of the scale factor.
538 * @param [in] x The new x value.
540 void SetScaleX(float x);
543 * Set the y component of the scale factor.
544 * @param [in] y The new y value.
546 void SetScaleY(float y);
549 * Set the z component of the scale factor.
550 * @param [in] z The new z value.
552 void SetScaleZ(float z);
555 * Apply a relative scale to an actor.
556 * @param[in] relativeScale The scale to combine with the actors existing scale.
558 void ScaleBy(const Vector3& relativeScale);
561 * Retrieve the scale factor applied to an actor.
562 * @return A vector representing the scale factor for each axis.
564 const Vector3& GetCurrentScale() const;
567 * @copydoc Dali::Actor::GetCurrentWorldScale()
569 const Vector3& GetCurrentWorldScale() const;
572 * @copydoc Dali::Actor::SetInheritScale()
574 void SetInheritScale(bool inherit);
577 * @copydoc Dali::Actor::IsScaleInherited()
579 bool IsScaleInherited() const
581 return mInheritScale;
585 * @copydoc Dali::Actor::GetCurrentWorldMatrix()
587 Matrix GetCurrentWorldMatrix() const;
592 * Sets the visibility flag of an actor.
593 * @param[in] visible The new visibility flag.
595 void SetVisible(bool visible);
598 * Retrieve the visibility flag of an actor.
599 * @return The visibility flag.
601 bool IsVisible() const;
604 * Sets the opacity of an actor.
605 * @param [in] opacity The new opacity.
607 void SetOpacity(float opacity);
610 * Retrieve the actor's opacity.
611 * @return The actor's opacity.
613 float GetCurrentOpacity() const;
616 * Retrieve the actor's clipping mode.
617 * @return The actor's clipping mode (cached)
619 ClippingMode::Type GetClippingMode() const
621 return mClippingMode;
625 * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
626 * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
627 * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
628 * hover event signal will be emitted.
630 * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
632 * actor.SetSensitive(false);
635 * Then, to re-enable the touch or hover event signal emission, the application should call:
637 * actor.SetSensitive(true);
640 * @see SignalTouch() and SignalHover().
641 * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
642 * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
644 void SetSensitive(bool sensitive)
646 mSensitive = sensitive;
650 * Query whether an actor emits touch or hover event signals.
651 * @see SetSensitive(bool)
652 * @return true, if emission of touch or hover event signals is enabled, false otherwise.
654 bool IsSensitive() const
660 * Sets whether an actor should be enabled all user interaction including touch, focus and activation.
661 * This value have higher priority over the sensitve and focusable in negative action,
662 * which means IsSensitive() or IsFocusable() and enable is false, actor will not emits touch or focus event.
663 * An actor is enabled by default.
665 * If the application wishes to temporarily disable user interaction:
667 * actor.SetUserInteractionEnabled(false);
670 * Then, to re-enable user interaction, the application should call:
672 * actor.SetUserInteractionEnabled(true);
675 * @see IsSensitive(), IsHittable(), IsKeyboardFocusable() and IsTouchFocusable().
676 * @note If an actor's disabled, child still can be enabled.
677 * @param[in] enabled true to enable user interaction, false otherwise.
679 void SetUserInteractionEnabled(bool enabled)
681 mUserInteractionEnabled = enabled;
685 * Query whether an actor is enabled user interaction.
686 * @see SetSensitive(bool)
687 * @return true, if user interaction is enabled, false otherwise.
689 bool IsUserInteractionEnabled() const
691 return mUserInteractionEnabled;
695 * @copydoc Dali::Actor::SetDrawMode
697 void SetDrawMode(DrawMode::Type drawMode);
700 * @copydoc Dali::Actor::GetDrawMode
702 DrawMode::Type GetDrawMode() const
708 * @copydoc Dali::Actor::IsOverlay
710 bool IsOverlay() const
712 return (DrawMode::OVERLAY_2D == mDrawMode);
716 * Sets the actor's color. The final color of actor depends on its color mode.
717 * This final color is applied to the drawable elements of an actor.
718 * @param [in] color The new color.
720 void SetColor(const Vector4& color);
723 * Set the red component of the color.
724 * @param [in] red The new red component.
726 void SetColorRed(float red);
729 * Set the green component of the color.
730 * @param [in] green The new green component.
732 void SetColorGreen(float green);
735 * Set the blue component of the scale factor.
736 * @param [in] blue The new blue value.
738 void SetColorBlue(float blue);
741 * Retrieve the actor's color.
744 const Vector4& GetCurrentColor() const;
747 * Sets the actor's color mode.
748 * Color mode specifies whether Actor uses its own color or inherits its parent color
749 * @param [in] colorMode to use.
751 void SetColorMode(ColorMode colorMode);
754 * Returns the actor's color mode.
755 * @return currently used colorMode.
757 ColorMode GetColorMode() const
763 * @copydoc Dali::Actor::GetCurrentWorldColor()
765 const Vector4& GetCurrentWorldColor() const;
768 * @copydoc Dali::Actor::GetHierarchyDepth()
770 inline int32_t GetHierarchyDepth() const
781 * @brief Get the number of layer with 3D behaviour in ancestors include this. It will be 0 if actor is not on scene.
783 * @return currently the number of layer with 3D behaviour in ancestors.
785 inline int32_t GetLayer3DParentCount() const
789 return mLayer3DParentsCount;
796 * Get the actor's sorting depth
798 * @return The depth used for hit-testing and renderer sorting
800 inline uint32_t GetSortingDepth()
806 * Set the actor's sorted depth. Used during recreation of depth tree
807 * @param[in] sortedDepth the new sorted depth
809 inline void SetSortingDepth(uint32_t sortedDepth)
811 mSortedDepth = sortedDepth;
815 // Size negotiation virtual functions
818 * @brief Called after the size negotiation has been finished for this control.
820 * The control is expected to assign this given size to itself/its children.
822 * Should be overridden by derived classes if they need to layout
823 * actors differently after certain operations like add or remove
824 * actors, resize or after changing specific properties.
826 * Note! As this function is called from inside the size negotiation algorithm, you cannot
827 * call RequestRelayout (the call would just be ignored)
829 * @param[in] size The allocated size.
830 * @param[in,out] container The control should add actors to this container that it is not able
831 * to allocate a size for.
833 virtual void OnRelayout(const Vector2& size, RelayoutContainer& container)
838 * @brief Notification for deriving classes when the resize policy is set
840 * @param[in] policy The policy being set
841 * @param[in] dimension The dimension the policy is being set for
843 virtual void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
848 * @brief Virtual method to notify deriving classes that relayout dependencies have been
849 * met and the size for this object is about to be calculated for the given dimension
851 * @param dimension The dimension that is about to be calculated
853 virtual void OnCalculateRelayoutSize(Dimension::Type dimension)
858 * @brief Virtual method to notify deriving classes that the size for a dimension
859 * has just been negotiated
861 * @param[in] size The new size for the given dimension
862 * @param[in] dimension The dimension that was just negotiated
864 virtual void OnLayoutNegotiated(float size, Dimension::Type dimension)
869 * @brief Determine if this actor is dependent on it's children for relayout
871 * @param dimension The dimension(s) to check for
872 * @return Return if the actor is dependent on it's children
874 virtual bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
877 * @brief Calculate the size for a child
879 * @param[in] child The child actor to calculate the size for
880 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
881 * @return Return the calculated size for the given dimension
883 virtual float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension);
886 * @brief This method is called during size negotiation when a height is required for a given width.
888 * Derived classes should override this if they wish to customize the height returned.
890 * @param width to use.
891 * @return the height based on the width.
893 virtual float GetHeightForWidth(float width);
896 * @brief This method is called during size negotiation when a width is required for a given height.
898 * Derived classes should override this if they wish to customize the width returned.
900 * @param height to use.
901 * @return the width based on the width.
903 virtual float GetWidthForHeight(float height);
909 * @brief Called by the RelayoutController to negotiate the size of an actor.
911 * The size allocated by the the algorithm is passed in which the
912 * actor must adhere to. A container is passed in as well which
913 * the actor should populate with actors it has not / or does not
914 * need to handle in its size negotiation.
916 * @param[in] size The allocated size.
917 * @param[in,out] container The container that holds actors that are fed back into the
918 * RelayoutController algorithm.
920 void NegotiateSize(const Vector2& size, RelayoutContainer& container);
923 * @copydoc Dali::Actor::SetResizePolicy()
925 void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
928 * @copydoc Dali::Actor::GetResizePolicy()
930 ResizePolicy::Type GetResizePolicy(Dimension::Type dimension) const;
933 * @brief Set the size negotiation relayout enabled on this actor
935 * @param[in] relayoutEnabled Boolean to enable or disable relayout
937 void SetRelayoutEnabled(bool relayoutEnabled);
940 * @brief Return if relayout is enabled
942 * @return Return if relayout is enabled or not for this actor
944 bool IsRelayoutEnabled() const;
947 * @brief Mark an actor as having it's layout dirty
948 * @note Only called from RelayoutController
950 * @param dirty Whether to mark actor as dirty or not
951 * @param dimension The dimension(s) to mark as dirty
953 void SetLayoutDirty(bool dirty, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
956 * @brief Return if any of an actor's dimensions are marked as dirty
957 * @note Only called from RelayoutController
959 * @param dimension The dimension(s) to check
960 * @return Return if any of the requested dimensions are dirty
962 bool IsLayoutDirty(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
965 * @brief Returns if relayout is enabled and the actor is not dirty
966 * @note Only called from RelayoutController
968 * @return Return if it is possible to relayout the actor
970 bool RelayoutPossible(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
973 * @brief Returns if relayout is enabled and the actor is dirty
974 * @note Only called from RelayoutController
976 * @return Return if it is required to relayout the actor
978 bool RelayoutRequired(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
981 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene)
983 * This method is automatically called from OnSceneConnection(), OnChildAdd(),
984 * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
986 * This method can also be called from a derived class every time it needs a different size.
987 * At the end of event processing, the relayout process starts and
988 * all controls which requested Relayout will have their sizes (re)negotiated.
990 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
991 * only performed once, i.e. there is no need to keep track of this in the calling side.
993 void RelayoutRequest(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
996 * @brief Determine if this actor is dependent on it's parent for relayout
997 * @note Only called from RelayoutController
999 * @param dimension The dimension(s) to check for
1000 * @return Return if the actor is dependent on it's parent
1002 bool RelayoutDependentOnParent(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1005 * @brief Determine if this actor has another dimension depedent on the specified one
1006 * @note Only called from RelayoutController
1008 * @param dimension The dimension to check for
1009 * @param dependentDimension The dimension to check for dependency with
1010 * @return Return if the actor is dependent on this dimension
1012 bool RelayoutDependentOnDimension(Dimension::Type dimension, Dimension::Type dependentDimension);
1015 * @brief Set the padding for a dimension
1017 * @param[in] padding Padding for the dimension. X = start (e.g. left, bottom), y = end (e.g. right, top)
1018 * @param[in] dimension The dimension to set
1020 void SetPadding(const Vector2& padding, Dimension::Type dimension);
1023 * Return the value of padding for the given dimension
1025 * @param dimension The dimension to retrieve
1026 * @return Return the value of padding for the dimension
1028 Vector2 GetPadding(Dimension::Type dimension) const;
1031 * @brief Return the amount of size allocated for relayout
1033 * May include padding
1035 * @param[in] dimension The dimension to retrieve
1036 * @return Return the size
1038 float GetRelayoutSize(Dimension::Type dimension) const;
1041 * @brief Flag the actor as having it's layout dimension negotiated.
1043 * @param[in] negotiated The status of the flag to set.
1044 * @param[in] dimension The dimension to set the flag for
1046 void SetLayoutNegotiated(bool negotiated, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1049 * @brief Test whether the layout dimension for this actor has been negotiated or not.
1051 * @param[in] dimension The dimension to determine the value of the flag for
1052 * @return Return if the layout dimension is negotiated or not.
1054 bool IsLayoutNegotiated(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) const;
1057 * @brief provides the Actor implementation of GetHeightForWidth
1058 * @param width to use.
1059 * @return the height based on the width.
1061 float GetHeightForWidthBase(float width);
1064 * @brief provides the Actor implementation of GetWidthForHeight
1065 * @param height to use.
1066 * @return the width based on the height.
1068 float GetWidthForHeightBase(float height);
1071 * @brief provides the Actor implementation of CalculateChildSize
1073 * @param[in] child The child actor to calculate the size for
1074 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
1075 * @return Return the calculated size for the given dimension
1077 float CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension);
1080 * @brief Determine if this actor is dependent on it's children for relayout.
1082 * @param dimension The dimension(s) to check for
1083 * @return Return if the actor is dependent on it's children
1085 bool RelayoutDependentOnChildrenBase(Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1088 * @copydoc Dali::Actor::SetMinimumSize
1090 void SetMinimumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1093 * @copydoc Dali::Actor::GetMinimumSize
1095 float GetMinimumSize(Dimension::Type dimension) const;
1098 * @copydoc Dali::Actor::SetMaximumSize
1100 void SetMaximumSize(float size, Dimension::Type dimension = Dimension::ALL_DIMENSIONS);
1103 * @copydoc Dali::Actor::GetMaximumSize
1105 float GetMaximumSize(Dimension::Type dimension) const;
1108 * @copydoc Dali::Actor::AddRenderer()
1110 uint32_t AddRenderer(Renderer& renderer);
1113 * @copydoc Dali::Actor::GetRendererCount()
1115 uint32_t GetRendererCount() const;
1118 * @copydoc Dali::Actor::GetRendererAt()
1120 RendererPtr GetRendererAt(uint32_t index);
1123 * @copydoc Dali::Actor::RemoveRenderer()
1125 void RemoveRenderer(Renderer& renderer);
1128 * @copydoc Dali::Actor::RemoveRenderer()
1130 void RemoveRenderer(uint32_t index);
1133 * @brief Set BlendEquation at each renderer that added on this Actor.
1135 void SetBlendEquation(DevelBlendEquation::Type blendEquation);
1138 * @brief Get Blend Equation that applied to this Actor
1140 DevelBlendEquation::Type GetBlendEquation() const;
1143 * @brief Set this Actor is transparent or not without any affection on the child Actors.
1145 void SetTransparent(bool transparent);
1148 * @brief Get this Actor is transparent or not.
1150 bool IsTransparent() const;
1154 * Converts screen coordinates into the actor's coordinate system.
1155 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1156 * @param[out] localX On return, the X-coordinate relative to the actor.
1157 * @param[out] localY On return, the Y-coordinate relative to the actor.
1158 * @param[in] screenX The screen X-coordinate.
1159 * @param[in] screenY The screen Y-coordinate.
1160 * @return True if the conversion succeeded.
1162 bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const;
1165 * Converts screen coordinates into the actor's coordinate system.
1166 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1167 * @param[in] renderTask The render-task used to display the actor.
1168 * @param[out] localX On return, the X-coordinate relative to the actor.
1169 * @param[out] localY On return, the Y-coordinate relative to the actor.
1170 * @param[in] screenX The screen X-coordinate.
1171 * @param[in] screenY The screen Y-coordinate.
1172 * @return True if the conversion succeeded.
1174 bool ScreenToLocal(const RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const;
1177 * Converts from the actor's coordinate system to screen coordinates.
1178 * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
1179 * @param[in] viewMatrix The view-matrix
1180 * @param[in] projectionMatrix The projection-matrix
1181 * @param[in] viewport The view-port
1182 * @param[out] localX On return, the X-coordinate relative to the actor.
1183 * @param[out] localY On return, the Y-coordinate relative to the actor.
1184 * @param[in] screenX The screen X-coordinate.
1185 * @param[in] screenY The screen Y-coordinate.
1186 * @return True if the conversion succeeded.
1188 bool ScreenToLocal(const Matrix& viewMatrix,
1189 const Matrix& projectionMatrix,
1190 const Viewport& viewport,
1194 float screenY) const;
1197 * Sets whether the actor should receive a notification when touch or hover motion events leave
1198 * the boundary of the actor.
1200 * @note By default, this is set to false as most actors do not require this.
1201 * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
1203 * @param[in] required Should be set to true if a Leave event is required
1205 void SetLeaveRequired(bool required)
1207 mLeaveRequired = required;
1211 * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
1212 * the boundary of the actor.
1213 * @return true if a Leave event is required, false otherwise.
1215 bool GetLeaveRequired() const
1217 return mLeaveRequired;
1221 * @copydoc Dali::Actor::SetKeyboardFocusable()
1223 void SetKeyboardFocusable(bool focusable)
1225 mKeyboardFocusable = focusable;
1229 * @copydoc Dali::Actor::IsKeyboardFocusable()
1231 bool IsKeyboardFocusable() const
1233 return mKeyboardFocusable;
1237 * @copydoc Dali::Actor::SetKeyboardFocusableChildren()
1239 void SetKeyboardFocusableChildren(bool focusable)
1241 mKeyboardFocusableChildren = focusable;
1245 * @copydoc Dali::Actor::AreChildrenKeyBoardFocusable()
1247 bool AreChildrenKeyBoardFocusable() const
1249 return mKeyboardFocusableChildren;
1253 * Set whether this view can focus by touch.
1254 * @param[in] focusable focuable by touch.
1256 void SetTouchFocusable(bool focusable)
1258 mTouchFocusable = focusable;
1262 * This returns whether this actor can focus by touch.
1263 * @return true if this actor can focus by touch.
1265 bool IsTouchFocusable() const
1267 return mTouchFocusable;
1271 * Query whether the application or derived actor type requires hit-test result events.
1272 * @return True if hit-test result events are required.
1274 bool IsHitTestResultRequired() const
1276 return !mHitTestResultSignal.Empty();
1280 * Query whether the application or derived actor type requires intercept touch events.
1281 * @return True if intercept touch events are required.
1283 bool GetInterceptTouchRequired() const
1285 return !mInterceptTouchedSignal.Empty();
1289 * Query whether the application or derived actor type requires touch events.
1290 * @return True if touch events are required.
1292 bool GetTouchRequired() const
1294 return !mTouchedSignal.Empty();
1298 * Query whether the application or derived actor type requires hover events.
1299 * @return True if hover events are required.
1301 bool GetHoverRequired() const
1303 return !mHoveredSignal.Empty();
1307 * Query whether the application or derived actor type requires intercept wheel events.
1308 * @return True if intercept wheel events are required.
1310 bool GetInterceptWheelRequired() const
1312 return !mInterceptWheelSignal.Empty();
1316 * Query whether the application or derived actor type requires wheel events.
1317 * @return True if wheel events are required.
1319 bool GetWheelEventRequired() const
1321 return !mWheelEventSignal.Empty();
1325 * Query whether the actor is actually hittable. This method checks whether the actor is
1326 * sensitive, has the visibility flag set to true and is not fully transparent.
1327 * @return true, if it can be hit, false otherwise.
1329 bool IsHittable() const
1331 return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected();
1335 * Query whether the actor captures all touch after it starts even if touch leaves its boundary.
1336 * @return true, if it captures all touch after start
1338 bool CapturesAllTouchAfterStart() const
1340 return mCaptureAllTouchAfterStart;
1344 * Sets the touch area offset of an actor.
1345 * @param [in] offset The new offset of area (left, right, bottom, top).
1347 void SetTouchAreaOffset(Rect<int> offset)
1349 mTouchAreaOffset = offset;
1353 * Retrieve the Actor's touch area offset.
1354 * @return The Actor's touch area offset.
1356 const Rect<int>& GetTouchAreaOffset() const
1358 return mTouchAreaOffset;
1362 * Query whether the actor will only receive own touch.
1363 * @return true, if it only receives touches that started from itself.
1365 bool IsAllowedOnlyOwnTouch() const
1367 return mAllowOnlyOwnTouch;
1373 * Retrieve the gesture data associated with this actor. The first call to this method will
1374 * allocate space for the ActorGestureData so this should only be called if an actor really does
1376 * @return Reference to the ActorGestureData for this actor.
1377 * @note Once the gesture-data is created for an actor it is likely that gestures are required
1378 * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
1380 ActorGestureData& GetGestureData();
1383 * Queries whether the actor requires the gesture type.
1384 * @param[in] type The gesture type.
1385 * @return True if the gesture is required, false otherwise.
1387 bool IsGestureRequired(GestureType::Value type) const;
1392 * Used by the EventProcessor to emit intercept touch event signals.
1393 * @param[in] touch The touch data.
1394 * @return True if the event was intercepted.
1396 bool EmitInterceptTouchEventSignal(const Dali::TouchEvent& touch);
1399 * Used by the EventProcessor to emit touch event signals.
1400 * @param[in] touch The touch data.
1401 * @return True if the event was consumed.
1403 bool EmitTouchEventSignal(const Dali::TouchEvent& touch);
1406 * Used by the EventProcessor to emit hover event signals.
1407 * @param[in] event The hover event.
1408 * @return True if the event was consumed.
1410 bool EmitHoverEventSignal(const Dali::HoverEvent& event);
1413 * Used by the EventProcessor to emit intercept wheel event signals.
1414 * @param[in] event The wheel event.
1415 * @return True if the event was intercepted.
1417 bool EmitInterceptWheelEventSignal(const Dali::WheelEvent& event);
1420 * Used by the EventProcessor to emit wheel event signals.
1421 * @param[in] event The wheel event.
1422 * @return True if the event was consumed.
1424 bool EmitWheelEventSignal(const Dali::WheelEvent& event);
1427 * @brief Emits the visibility change signal for this actor and all its children.
1428 * @param[in] visible Whether the actor has become visible or not.
1429 * @param[in] type Whether the actor's visible property has changed or a parent's.
1431 void EmitVisibilityChangedSignal(bool visible, DevelActor::VisibilityChange::Type type);
1434 * @brief Emits the layout direction change signal for this actor and all its children.
1435 * @param[in] type Whether the actor's layout direction property has changed or a parent's.
1437 void EmitLayoutDirectionChangedSignal(LayoutDirection::Type type);
1440 * Used by the EventProcessor to emit hit-test result touch event signals.
1441 * @param[in] point The point of event touched.
1442 * @param[in] hitPointLocal The hit point in the Actor's local reference system.
1443 * @param[in] timeStamp The time the event occurred.
1444 * @return True if the event was consumed.
1446 bool EmitHitTestResultSignal(Integration::Point point, Vector2 hitPointLocal, uint32_t timeStamp);
1449 * @copydoc DevelActor::HitTestResultSignal()
1451 Dali::Actor::TouchEventSignalType& HitTestResultSignal()
1453 return mHitTestResultSignal;
1457 * @copydoc DevelActor::InterceptTouchedSignal()
1459 Dali::Actor::TouchEventSignalType& InterceptTouchedSignal()
1461 return mInterceptTouchedSignal;
1465 * @copydoc Dali::Actor::TouchedSignal()
1467 Dali::Actor::TouchEventSignalType& TouchedSignal()
1469 return mTouchedSignal;
1473 * @copydoc Dali::Actor::HoveredSignal()
1475 Dali::Actor::HoverSignalType& HoveredSignal()
1477 return mHoveredSignal;
1481 * @copydoc DevelActor::InterceptWheelSignal()
1483 Dali::Actor::WheelEventSignalType& InterceptWheelSignal()
1485 return mInterceptWheelSignal;
1489 * @copydoc Dali::Actor::WheelEventSignal()
1491 Dali::Actor::WheelEventSignalType& WheelEventSignal()
1493 return mWheelEventSignal;
1497 * @copydoc Dali::Actor::OnSceneSignal()
1499 Dali::Actor::OnSceneSignalType& OnSceneSignal()
1501 return mOnSceneSignal;
1505 * @copydoc Dali::Actor::OffSceneSignal()
1507 Dali::Actor::OffSceneSignalType& OffSceneSignal()
1509 return mOffSceneSignal;
1513 * @copydoc Dali::Actor::OnRelayoutSignal()
1515 Dali::Actor::OnRelayoutSignalType& OnRelayoutSignal()
1517 return mOnRelayoutSignal;
1521 * @copydoc DevelActor::VisibilityChangedSignal
1523 DevelActor::VisibilityChangedSignalType& VisibilityChangedSignal()
1525 return mVisibilityChangedSignal;
1529 * @copydoc LayoutDirectionChangedSignal
1531 Dali::Actor::LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal()
1533 return mLayoutDirectionChangedSignal;
1537 * @copydoc DevelActor::ChildAddedSignal
1539 DevelActor::ChildChangedSignalType& ChildAddedSignal();
1542 * @copydoc DevelActor::ChildRemovedSignal
1544 DevelActor::ChildChangedSignalType& ChildRemovedSignal();
1547 * @copydoc DevelActor::ChildOrderChangedSignal
1549 DevelActor::ChildOrderChangedSignalType& ChildOrderChangedSignal();
1555 * For use in derived classes.
1556 * This should only be called by Animation, when the actor is resized using Animation::Resize().
1558 virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
1571 * Protected Constructor. See Actor::New().
1572 * The second-phase construction Initialize() member should be called immediately after this.
1573 * @param[in] derivedType The derived type of actor (if any).
1574 * @param[in] reference to the node
1576 Actor(DerivedType derivedType, const SceneGraph::Node& node);
1579 * Second-phase constructor. Must be called immediately after creating a new Actor;
1581 void Initialize(void);
1584 * A reference counted object may only be deleted by calling Unreference()
1589 * Called on a child during Add() when the parent actor is connected to the Scene.
1590 * @param[in] parentDepth The depth of the parent in the hierarchy.
1591 * @param[in] layer3DParentsCount The number of 3d layers in the hierarchy.
1592 * @param[in] notify Emits notification if set to true.
1594 void ConnectToScene(uint32_t parentDepth, uint32_t layer3DParentsCount, bool notify);
1597 * Connect the Node associated with this Actor to the scene-graph.
1599 void ConnectToSceneGraph();
1602 * Helper for ConnectToScene, to notify a connected actor through the public API.
1603 * @param[in] notify Emits notification if set to true.
1605 void NotifyStageConnection(bool notify);
1608 * Called on a child during Remove() when the actor was previously on the Stage.
1609 * @param[in] notify Emits notification if set to true.
1611 void DisconnectFromStage(bool notify);
1614 * Disconnect the Node associated with this Actor from the scene-graph.
1616 void DisconnectFromSceneGraph();
1619 * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1620 * @param[in] notify Emits notification if set to true.
1622 void NotifyStageDisconnection(bool notify);
1625 * When the Actor is OnScene, checks whether the corresponding Node is connected to the scene graph.
1626 * @return True if the Actor is OnScene & has a Node connected to the scene graph.
1628 bool IsNodeConnected() const;
1632 * Trigger a rebuild of the actor depth tree from this root
1633 * If a Layer3D is encountered, then this doesn't descend any further.
1634 * The mSortedDepth of each actor is set appropriately.
1636 void RebuildDepthTree();
1639 // Default property extensions from Object
1642 * @copydoc Dali::Internal::Object::SetDefaultProperty()
1644 void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue) override;
1647 * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1649 void SetSceneGraphProperty(Property::Index index, const PropertyMetadata& entry, const Property::Value& value) override;
1652 * @copydoc Dali::Internal::Object::GetDefaultProperty()
1654 Property::Value GetDefaultProperty(Property::Index index) const override;
1657 * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
1659 Property::Value GetDefaultPropertyCurrentValue(Property::Index index) const override;
1662 * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
1664 void OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType) override;
1667 * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1669 const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty(Property::Index index) const override;
1672 * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1674 const PropertyInputImpl* GetSceneObjectInputProperty(Property::Index index) const override;
1677 * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1679 int32_t GetPropertyComponentIndex(Property::Index index) const override;
1682 * @copydoc Dali::Internal::Object::IsAnimationPossible()
1684 bool IsAnimationPossible() const override
1690 * Retrieve the actor's node.
1691 * @return The node used by this actor
1693 const SceneGraph::Node& GetNode() const;
1696 * @copydoc Dali::DevelActor::Raise()
1701 * @copydoc Dali::DevelActor::Lower()
1706 * @copydoc Dali::DevelActor::RaiseToTop()
1711 * @copydoc Dali::DevelActor::LowerToBottom()
1713 void LowerToBottom();
1716 * @copydoc Dali::DevelActor::RaiseAbove()
1718 void RaiseAbove(Internal::Actor& target);
1721 * @copydoc Dali::DevelActor::LowerBelow()
1723 void LowerBelow(Internal::Actor& target);
1727 * Sets the scene which this actor is added to.
1728 * @param[in] scene The scene
1730 void SetScene(Scene& scene)
1736 * Gets the scene which this actor is added to.
1739 Scene& GetScene() const
1744 LayoutDirection::Type GetLayoutDirection() const
1746 return mLayoutDirection;
1759 // Remove default constructor and copy constructor
1761 Actor(const Actor&) = delete;
1762 Actor& operator=(const Actor& rhs) = delete;
1765 * Set the actor's parent.
1766 * @param[in] parent The new parent.
1767 * @param[in] notify Emits notification if set to true. Default is true.
1769 void SetParent(ActorParent* parent, bool notify = true);
1772 * For use in derived classes, called after Initialize()
1774 virtual void OnInitialize()
1779 * For use in internal derived classes.
1780 * This is called during ConnectToScene(), after the actor has finished adding its node to the scene-graph.
1781 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1783 virtual void OnSceneConnectionInternal()
1788 * For use in internal derived classes.
1789 * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1790 * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1792 virtual void OnSceneDisconnectionInternal()
1797 * For use in external (CustomActor) derived classes.
1798 * This is called after the atomic ConnectToScene() traversal has been completed.
1800 virtual void OnSceneConnectionExternal(int depth)
1805 * For use in external (CustomActor) derived classes.
1806 * This is called after the atomic DisconnectFromStage() traversal has been completed.
1808 virtual void OnSceneDisconnectionExternal()
1813 * For use in derived classes; this is called after Add() has added a child.
1814 * @param[in] child The child that was added.
1816 virtual void OnChildAdd(Actor& child)
1821 * For use in derived classes; this is called after Remove() has attempted to remove a child( regardless of whether it succeeded or not ).
1822 * @param[in] child The child that was removed.
1824 virtual void OnChildRemove(Actor& child)
1829 * For use in derived classes.
1830 * This is called after SizeSet() has been called.
1832 virtual void OnSizeSet(const Vector3& targetSize)
1837 * @brief Retrieves the cached event side value of a default property.
1838 * @param[in] index The index of the property
1839 * @param[out] value Is set with the cached value of the property if found.
1840 * @return True if value set, false otherwise.
1842 bool GetCachedPropertyValue(Property::Index index, Property::Value& value) const;
1845 * @brief Retrieves the current value of a default property from the scene-graph.
1846 * @param[in] index The index of the property
1847 * @param[out] value Is set with the current scene-graph value of the property
1848 * @return True if value set, false otherwise.
1850 bool GetCurrentPropertyValue(Property::Index index, Property::Value& value) const;
1853 * Retrieve the parent object of an Actor.
1854 * @return The parent object, or NULL if the Actor does not have a parent.
1856 Object* GetParentObject() const override
1858 return static_cast<Actor*>(mParent);
1862 * @brief Get the current position of the actor in screen coordinates.
1864 * @return Returns the screen position of actor
1866 const Vector2 GetCurrentScreenPosition() const;
1869 * Sets the visibility flag of an actor.
1870 * @param[in] visible The new visibility flag.
1871 * @param[in] sendMessage Whether to send a message to the update thread or not.
1873 void SetVisibleInternal(bool visible, SendMessage::Type sendMessage);
1876 * @copydoc ActorParent::SetSiblingOrderOfChild
1878 void SetSiblingOrderOfChild(Actor& child, uint32_t order) override;
1881 * @copydoc ActorParent::GetSiblingOrderOfChild
1883 uint32_t GetSiblingOrderOfChild(const Actor& child) const override;
1886 * @copydoc ActorParent::RaiseChild
1888 void RaiseChild(Actor& child) override;
1891 * @copydoc ActorParent::LowerChild
1893 void LowerChild(Actor& child) override;
1896 * @copydoc ActorParent::RaiseChildToTop
1898 void RaiseChildToTop(Actor& child) override;
1901 * @copydoc ActorParent::LowerChildToBottom
1903 void LowerChildToBottom(Actor& child) override;
1906 * @copydoc ActorParent::RaiseChildAbove
1908 void RaiseChildAbove(Actor& child, Actor& target) override;
1911 * @copydoc ActorParent::LowerChildBelow()
1913 void LowerChildBelow(Actor& child, Actor& target) override;
1916 * Set whether a child actor inherits it's parent's layout direction. Default is to inherit.
1917 * @param[in] inherit - true if the actor should inherit layout direction, false otherwise.
1919 void SetInheritLayoutDirection(bool inherit);
1922 * Returns whether the actor inherits it's parent's layout direction.
1923 * @return true if the actor inherits it's parent's layout direction, false otherwise.
1925 bool IsLayoutDirectionInherited() const
1927 return mInheritLayoutDirection;
1931 * @brief Sets the update area hint of an actor.
1932 * @param [in] updateAreaHint The update area hint.
1934 void SetUpdateAreaHint(const Vector4& updateAreaHint);
1937 ActorParentImpl mParentImpl; ///< Implementation of ActorParent;
1938 ActorSizer mSizer; ///< Implementation for managing actor size
1939 ActorParent* mParent; ///< Each actor (except the root) can have one parent
1940 Scene* mScene; ///< The scene the actor is added to
1941 RendererContainer* mRenderers; ///< Renderer container
1942 Vector3* mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1943 Vector3* mAnchorPoint; ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1944 ActorGestureData* mGestureData; ///< Optional Gesture data. Only created when actor requires gestures
1947 Dali::Actor::TouchEventSignalType mInterceptTouchedSignal;
1948 Dali::Actor::TouchEventSignalType mTouchedSignal;
1949 Dali::Actor::HoverSignalType mHoveredSignal;
1950 Dali::Actor::WheelEventSignalType mInterceptWheelSignal;
1951 Dali::Actor::WheelEventSignalType mWheelEventSignal;
1952 Dali::Actor::OnSceneSignalType mOnSceneSignal;
1953 Dali::Actor::OffSceneSignalType mOffSceneSignal;
1954 Dali::Actor::OnRelayoutSignalType mOnRelayoutSignal;
1955 DevelActor::VisibilityChangedSignalType mVisibilityChangedSignal;
1956 Dali::Actor::LayoutDirectionChangedSignalType mLayoutDirectionChangedSignal;
1957 Dali::Actor::TouchEventSignalType mHitTestResultSignal;
1959 Quaternion mTargetOrientation; ///< Event-side storage for orientation
1960 Vector4 mTargetColor; ///< Event-side storage for color
1961 Vector3 mTargetPosition; ///< Event-side storage for position (not a pointer as most actors will have a position)
1962 Vector3 mTargetScale; ///< Event-side storage for scale
1963 Rect<int> mTouchAreaOffset; ///< touch area offset (left, right, bottom, top)
1965 ConstString mName; ///< Name of the actor
1966 uint32_t mSortedDepth; ///< The sorted depth index. A combination of tree traversal and sibling order.
1967 int16_t mDepth; ///< The depth in the hierarchy of the actor. Only 32,767 levels of depth are supported
1969 int16_t mLayer3DParentsCount; ///< The number of layer with 3D behaviour in ancestors include this. It will be 0 if actor is not on scene.
1971 const bool mIsRoot : 1; ///< Flag to identify the root actor
1972 const bool mIsLayer : 1; ///< Flag to identify that this is a layer
1973 bool mIsOnScene : 1; ///< Flag to identify whether the actor is on-scene
1974 bool mSensitive : 1; ///< Whether the actor emits touch event signals
1975 bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1976 bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
1977 bool mKeyboardFocusableChildren : 1; ///< Whether the children of this actor can be focusable by keyboard navigation.
1978 bool mTouchFocusable : 1; ///< Whether the actor should be focusable by touch
1979 bool mOnSceneSignalled : 1; ///< Set to true before OnSceneConnection signal is emitted, and false before OnSceneDisconnection
1980 bool mInheritPosition : 1; ///< Cached: Whether the parent's position should be inherited.
1981 bool mInheritOrientation : 1; ///< Cached: Whether the parent's orientation should be inherited.
1982 bool mInheritScale : 1; ///< Cached: Whether the parent's scale should be inherited.
1983 bool mPositionUsesAnchorPoint : 1; ///< Cached: Whether the position uses the anchor point or not.
1984 bool mVisible : 1; ///< Cached: Whether the actor is visible or not.
1985 bool mInheritLayoutDirection : 1; ///< Whether the actor inherits the layout direction from parent.
1986 bool mCaptureAllTouchAfterStart : 1; ///< Whether the actor should capture all touch after touch starts even if the motion moves outside of the actor area.
1987 bool mIsBlendEquationSet : 1; ///< Flag to identify whether the Blend equation is set
1988 bool mNeedGesturePropagation : 1; ///< Whether the parent listens for gesture events or not
1989 bool mUserInteractionEnabled : 1; ///< Whether the actor should be enabled user interaction.
1990 bool mAllowOnlyOwnTouch : 1; ///< Whether the actor will only receive own touch. it only receives touches that started from itself.
1991 bool mUseTextureUpdateArea : 1; ///< Whether the actor uses the update area of the texture instead of its own.
1992 LayoutDirection::Type mLayoutDirection : 2; ///< Layout direction, Left to Right or Right to Left.
1993 DrawMode::Type mDrawMode : 3; ///< Cached: How the actor and its children should be drawn
1994 ColorMode mColorMode : 3; ///< Cached: Determines whether mWorldColor is inherited
1995 ClippingMode::Type mClippingMode : 3; ///< Cached: Determines which clipping mode (if any) to use.
1996 DevelBlendEquation::Type mBlendEquation : 16; ///< Cached: Determines which blend equation will be used to render renderers.
1999 static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
2001 struct PropertyHandler;
2002 struct SiblingHandler;
2004 friend class ActorParentImpl; // Allow impl to call private methods on actor
2005 friend class ActorSizer; // Allow sizer to call private methods on actor
2008 } // namespace Internal
2010 // Helpers for public-api forwarding methods
2012 inline Internal::Actor& GetImplementation(Dali::Actor& actor)
2014 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
2016 BaseObject& handle = actor.GetBaseObject();
2018 return static_cast<Internal::Actor&>(handle);
2021 inline const Internal::Actor& GetImplementation(const Dali::Actor& actor)
2023 DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
2025 const BaseObject& handle = actor.GetBaseObject();
2027 return static_cast<const Internal::Actor&>(handle);
2032 #endif // DALI_INTERNAL_ACTOR_H