1 #ifndef DALI_ROTATION_GESTURE_H
2 #define DALI_ROTATION_GESTURE_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/events/gesture.h>
23 #include <dali/public-api/math/radian.h>
24 #include <dali/public-api/math/vector2.h>
30 * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
31 * in a rotational/circular gesture.
33 * This gesture can be in one of three states; when the rotation gesture is first detected, its
34 * state is set to Gesture::Started. After this, if there is change in the gesture, the state will
35 * be Gesture::Continuing. Finally, when the gesture ends, the state of the gesture changes to
38 * A rotation gesture will continue to be sent to the actor under the center point of the rotation
39 * until the rotation ends.
42 struct DALI_CORE_API RotationGesture: public Gesture
44 // Construction & Destruction
47 * @brief Default Constructor.
49 * @param[in] state The state of the gesture
51 RotationGesture( Gesture::State state );
54 * @brief Copy constructor.
56 * @param[in] rhs A reference to the copied handle
58 RotationGesture( const RotationGesture& rhs );
61 * @brief Assignment operator.
63 * @param[in] rhs A reference to the copied handle
64 * @return A reference to this
66 RotationGesture& operator=( const RotationGesture& rhs );
69 * @brief Virtual destructor.
72 virtual ~RotationGesture();
77 * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
83 * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
86 Vector2 screenCenterPoint;
89 * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
92 Vector2 localCenterPoint;
97 #endif // DALI_ROTATION_GESTURE_H