Revert "[Tizen] Not execute the remove callback"
[platform/core/uifw/dali-core.git] / dali / internal / event / events / hover-event-impl.h
old mode 100755 (executable)
new mode 100644 (file)
index bf105b3..469427c
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_HOVER_EVENT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/events/touch-point.h>
+#include <dali/integration-api/events/point.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/events/hover-event.h>
-#include <dali/devel-api/events/touch-point.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/events/point.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 class HoverEvent;
-typedef IntrusivePtr< HoverEvent > HoverEventPtr;
+using HoverEventPtr = IntrusivePtr<HoverEvent>;
 
 /**
  * @copydoc Dali::HoverEvent
@@ -40,7 +38,6 @@ typedef IntrusivePtr< HoverEvent > HoverEventPtr;
 class HoverEvent : public BaseObject
 {
 public:
-
   // Construction & Destruction
 
   /**
@@ -52,7 +49,7 @@ public:
    * @brief Constructor
    * @param[in]  time  The time the event occurred
    */
-  HoverEvent( unsigned long time );
+  HoverEvent(unsigned long time);
 
   /**
    * @brief Clones the HoverEvent object.
@@ -61,7 +58,7 @@ public:
    * @param[in] rhs The HoverEvent to clone from.
    * @return A new HoverEvent object which is has the same hover event data.
    */
-  static HoverEventPtr Clone( const HoverEvent& rhs );
+  static HoverEventPtr Clone(const HoverEvent& rhs);
 
   // Getters
 
@@ -78,27 +75,27 @@ public:
   /**
    * @copydoc Dali::HoverEvent::GetDeviceId()
    */
-  int32_t GetDeviceId( std::size_t point ) const;
+  int32_t GetDeviceId(std::size_t point) const;
 
   /**
    * @copydoc Dali::HoverEvent::GetGetState()
    */
-  PointState::Type GetState( std::size_t point  ) const;
+  PointState::Type GetState(std::size_t point) const;
 
   /**
    * @copydoc Dali::HoverEvent::GetHitActor()
    */
-  Dali::Actor GetHitActor( std::size_t point ) const;
+  Dali::Actor GetHitActor(std::size_t point) const;
 
   /**
    * @copydoc Dali::HoverEvent::GetLocalPosition()
    */
-  const Vector2& GetLocalPosition( std::size_t point ) const;
+  const Vector2& GetLocalPosition(std::size_t point) const;
 
   /**
    * @copydoc Dali::HoverEvent::GetScreenPosition()
    */
-  const Vector2& GetScreenPosition( std::size_t point ) const;
+  const Vector2& GetScreenPosition(std::size_t point) const;
 
   /**
    * @brief Returns a const reference to a point at the index requested.
@@ -109,7 +106,7 @@ public:
    * @return A const reference to the Point at the position requested
    * @note point should be less than the value returned by GetPointCount(). Will assert if out of range.
    */
-  const Integration::Point& GetPoint( std::size_t point ) const;
+  const Integration::Point& GetPoint(std::size_t point) const;
 
   /**
    * @brief Returns a reference to a point at the index requested.
@@ -120,7 +117,7 @@ public:
    * @return A reference to the Point at the position requested
    * @note point should be less than the value returned by GetPointCount(). Will assert if out of range.
    */
-  Integration::Point& GetPoint( std::size_t point );
+  Integration::Point& GetPoint(std::size_t point);
 
   // Setters
 
@@ -128,50 +125,48 @@ public:
    * @brief Adds a point to this hover event.
    * @param[in]  point  The point to add to the hover event.
    */
-  void AddPoint( const Integration::Point& point );
+  void AddPoint(const Integration::Point& point);
 
 private:
-
   /**
    * @brief Destructor
    *
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~HoverEvent() = default;
+  ~HoverEvent() override = default;
 
   // Not copyable or movable
 
-  HoverEvent( const HoverEvent& rhs ) = delete;             ///< Deleted copy constructor
-  HoverEvent( HoverEvent&& rhs ) = delete;                  ///< Deleted move constructor
-  HoverEvent& operator=( const HoverEvent& rhs ) = delete;  ///< Deleted copy assignment operator
-  HoverEvent& operator=( HoverEvent&& rhs ) = delete;       ///< Deleted move assignment operator
+  HoverEvent(const HoverEvent& rhs) = delete;            ///< Deleted copy constructor
+  HoverEvent(HoverEvent&& rhs)      = delete;            ///< Deleted move constructor
+  HoverEvent& operator=(const HoverEvent& rhs) = delete; ///< Deleted copy assignment operator
+  HoverEvent& operator=(HoverEvent&& rhs) = delete;      ///< Deleted move assignment operator
 
 private:
-
-  std::vector< Integration::Point > mPoints; ///< Container of the points for this hover event
-  unsigned long mTime;                       ///< The time (in ms) that the hover event occurred
+  std::vector<Integration::Point> mPoints; ///< Container of the points for this hover event
+  unsigned long                   mTime;   ///< The time (in ms) that the hover event occurred
 };
 
 } // namespace Internal
 
 // Helpers for public-api forwarding methods
 
-inline Internal::HoverEvent& GetImplementation( Dali::HoverEvent& hoverEvent )
+inline Internal::HoverEvent& GetImplementation(Dali::HoverEvent& hoverEvent)
 {
-  DALI_ASSERT_ALWAYS( hoverEvent && "Hover Event handle is empty" );
+  DALI_ASSERT_ALWAYS(hoverEvent && "Hover Event handle is empty");
 
   BaseObject& object = hoverEvent.GetBaseObject();
 
-  return static_cast< Internal::HoverEvent& >( object );
+  return static_cast<Internal::HoverEvent&>(object);
 }
 
-inline const Internal::HoverEvent& GetImplementation( const Dali::HoverEvent& hoverEvent )
+inline const Internal::HoverEvent& GetImplementation(const Dali::HoverEvent& hoverEvent)
 {
-  DALI_ASSERT_ALWAYS( hoverEvent && "Hover Event handle is empty" );
+  DALI_ASSERT_ALWAYS(hoverEvent && "Hover Event handle is empty");
 
   const BaseObject& object = hoverEvent.GetBaseObject();
 
-  return static_cast< const Internal::HoverEvent& >( object );
+  return static_cast<const Internal::HoverEvent&>(object);
 }
 
 } // namespace Dali