Merge "Update the doxygen comment" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / events / pinch-gesture.h
1 #ifndef DALI_PINCH_GESTURE_H
2 #define DALI_PINCH_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/vector2.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_events
29  * @{
30  */
31
32 /**
33  * @brief A PinchGesture is emitted when the user moves two fingers towards or away from each other.
34  *
35  * This gesture can be in one of three states; when the pinch gesture is first detected, its
36  * state is set to Gesture::Started.  After this, if there is change in the gesture, the state will
37  * be Gesture::Continuing. Finally, when the gesture ends, the state of the gesture changes to
38  * Gesture::Finished.
39  *
40  * A pinch gesture will continue to be sent to the actor under the center point of the pinch
41  * until the pinch ends.
42  * @SINCE_1_0.0
43  */
44 struct DALI_CORE_API PinchGesture: public Gesture
45 {
46   // Construction & Destruction
47
48   /**
49    * @brief Default Constructor.
50    *
51    * @SINCE_1_0.0
52    * @param[in] state The state of the gesture
53    */
54   PinchGesture(Gesture::State state);
55
56   /**
57    * @brief Copy constructor.
58    * @SINCE_1_0.0
59    * @param[in] rhs A reference to the copied handle
60    */
61   PinchGesture( const PinchGesture& rhs );
62
63   /**
64    * @brief Assignment operator.
65    * @SINCE_1_0.0
66    * @param[in] rhs A reference to the copied handle
67    * @return A reference to this
68    */
69   PinchGesture& operator=( const PinchGesture& rhs );
70
71   /**
72    * @brief Virtual destructor.
73    * @SINCE_1_0.0
74    */
75   virtual ~PinchGesture();
76
77   // Data
78
79   /**
80    * @brief The scale factor from the start of the pinch gesture till the latest pinch gesture.
81    *
82    * If the user is moving their fingers away from each other, then
83    * this value increases.  Conversely, if the user is moving their
84    * fingers towards each other, this value will decrease.
85    */
86   float scale;
87
88   /**
89    * @brief The speed at which the user is moving their fingers.
90    *
91    * This is the pixel movement per second.
92    */
93   float speed;
94
95   /**
96    * @brief The center point of the two points that caused the pinch gesture in screen coordinates.
97    */
98   Vector2 screenCenterPoint;
99
100   /**
101    * @brief The center point of the two points that caused the pinch gesture in local actor coordinates.
102    */
103   Vector2 localCenterPoint;
104 };
105
106 /**
107  * @}
108  */
109 } // namespace Dali
110
111 #endif // DALI_PINCH_GESTURE_H