X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Ftouch-data.h;h=ada22527319f379aef7c3991d6f75a56ddcb836a;hb=baad1726f5f7f05d98da7ca591f24dbe3c49dab2;hp=7b1cfd2072261399739b5a77fd520fea40a9041f;hpb=a6f64ac5155a1cc6374d4818fad2c7fb19e35610;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/touch-data.h b/dali/public-api/events/touch-data.h old mode 100644 new mode 100755 index 7b1cfd2..ada2252 --- a/dali/public-api/events/touch-data.h +++ b/dali/public-api/events/touch-data.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOUCH_DATA_H__ -#define __DALI_TOUCH_DATA_H__ +#ifndef DALI_TOUCH_DATA_H +#define DALI_TOUCH_DATA_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -23,8 +23,11 @@ // INTERNAL INCLUDES #include +#include #include #include +#include +#include namespace Dali { @@ -50,9 +53,13 @@ struct Vector2; * * The first point is the primary point that's used for hit-testing. * @SINCE_1_1.37 - * @note Should not use this in a TouchData container as it is just a handle and the internal object can change. + * @note As this is a handle to an internal object, it should not be copied (or used in a container) as all that will do is copy the handle to the same object. + * The internal object can change which may not be what an application writer expects. + * If data does need to be stored in the application, then only the required data should be saved (retrieved using the methods of this class). + * + * Should not use this in a TouchData container as it is just a handle and the internal object can change. */ -class DALI_IMPORT_API TouchData : public BaseHandle +class DALI_CORE_API TouchData : public BaseHandle { public: @@ -67,15 +74,15 @@ public: TouchData(); /** - * @brief Copy constructor + * @brief Copy constructor. * * @SINCE_1_1.37 - * @param[in] other The TouchEventHandle to copy from. + * @param[in] other The TouchData to copy from */ TouchData( const TouchData& other ); /** - * @brief Destructor + * @brief Destructor. * * @SINCE_1_1.37 */ @@ -84,10 +91,11 @@ public: // Operators /** - * @brief Assignment Operator + * @brief Assignment Operator. * * @SINCE_1_1.37 - * @param[in] other The TouchEventHandle to copy from. + * @param[in] other The TouchData to copy from + * @return A reference to this */ TouchData& operator=( const TouchData& other ); @@ -97,17 +105,17 @@ public: * @brief Returns the time (in ms) that the touch event occurred. * * @SINCE_1_1.37 - * @return The time (in ms) that the touch event occurred. + * @return The time (in ms) that the touch event occurred */ unsigned long GetTime() const; /** - * @brief Returns the total number of points in this TouchEventHandle. + * @brief Returns the total number of points in this TouchData. * * @SINCE_1_1.37 - * @return Total number of Points. + * @return Total number of Points */ - size_t GetPointCount() const; + std::size_t GetPointCount() const; /** * @brief Returns the ID of the device used for the Point specified. @@ -116,68 +124,146 @@ public: * point. This is returned by this method. * * @SINCE_1_1.37 - * @param[in] point The point required. - * @return The Device ID of this point. + * @param[in] point The point required + * @return The Device ID of this point * @note If point is greater than GetPointCount() then this method will return -1. */ - int32_t GetDeviceId( size_t point ) const; + int32_t GetDeviceId( std::size_t point ) const; /** * @brief Retrieves the State of the point specified. * * @SINCE_1_1.37 - * @param[in] point The point required. - * @return The state of the point specified. - * @note If point is greater than GetPointCount() then this method will - * return PointState::FINISHED. + * @param[in] point The point required + * @return The state of the point specified + * @note If point is greater than GetPointCount() then this method will return PointState::FINISHED. * @see State */ - PointState::Type GetState( size_t point ) const; + PointState::Type GetState( std::size_t point ) const; /** - * @brief Retrieve the actor that was underneath the point specified. + * @brief Retrieves the actor that was underneath the point specified. * * @SINCE_1_1.37 - * @param[in] point The point required. - * @return The actor that was underneath the point specified. - * @note If point is greater than GetPointCount() then this method will return - * an empty handle. + * @param[in] point The point required + * @return The actor that was underneath the point specified + * @note If point is greater than GetPointCount() then this method will return an empty handle. */ - Actor GetHitActor( size_t point ) const; + Actor GetHitActor( std::size_t point ) const; /** - * @brief Retrieve the co-ordinates relative to the top-left of the hit-actor at the point specified. + * @brief Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified. * * @SINCE_1_1.37 - * @param[in] point The point required. - * @return The co-ordinates relative to the top-left of the hit-actor of the point specified. + * @param[in] point The point required + * @return The co-ordinates relative to the top-left of the hit-actor of the point specified * * @note The top-left of an actor is (0.0, 0.0, 0.5). * @note If you require the local coordinates of another actor (e.g the parent of the hit actor), * then you should use Actor::ScreenToLocal(). * @note If point is greater than GetPointCount() then this method will return Vector2::ZERO. */ - const Vector2& GetLocalPosition( size_t point ) const; + const Vector2& GetLocalPosition( std::size_t point ) const; /** * @brief Retrieves the co-ordinates relative to the top-left of the screen of the point specified. * * @SINCE_1_1.37 - * @param[in] point The point required. - * @return The co-ordinates relative to the top-left of the screen of the point specified. + * @param[in] point The point required + * @return The co-ordinates relative to the top-left of the screen of the point specified * @note If point is greater than GetPointCount() then this method will return Vector2::ZERO. */ - const Vector2& GetScreenPosition( size_t point ) const; + const Vector2& GetScreenPosition( std::size_t point ) const; + + /** + * @brief Retrieves the radius of the press point. + * + * This is the average of both the horizontal and vertical radii of the press point. + * + * @SINCE_1_1.39 + * @param[in] point The point required + * @return The radius of the press point + * @note If point is greater than GetPointCount() then this method will return 0.0f. + */ + float GetRadius( std::size_t point ) const; + + /** + * @brief Retrieves BOTH the horizontal and the vertical radii of the press point. + * + * @SINCE_1_1.39 + * @param[in] point The point required + * @return The horizontal and vertical radii of the press point + * @note If point is greater than GetPointCount() then this method will return Vector2::ZERO. + */ + const Vector2& GetEllipseRadius( std::size_t point ) const; + + /** + * @brief Retrieves the touch pressure. + * + * The pressure range starts at 0.0f. + * Normal pressure is defined as 1.0f. + * A value between 0.0f and 1.0f means light pressure has been applied. + * A value greater than 1.0f means more pressure than normal has been applied. + * + * @SINCE_1_1.39 + * @param[in] point The point required + * @return The touch pressure + * @note If point is greater than GetPointCount() then this method will return 1.0f. + */ + float GetPressure( std::size_t point ) const; + + /** + * @brief Retrieves the angle of the press point relative to the Y-Axis. + * + * @SINCE_1_1.39 + * @param[in] point The point required + * @return The angle of the press point + * @note If point is greater than GetPointCount() then this method will return Degree(). + */ + Degree GetAngle( std::size_t point ) const; + + /** + * @brief Get the device class type the mouse/touch event originated from. + * + * The device class type is classification type of the input device of event received. + * @SINCE_1_2.60 + * @param[in] point The point required + * @return The type of the device class + */ + Device::Class::Type GetDeviceClass( std::size_t point ) const; + + /** + * @brief Get the device subclass type the mouse/touch event originated from. + * + * The device subclass type is subclassification type of the input device of event received. + * @SINCE_1_2.60 + * @param[in] point The point required + * @return The type of the device subclass + */ + Device::Subclass::Type GetDeviceSubclass( std::size_t point ) const; + + + /** + * @brief Get mouse device's button value (ex: right/left button) + * + * @SINCE_1_3_31 + * @param[in] point The point required + * @return The mouse button value + */ + MouseButton::Type GetMouseButton( std::size_t point ) const; + public: // Not intended for application developers + /// @cond internal /** * @brief This constructor is used internally to Create an initialized TouchData handle. * * @SINCE_1_1.37 - * @param [in] touchData A pointer to a newly allocated Dali resource + * @param[in] touchData A pointer to a newly allocated Dali resource */ explicit DALI_INTERNAL TouchData( Internal::TouchData* touchData ); + /// @endcond }; /** @@ -185,4 +271,4 @@ public: // Not intended for application developers */ } // namespace Dali -#endif // __DALI_TOUCH_DATA_H__ +#endif // DALI_TOUCH_DATA_H