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>
29 namespace Internal DALI_INTERNAL
31 class RotationGesture;
35 * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
36 * in a rotational/circular gesture.
38 * This gesture can be in one of three states; when the rotation gesture is first detected, its
39 * state is set to GestureState::STARTED. After this, if there is change in the gesture, the state will
40 * be GestureState::CONTINUING. Finally, when the gesture ends, the state of the gesture changes to
41 * GestureState::FINISHED.
43 * A rotation gesture will continue to be sent to the actor under the center point of the rotation
44 * until the rotation ends.
47 class DALI_CORE_API RotationGesture: public Gesture
52 * @brief Creates an uninitialized RotationGesture handle.
54 * Calling member functions with an uninitialized Actor handle is not allowed.
60 * @brief Copy constructor.
62 * @param[in] rhs A reference to the copied handle
64 RotationGesture( const RotationGesture& rhs );
67 * @brief Move constructor.
69 * @param[in] rhs A reference to the moved handle
71 RotationGesture( RotationGesture&& rhs );
74 * @brief Assignment operator.
76 * @param[in] rhs A reference to the copied handle
77 * @return A reference to this
79 RotationGesture& operator=( const RotationGesture& rhs );
82 * @brief Move assignment operator.
84 * @param[in] rhs A reference to the moved handle
85 * @return A reference to this
87 RotationGesture& operator=( RotationGesture&& rhs );
90 * @brief Non virtual destructor.
96 * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
98 * @return The rotation from the start of the rotation gesture till the latest rotation gesture.
100 const Radian& GetRotation() const;
103 * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
105 * @return The center point in screen coordinates
107 const Vector2& GetScreenCenterPoint() const;
110 * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
112 * @return The center point in local actor coordinates
114 const Vector2& GetLocalCenterPoint() const;
116 public: // Not intended for application developers
120 * @brief This constructor is used internally to Create an initialized RotationGesture handle.
122 * @param[in] rotationGesture A pointer to a newly allocated Dali resource
125 explicit DALI_INTERNAL RotationGesture( Internal::RotationGesture* rotationGesture );
131 #endif // DALI_ROTATION_GESTURE_H