use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.h
index 87f98fd..6573930 100644 (file)
@@ -30,7 +30,6 @@
 #include <dali/public-api/math/viewport.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
-#include <dali/devel-api/events/gesture-devel.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
 #include <dali/internal/event/actors/actor-declarations.h>
 #include <dali/internal/event/common/object-impl.h>
 namespace Dali
 {
 
-struct KeyEvent;
+class KeyEvent;
 class TouchData;
-struct HoverEvent;
-struct WheelEvent;
+class TouchEvent;
+class WheelEvent;
 
 namespace Internal
 {
@@ -57,15 +56,15 @@ class RenderTask;
 class Renderer;
 class Scene;
 
-typedef std::vector< ActorPtr > ActorContainer;
-typedef ActorContainer::iterator ActorIter;
-typedef ActorContainer::const_iterator ActorConstIter;
+using ActorContainer = std::vector<ActorPtr>;
+using ActorIter      = ActorContainer::iterator;
+using ActorConstIter = ActorContainer::const_iterator;
 
-typedef std::vector< RendererPtr > RendererContainer;
-typedef RendererContainer::iterator RendererIter;
+using RendererContainer = std::vector<RendererPtr>;
+using RendererIter      = RendererContainer::iterator;
 
 class ActorDepthTreeNode;
-typedef Dali::Internal::MemoryPoolObjectAllocator< ActorDepthTreeNode > DepthNodeMemoryPool;
+using DepthNodeMemoryPool = Dali::Internal::MemoryPoolObjectAllocator<ActorDepthTreeNode>;
 
 /**
  * Actor is the primary object which Dali applications interact with.
@@ -113,7 +112,7 @@ public:
     Dimension::Type dimension;    ///< The dimension to hold
   };
 
-  typedef std::vector< ActorDimensionPair > ActorDimensionStack;
+  using ActorDimensionStack = std::vector<ActorDimensionPair>;
 
 public:
 
@@ -1400,17 +1399,16 @@ public:
    * @param[in] type The gesture type.
    * @return True if the gesture is required, false otherwise.
    */
-  bool IsGestureRequred( DevelGesture::Type type ) const;
+  bool IsGestureRequired( GestureType::Value type ) const;
 
   // Signals
 
   /**
    * Used by the EventProcessor to emit touch event signals.
-   * @param[in] event The touch event (Old API).
    * @param[in] touch The touch data.
    * @return True if the event was consumed.
    */
-  bool EmitTouchEventSignal( const TouchEvent& event, const Dali::TouchData& touch );
+  bool EmitTouchEventSignal( const Dali::TouchEvent& touch );
 
   /**
    * Used by the EventProcessor to emit hover event signals.
@@ -1424,7 +1422,7 @@ public:
    * @param[in] event The wheel event.
    * @return True if the event was consumed.
    */
-  bool EmitWheelEventSignal( const WheelEvent& event );
+  bool EmitWheelEventSignal( const Dali::WheelEvent& event );
 
   /**
    * @brief Emits the visibility change signal for this actor and all its children.
@@ -1454,12 +1452,7 @@ public:
   /**
    * @copydoc Dali::Actor::TouchedSignal()
    */
-  Dali::Actor::TouchSignalType& TouchedSignal();
-
-  /**
-   * @copydoc Dali::Actor::TouchEventSignal()
-   */
-  Dali::Actor::TouchDataSignalType& TouchSignal();
+  Dali::Actor::TouchEventSignalType& TouchedSignal();
 
   /**
    * @copydoc Dali::Actor::HoveredSignal()
@@ -1570,7 +1563,7 @@ protected:
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~Actor();
+  ~Actor() override;
 
   /**
    * Called on a child during Add() when the parent actor is connected to the Scene.
@@ -1648,42 +1641,42 @@ public:
   /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
-  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
+  void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ) override;
 
   /**
    * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
    */
-  virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
+  void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value ) override;
 
   /**
    * @copydoc Dali::Internal::Object::GetDefaultProperty()
    */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
+  Property::Value GetDefaultProperty( Property::Index index ) const override;
 
   /**
    * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
    */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
+  Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const override;
 
   /**
    * @copydoc Dali::Internal::Object::OnNotifyDefaultPropertyAnimation()
    */
-  virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
+  void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType ) override;
 
   /**
    * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
    */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
+  const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const override;
 
   /**
    * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
    */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
+  const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const override;
 
   /**
    * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
    */
-  virtual int32_t GetPropertyComponentIndex( Property::Index index ) const;
+  int32_t GetPropertyComponentIndex( Property::Index index ) const override;
 
   /**
    * Retrieve the actor's node.
@@ -1837,39 +1830,6 @@ private:
   }
 
   /**
-   * For use in derived classes.
-   * 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 bool OnTouchEvent( const TouchEvent& event )
-  {
-    return false;
-  }
-
-  /**
-   * For use in derived classes.
-   * 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 OnHoverEvent( const HoverEvent& event )
-  {
-    return false;
-  }
-
-  /**
-   * For use in derived classes.
-   * This is only called if the wheel signal was not consumed.
-   * @param[in] event The wheel event.
-   * @return True if the event should be consumed.
-   */
-  virtual bool OnWheelEvent( const WheelEvent& event )
-  {
-    return false;
-  }
-
-  /**
    * @brief Retrieves the cached event side value of a default property.
    * @param[in]  index  The index of the property
    * @param[out] value  Is set with the cached value of the property if found.
@@ -1902,7 +1862,7 @@ private:
    * Retrieve the parent object of an Actor.
    * @return The parent object, or NULL if the Actor does not have a parent.
    */
-  virtual Object* GetParentObject() const;
+  Object* GetParentObject() const override;
 
   /**
    * Set Sibling order
@@ -1984,8 +1944,7 @@ protected:
   ActorGestureData* mGestureData;   ///< Optional Gesture data. Only created when actor requires gestures
 
   // Signals
-  Dali::Actor::TouchSignalType             mTouchedSignal;
-  Dali::Actor::TouchDataSignalType         mTouchSignal;
+  Dali::Actor::TouchEventSignalType        mTouchedSignal;
   Dali::Actor::HoverSignalType             mHoveredSignal;
   Dali::Actor::WheelEventSignalType        mWheelEventSignal;
   Dali::Actor::OnSceneSignalType           mOnSceneSignal;
@@ -2015,9 +1974,6 @@ protected:
   bool mSensitive                                  : 1; ///< Whether the actor emits touch event signals
   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 mDerivedRequiresWheelEvent                  : 1; ///< Whether the derived actor type requires wheel event signals
   bool mOnSceneSignalled                           : 1; ///< Set to true before OnSceneConnection signal is emitted, and false before OnSceneDisconnection
   bool mInsideOnSizeSet                            : 1; ///< Whether we are inside OnSizeSet
   bool mInheritPosition                            : 1; ///< Cached: Whether the parent's position should be inherited.