#define DALI_CUSTOM_ACTOR_IMPL_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
class CustomActor;
class CustomActorImpl;
class RelayoutContainer;
-struct KeyEvent;
-struct TouchEvent;
-struct HoverEvent;
-struct WheelEvent;
+class KeyEvent;
+class HoverEvent;
+class WheelEvent;
struct Vector2;
struct Vector3;
CustomActor Self() const;
/**
- * @brief Called after the actor has been connected to the stage.
+ * @brief Called 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
* @param[in] depth The depth in the hierarchy for the actor
*
- * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected.
- * When the parent of a set of actors is connected to the stage, then all of the children
+ * @note The root Actor is provided automatically by the Scene, and is always considered to be connected.
+ * When the parent of a set of actors is connected to the scene, then all of the children
* will received this callback.
* For the following actor tree, the callback order will be A, B, D, E, C, and finally F.
*
* @endcode
* @param[in] depth The depth in the hierarchy for the actor
*/
- virtual void OnStageConnection( int32_t depth ) = 0;
+ virtual void OnSceneConnection( int32_t depth ) = 0;
/**
- * @brief Called after the actor has been disconnected from Stage.
+ * @brief Called 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
- * @note When the parent of a set of actors is disconnected to the stage, then all of the children
+ * @SINCE_1_9.24
+ * @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.
*
*
* @endcode
*/
- virtual void OnStageDisconnection() = 0;
+ virtual void OnSceneDisconnection() = 0;
/**
* @brief Called after a child has been added to the owning actor.
* @param[in] index The Property index that was set
* @param[in] propertyValue The value to set
*/
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
+ virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue );
/**
* @brief Called when the owning actor's size is set e.g. using Actor::SetSize().
virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) = 0;
/**
- * @DEPRECATED_1_1.37 Connect to TouchSignal() instead.
- *
- * @brief Called after a touch-event is received by the owning actor.
- *
- * @SINCE_1_0.0
- * @param[in] event The touch event
- * @return True if the event should be consumed
- * @note CustomActorImpl::REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
- */
- virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API = 0;
-
- /**
- * @brief Called after a hover-event is received by the owning actor.
- *
- * @SINCE_1_0.0
- * @param[in] event The hover event
- * @return True if the event should be consumed
- * @note CustomActorImpl::REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
- */
- virtual bool OnHoverEvent(const HoverEvent& event) = 0;
-
- /**
- * @brief Called after a key-event is received by the actor that has had its focus set.
- *
- * @SINCE_1_0.0
- * @param[in] event The Key Event
- * @return True if the event should be consumed
- */
- virtual bool OnKeyEvent(const KeyEvent& event) = 0;
-
- /**
- * @brief Called after a wheel-event is received by the owning actor.
- *
- * @SINCE_1_0.0
- * @param[in] event The wheel event
- * @return True if the event should be consumed
- * @note CustomActorImpl::REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ).
- */
- virtual bool OnWheelEvent(const WheelEvent& event) = 0;
-
- /**
* @brief Called after the size negotiation has been finished for this control.
*
* The control is expected to assign this given size to itself/its children.
{
ACTOR_BEHAVIOUR_DEFAULT = 0, ///< Use to provide default behaviour (size negotiation is on, event callbacks are not called). @SINCE_1_2_10
DISABLE_SIZE_NEGOTIATION = 1 << 0, ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm @SINCE_1_0.0
- REQUIRES_TOUCH_EVENTS = 1 << 1, ///< True if the OnTouchEvent() callback is required. @SINCE_1_0.0
- REQUIRES_HOVER_EVENTS = 1 << 2, ///< True if the OnHoverEvent() callback is required. @SINCE_1_0.0
- REQUIRES_WHEEL_EVENTS = 1 << 3, ///< True if the OnWheelEvent() callback is required. @SINCE_1_0.0
LAST_ACTOR_FLAG ///< Special marker for last actor flag @SINCE_1_0.0
};
- static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
+ static constexpr int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
/**
* @brief Creates a CustomActorImpl.
Internal::CustomActor* GetOwner() const;
/**
- * @brief Returns whether the OnTouchEvent() callback is required.
- * @SINCE_1_0.0
- * @return True if the OnTouchEvent() callback is required
- * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
- */
- bool RequiresTouchEvents() const;
-
- /**
- * @brief Returns whether the OnHoverEvent() callback is required.
- * @SINCE_1_0.0
- * @return True if the OnHoverEvent() callback is required
- * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
- */
- bool RequiresHoverEvents() const;
-
- /**
- * @brief Returns whether the OnWheelEvent() callback is required.
- * @SINCE_1_0.0
- * @return True if the OnWheelEvent() callback is required
- * @note Called when ownership of the CustomActorImpl is passed to a CustomActor.
- */
- bool RequiresWheelEvents() const;
-
- /**
* @brief Returns whether relayout is enabled.
* @SINCE_1_0.0
* @return Return true if relayout is enabled on the custom actor
private:
Internal::CustomActor* mOwner; ///< Internal owner of this custom actor implementation
- ActorFlags mFlags :ACTOR_FLAG_COUNT; ///< ActorFlags flags to determine behaviour
+ ActorFlags mFlags; ///< ActorFlags flags to determine behaviour
};
/**