Moved Gesture::State and -::Type to gesture-enumerations.h.
[platform/core/uifw/dali-core.git] / dali / public-api / events / rotation-gesture.h
1 #ifndef DALI_ROTATION_GESTURE_H
2 #define DALI_ROTATION_GESTURE_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/events/gesture.h>
23 #include <dali/public-api/math/radian.h>
24 #include <dali/public-api/math/vector2.h>
25
26 namespace Dali
27 {
28
29 namespace Internal DALI_INTERNAL
30 {
31 class RotationGesture;
32 }
33
34 /**
35  * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
36  * in a rotational/circular gesture.
37  *
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.
42  *
43  * A rotation gesture will continue to be sent to the actor under the center point of the rotation
44  * until the rotation ends.
45  * @SINCE_1_9.28
46  */
47 class DALI_CORE_API RotationGesture: public Gesture
48 {
49 public:
50
51   /**
52    * @brief Creates an uninitialized RotationGesture handle.
53    *
54    * Calling member functions with an uninitialized Actor handle is not allowed.
55    * @SINCE_1_9.28
56    */
57   RotationGesture();
58
59   /**
60    * @brief Copy constructor.
61    * @SINCE_1_9.28
62    * @param[in] rhs A reference to the copied handle
63    */
64   RotationGesture( const RotationGesture& rhs );
65
66   /**
67    * @brief Move constructor.
68    * @SINCE_1_9.28
69    * @param[in] rhs A reference to the moved handle
70    */
71   RotationGesture( RotationGesture&& rhs );
72
73   /**
74    * @brief Assignment operator.
75    * @SINCE_1_9.28
76    * @param[in] rhs A reference to the copied handle
77    * @return A reference to this
78    */
79   RotationGesture& operator=( const RotationGesture& rhs );
80
81   /**
82    * @brief Move assignment operator.
83    * @SINCE_1_9.28
84    * @param[in] rhs A reference to the moved handle
85    * @return A reference to this
86    */
87   RotationGesture& operator=( RotationGesture&& rhs );
88
89   /**
90    * @brief Non virtual destructor.
91    * @SINCE_1_9.28
92    */
93   ~RotationGesture();
94
95   /**
96    * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
97    * @SINCE_1_9.28
98    * @return The rotation from the start of the rotation gesture till the latest rotation gesture.
99    */
100   const Radian& GetRotation() const;
101
102   /**
103    * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
104    * @SINCE_1_9.28
105    * @return The center point in screen coordinates
106    */
107   const Vector2& GetScreenCenterPoint() const;
108
109   /**
110    * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
111    * @SINCE_1_9.28
112    * @return The center point in local actor coordinates
113    */
114   const Vector2& GetLocalCenterPoint() const;
115
116 public: // Not intended for application developers
117
118   /// @cond internal
119   /**
120    * @brief This constructor is used internally to Create an initialized RotationGesture handle.
121    *
122    * @param[in] rotationGesture A pointer to a newly allocated Dali resource
123    * @SINCE_1_9.28
124    */
125   explicit DALI_INTERNAL RotationGesture( Internal::RotationGesture* rotationGesture );
126   /// @endcond
127 };
128
129 } // namespace Dali
130
131 #endif // DALI_ROTATION_GESTURE_H