Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / devel-api / events / rotation-gesture.h
1 #ifndef DALI_ROTATION_GESTURE_H
2 #define DALI_ROTATION_GESTURE_H
3
4 /*
5  * Copyright (c) 2019 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  */
41 struct DALI_CORE_API RotationGesture: public Gesture
42 {
43   // Construction & Destruction
44
45   /**
46    * @brief Default Constructor.
47    *
48    * @param[in] state The state of the gesture
49    */
50   RotationGesture( Gesture::State state );
51
52   /**
53    * @brief Copy constructor.
54    * @param[in] rhs A reference to the copied handle
55    */
56   RotationGesture( const RotationGesture& rhs );
57
58   /**
59    * @brief Assignment operator.
60    * @param[in] rhs A reference to the copied handle
61    * @return A reference to this
62    */
63   RotationGesture& operator=( const RotationGesture& rhs );
64
65   /**
66    * @brief Virtual destructor.
67    */
68   virtual ~RotationGesture();
69
70   // Data
71
72   /**
73    * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
74    */
75   Radian rotation;
76
77   /**
78    * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
79    */
80   Vector2 screenCenterPoint;
81
82   /**
83    * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
84    */
85   Vector2 localCenterPoint;
86 };
87
88 } // namespace Dali
89
90 #endif // DALI_ROTATION_GESTURE_H