X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fevents%2Fhover-event-impl.h;h=469427ca15317f49509084c2f09f45a018ca52d8;hb=ddcfbfa79b3abc35156679717387cdc54e14d550;hp=36c97253084d26511651e2551579a4872ce45bb6;hpb=e2bd0ba20c37453a16a3470b19d1606ac615e78f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/events/hover-event-impl.h b/dali/internal/event/events/hover-event-impl.h old mode 100755 new mode 100644 index 36c9725..469427c --- a/dali/internal/event/events/hover-event-impl.h +++ b/dali/internal/event/events/hover-event-impl.h @@ -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. @@ -19,20 +19,18 @@ */ // INTERNAL INCLUDES +#include +#include #include #include -#include #include -#include namespace Dali { - namespace Internal { - class HoverEvent; -typedef IntrusivePtr< HoverEvent > HoverEventPtr; +using HoverEventPtr = IntrusivePtr; /** * @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,12 +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 ); - - /** - * @brief Destructor - */ - ~HoverEvent(); + static HoverEventPtr Clone(const HoverEvent& rhs); // Getters @@ -83,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. @@ -114,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. @@ -125,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 @@ -133,43 +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() + */ + ~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 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(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(object); } } // namespace Dali