Fixing the remaining exports from public API
[platform/core/uifw/dali-core.git] / dali / public-api / events / gesture.h
1 #ifndef __DALI_GESTURE_H__
2 #define __DALI_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/common/dali-common.h>
23
24 namespace Dali
25 {
26
27 /**
28  * @brief Base structure for different gestures that an application can receive.
29  *
30  * A gesture is an event that is produced from a combination of
31  * several touch events in a particular order or within a certain time
32  * frame (e.g pinch).
33  *
34  * To receive a particular gesture, the application has to create and connect to the appropriate
35  * GestureDetector.
36  *
37  * @see GestureDetector
38  *
39  * @note An instance of this class cannot be created.
40  */
41 struct DALI_IMPORT_API Gesture
42 {
43   /**
44    * @brief Copy constructor.
45    */
46   Gesture( const Gesture& rhs );
47
48   /**
49    * @brief Assignment operator.
50    */
51   Gesture& operator=( const Gesture& rhs );
52
53   // Destruction
54
55   /**
56    * @brief Virtual destructor.
57    */
58   virtual ~Gesture();
59
60   /**
61    * @brief Type of gesture.
62    */
63   enum Type
64   {
65     Pinch      = 1 << 0, ///< When two touch points move away or towards each other.
66     Pan        = 1 << 1, ///< When the user drags their finger(s) in a particular direction.
67     Tap        = 1 << 2, ///< When the user taps the screen.
68     LongPress  = 1 << 3  ///< When the user continues to touch the same area on the screen for the device configured time.
69   };
70
71   /**
72    * @brief State of the gesture.
73    */
74   enum State
75   {
76     Clear,      ///< There is no state associated with this gesture.
77     Started,    ///< The touched points on the screen have moved enough to be considered a gesture.
78     Continuing, ///< The gesture is continuing.
79     Finished,   ///< The user has lifted a finger or touched an additional point on the screen.
80     Cancelled,  ///< The gesture has been cancelled.
81     Possible    ///< A gesture is possible.
82   };
83
84   // Data
85
86   /**
87    * @brief The gesture type.
88    */
89   Type type;
90
91   /**
92    * @brief The gesture state.
93    *
94    * Please see the description in the sub-classes to see the states
95    * used by the actual gesture.
96    */
97   State state;
98
99   /**
100    * @brief The time the gesture took place.
101    */
102   unsigned int time;
103
104 protected: // Creation
105
106   /**
107    * @brief This constructor is only used by derived classes.
108    *
109    * @param[in] gestureType   The type of gesture event.
110    * @param[in] gestureState  The state of the gesture event.
111    */
112   Gesture(Type gestureType, State gestureState);
113
114 };
115
116 } // namespace Dali
117
118 #endif // __DALI_GESTURE_H__