[dali_1.0.16] Merge branch 'tizen'
[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) 2014 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 /**
29  * @brief A PinchGesture is emitted when the user moves two fingers towards or away from each other.
30  *
31  * This gesture can be in one of three states; when the pinch gesture is first detected, its
32  * state is set to "Started".  After this, if there is change in the gesture, the state will
33  * be "Continuing".  Finally, when the gesture ends, the state of the gesture changes to
34  * "Finished".
35  *
36  * A pinch gesture will continue to be sent to the actor under the center point of the pinch
37  * until the pinch ends.
38  */
39 struct DALI_IMPORT_API PinchGesture: public Gesture
40 {
41   // Construction & Destruction
42
43   /**
44    * @brief Default Constructor.
45    *
46    * @param[in]  state  The state of the gesture
47    */
48   PinchGesture(Gesture::State state);
49
50   /**
51    * @brief Copy constructor.
52    */
53   PinchGesture( const PinchGesture& rhs );
54
55   /**
56    * @brief Assignment operator.
57    */
58   PinchGesture& operator=( const PinchGesture& rhs );
59
60   /**
61    * @brief Virtual destructor.
62    */
63   virtual ~PinchGesture();
64
65   // Data
66
67   /**
68    * @brief The scale factor from the start of the pinch gesture till the latest pinch gesture.
69    *
70    * If the user is moving their fingers away from each other, then
71    * this value increases.  Conversely, if the user is moving their
72    * fingers towards each other, this value will decrease.
73    */
74   float scale;
75
76   /**
77    * @brief The speed at which the user is moving their fingers.
78    *
79    * This is the pixel movement per second.
80    */
81   float speed;
82
83   /**
84    * @brief The center point of the two points that caused the pinch gesture in screen coordinates.
85    */
86   Vector2 screenCenterPoint;
87
88   /**
89    * @brief The center point of the two points that caused the pinch gesture in local actor coordinates.
90    */
91   Vector2 localCenterPoint;
92 };
93
94 } // namespace Dali
95
96 #endif // __DALI_PINCH_GESTURE_H__