[dali_1.1.19] Merge branch '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) 2015 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 "Started".  After this, if there is change in the gesture, the state will
37  * be "Continuing".  Finally, when the gesture ends, the state of the gesture changes to
38  * "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_IMPORT_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    */
60   PinchGesture( const PinchGesture& rhs );
61
62   /**
63    * @brief Assignment operator.
64    * @SINCE_1_0.0
65    */
66   PinchGesture& operator=( const PinchGesture& rhs );
67
68   /**
69    * @brief Virtual destructor.
70    * @SINCE_1_0.0
71    */
72   virtual ~PinchGesture();
73
74   // Data
75
76   /**
77    * @brief The scale factor from the start of the pinch gesture till the latest pinch gesture.
78    *
79    * If the user is moving their fingers away from each other, then
80    * this value increases.  Conversely, if the user is moving their
81    * fingers towards each other, this value will decrease.
82    */
83   float scale;
84
85   /**
86    * @brief The speed at which the user is moving their fingers.
87    *
88    * This is the pixel movement per second.
89    */
90   float speed;
91
92   /**
93    * @brief The center point of the two points that caused the pinch gesture in screen coordinates.
94    */
95   Vector2 screenCenterPoint;
96
97   /**
98    * @brief The center point of the two points that caused the pinch gesture in local actor coordinates.
99    */
100   Vector2 localCenterPoint;
101 };
102
103 /**
104  * @}
105  */
106 } // namespace Dali
107
108 #endif // __DALI_PINCH_GESTURE_H__