48131bc8b51a3d4e806c299686d833a29b221886
[platform/core/uifw/dali-core.git] / capi / dali / public-api / events / pinch-gesture.h
1 #ifndef __DALI_PINCH_GESTURE_H__
2 #define __DALI_PINCH_GESTURE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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  * @addtogroup CAPI_DALI_FRAMEWORK
22  * @{
23  */
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/events/gesture.h>
27 #include <dali/public-api/math/vector2.h>
28
29 namespace Dali DALI_IMPORT_API
30 {
31
32 /**
33  * A PinchGesture is emitted when the user moves two fingers towards or away from each other.
34  * This gesture can be in one of three states; when the pinch gesture is first detected, its
35  * state is set to "Started".  After this, if there is change in the gesture, the state will
36  * be "Continuing".  Finally, when the gesture ends, the state of the gesture changes to
37  * "Finished".
38  *
39  * A pinch gesture will continue to be sent to the actor under the center point of the pinch
40  * until the pinch ends.
41  */
42 struct PinchGesture: public Gesture
43 {
44   // Construction & Destruction
45
46   /**
47    * Default Constructor
48    * @param[in]  state  The state of the gesture
49    */
50   PinchGesture(Gesture::State state);
51
52   /**
53    * Copy constructor
54    */
55   PinchGesture( const PinchGesture& rhs );
56
57   /**
58    * Assignment operator
59    */
60   PinchGesture& operator=( const PinchGesture& rhs );
61
62   /**
63    * Virtual destructor
64    */
65   virtual ~PinchGesture();
66
67   // Data
68
69   /**
70    * The scale factor from the start of the pinch gesture till the latest pinch gesture. If the user
71    * is moving their fingers away from each other, then this value increases.  Conversely, if the
72    * user is moving their fingers towards each other, this value will decrease.
73    */
74   float scale;
75
76   /**
77    * The speed at which the user is moving their fingers.  This is the pixel movement per second.
78    */
79   float speed;
80
81   /**
82    * The center point of the two points that caused the pinch gesture in screen coordinates.
83    */
84   Vector2 screenCenterPoint;
85
86   /**
87    * The center point of the two points that caused the pinch gesture in local actor coordinates.
88    */
89   Vector2 localCenterPoint;
90 };
91
92 } // namespace Dali
93
94 /**
95  * @}
96  */
97 #endif // __DALI_PINCH_GESTURE_H__