fa3894f4a93054d363cb99c37c51730dd5e1abee
[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 /**
30  * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
31  * in a rotational/circular gesture.
32  *
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
36  * Gesture::Finished.
37  *
38  * A rotation gesture will continue to be sent to the actor under the center point of the rotation
39  * until the rotation ends.
40  * @SINCE_1_9.27
41  */
42 struct DALI_CORE_API RotationGesture: public Gesture
43 {
44   // Construction & Destruction
45
46   /**
47    * @brief Default Constructor.
48    * @SINCE_1_9.27
49    * @param[in] state The state of the gesture
50    */
51   RotationGesture( Gesture::State state );
52
53   /**
54    * @brief Copy constructor.
55    * @SINCE_1_9.27
56    * @param[in] rhs A reference to the copied handle
57    */
58   RotationGesture( const RotationGesture& rhs );
59
60   /**
61    * @brief Assignment operator.
62    * @SINCE_1_9.27
63    * @param[in] rhs A reference to the copied handle
64    * @return A reference to this
65    */
66   RotationGesture& operator=( const RotationGesture& rhs );
67
68   /**
69    * @brief Virtual destructor.
70    * @SINCE_1_9.27
71    */
72   virtual ~RotationGesture();
73
74   // Data
75
76   /**
77    * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
78    * @SINCE_1_9.27
79    */
80   Radian rotation;
81
82   /**
83    * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
84    * @SINCE_1_9.27
85    */
86   Vector2 screenCenterPoint;
87
88   /**
89    * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
90    * @SINCE_1_9.27
91    */
92   Vector2 localCenterPoint;
93 };
94
95 } // namespace Dali
96
97 #endif // DALI_ROTATION_GESTURE_H