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