#include <string>
// INTERNAL INCLUDES
-#include <dali/public-api/common/map-wrapper.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/actors/actor.h>
struct KeyEvent;
struct TouchEvent;
+struct HoverEvent;
struct MouseWheelEvent;
namespace Internal
class Actor;
class ActorGestureData;
+class Animation;
class RenderTask;
struct DynamicsData;
void SetDepth( float depth );
/**
- * Retrieve the Actor's size.
+ * Retrieve the Actor's size from event side.
+ * This size will be the size set or if animating then the target size.
+ * @return The Actor's size.
+ */
+ const Vector3& GetSize() const;
+
+ /**
+ * Retrieve the Actor's size from update side.
+ * This size will be the size set or animating but will be a frame behind.
* @return The Actor's size.
*/
const Vector3& GetCurrentSize() const;
float GetCurrentOpacity() const;
/**
- * Sets whether an actor should emit touch signals; see SignalTouch().
+ * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
* An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
- * the touch event signal will be emitted.
+ * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
+ * hover event signal will be emitted.
*
- * If the application wishes to temporarily disable the touch event signal emission, then they can do so by calling:
+ * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
* @code
* actor.SetSensitive(false);
* @endcode
*
- * Then, to re-enable the touch event signal emission, the application should call:
+ * Then, to re-enable the touch or hover event signal emission, the application should call:
* @code
* actor.SetSensitive(true);
* @endcode
*
- * @see SignalTouch().
- * @note If an actor's sensitivity is set to false, then it's children will not emit a touch event signal either.
- * @param[in] sensitive true to enable emission of the touch event signals, false otherwise.
+ * @see SignalTouch() and SignalHover().
+ * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
+ * @param[in] sensitive true to enable emission of the touch or hover event signals, false otherwise.
*/
void SetSensitive(bool sensitive)
{
}
/**
- * Query whether an actor emits touch event signals.
+ * Query whether an actor emits touch or hover event signals.
* @see SetSensitive(bool)
- * @return true, if emission of touch event signals is enabled, false otherwise.
+ * @return true, if emission of touch or hover event signals is enabled, false otherwise.
*/
bool IsSensitive() const
{
bool RayActorTest( const Vector4& rayOrigin, const Vector4& rayDir, Vector4& hitPointLocal, float& distance ) const;
/**
- * Sets whether the actor should receive a notification when touch motion events leave
+ * Sets whether the actor should receive a notification when touch or hover motion events leave
* the boundary of the actor.
*
* @note By default, this is set to false as most actors do not require this.
- * @note Need to connect to the SignalTouch to actually receive this event.
+ * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
*
* @param[in] required Should be set to true if a Leave event is required
*/
void SetLeaveRequired(bool required);
/**
- * This returns whether the actor requires touch events whenever touch motion events leave
+ * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
* the boundary of the actor.
* @return true if a Leave event is required, false otherwise.
*/
bool GetTouchRequired() const;
/**
+ * Query whether the application or derived actor type requires hover events.
+ * @return True if hover events are required.
+ */
+ bool GetHoverRequired() const;
+
+ /**
* Query whether the application or derived actor type requires mouse wheel events.
* @return True if mouse wheel events are required.
*/
bool EmitTouchEventSignal(const TouchEvent& event);
/**
+ * Used by the EventProcessor to emit hover event signals.
+ * @param[in] event The hover event.
+ * @return True if the event was consumed.
+ */
+ bool EmitHoverEventSignal(const HoverEvent& event);
+
+ /**
* Used by the EventProcessor to emit mouse wheel event signals.
* @param[in] event The mouse wheel event.
* @return True if the event was consumed.
Dali::Actor::TouchSignalV2& TouchedSignal();
/**
+ * @copydoc Dali::Actor::HoveredSignal()
+ */
+ Dali::Actor::HoverSignalV2& HoveredSignal();
+
+ /**
* @copydoc Dali::Actor::MouseWheelEventSignal()
*/
Dali::Actor::MouseWheelEventSignalV2& MouseWheelEventSignal();
public: // For Animation
/**
+ * This should only be called by Animation, when the actor is resized using Animation::Resize().
+ *
+ * @param[in] animation The animation that resized the actor
+ * @param[in] targetSize The new target size of the actor
+ */
+ void NotifySizeAnimation( Animation& animation, const Vector3& targetSize);
+
+ /**
* For use in derived classes.
* This should only be called by Animation, when the actor is resized using Animation::Resize().
*/
- virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) {}
+ virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize) {}
protected:
public: // Default property extensions from ProxyObject
/**
- * @copydoc Dali::Internal::ProxyObject::IsSceneObjectRemovable()
- */
- virtual bool IsSceneObjectRemovable() const;
-
- /**
* @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyCount()
*/
virtual unsigned int GetDefaultPropertyCount() const;
/**
* @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyName()
*/
- virtual const std::string& GetDefaultPropertyName(Property::Index index) const;
+ virtual const char* GetDefaultPropertyName(Property::Index index) const;
/**
* @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndex()
virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
/**
- * @copydoc Dali::Internal::ProxyObject::SetCustomProperty()
+ * @copydoc Dali::Internal::ProxyObject::SetSceneGraphProperty()
*/
- virtual void SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
+ virtual void SetSceneGraphProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
/**
* @copydoc Dali::Internal::ProxyObject::GetDefaultProperty()
virtual Property::Value GetDefaultProperty( Property::Index index ) const;
/**
- * @copydoc Dali::Internal::ProxyObject::InstallSceneObjectProperty()
+ * @copydoc Dali::Internal::ProxyObject::GetPropertyOwner()
*/
- virtual void InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index );
+ virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
/**
* @copydoc Dali::Internal::ProxyObject::GetSceneObject()
/**
* For use in derived classes.
- * This is called after a non animatable custom property is set.
- * @param [in] index The index of the property.
- * @param [in] propertyValue The value of the property.
+ * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
+ * @param[in] event The touch event.
+ * @return True if the event should be consumed.
*/
- virtual void OnPropertySet( Property::Index index, Property::Value propertyValue ) {}
+ virtual bool OnTouchEvent(const TouchEvent& event) { return false; }
/**
* For use in derived classes.
- * This is only called if mTouchRequired is true, and the touch-signal was not consumed.
- * @param[in] event The touch event.
+ * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
+ * @param[in] event The hover event.
* @return True if the event should be consumed.
*/
- virtual bool OnTouchEvent(const TouchEvent& event) { return false; }
+ virtual bool OnHoverEvent(const HoverEvent& event) { return false; }
/**
* For use in derived classes.
// Signals
Dali::Actor::TouchSignalV2 mTouchedSignalV2;
+ Dali::Actor::HoverSignalV2 mHoveredSignalV2;
Dali::Actor::MouseWheelEventSignalV2 mMouseWheelEventSignalV2;
Dali::Actor::SetSizeSignalV2 mSetSizeSignalV2;
Dali::Actor::OnStageSignalV2 mOnStageSignalV2;
Dali::Actor::OffStageSignalV2 mOffStageSignalV2;
+ Vector3 mSize; ///< Event-side storage for size (not a pointer as most actors will have a size)
+
std::string mName; ///< Name of the actor
unsigned int mId; ///< A unique ID to identify the actor starting from 1, and 0 is reserved
bool mLeaveRequired : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
bool mKeyboardFocusable : 1; ///< Whether the actor should be focusable by keyboard navigation
bool mDerivedRequiresTouch : 1; ///< Whether the derived actor type requires touch event signals
+ bool mDerivedRequiresHover : 1; ///< Whether the derived actor type requires hover event signals
bool mDerivedRequiresMouseWheelEvent : 1; ///< Whether the derived actor type requires mouse wheel event signals
bool mOnStageSignalled : 1; ///< Set to true before OnStageConnection signal is emitted, and false before OnStageDisconnection
bool mInheritRotation : 1; ///< Cached: Whether the parent's rotation should be inherited.
PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
ColorMode mColorMode : 2; ///< Cached: Determines whether mWorldColor is inherited
- // Default properties
- typedef std::map<std::string, Property::Index> DefaultPropertyLookup;
-
private:
static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
static unsigned int mActorCounter; ///< A counter to track the actor instance creation
- // Default properties
- static DefaultPropertyLookup* mDefaultPropertyLookup;
-
-};
-
-/**
- * @brief Structure for setting up default properties and their details.
- */
-struct PropertyDetails
-{
- std::string name; ///< The name of the property.
- Property::Type type; ///< The property type.
- bool writable:1; ///< Whether the property is writable
- bool animatable:1; ///< Whether the property is animatable.
- bool constraintInput:1; ///< Whether the property can be used as an input to a constraint.
};
} // namespace Internal