Moved Gesture::State and -::Type to gesture-enumerations.h.
[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) 2020 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 // EXTERNAL INCLUDES
22 #include <cstdint> // uint32_t
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/common/dali-common.h>
26 #include <dali/public-api/object/base-handle.h>
27 #include <dali/public-api/events/gesture-enumerations.h>
28
29 namespace Dali
30 {
31 /**
32  * @addtogroup dali_core_events
33  * @{
34  */
35
36 namespace Internal DALI_INTERNAL
37 {
38 class Gesture;
39 }
40
41 /**
42  * @brief Base structure for different gestures that an application can receive.
43  *
44  * A gesture is an event that is produced from a combination of
45  * several touch events in a particular order or within a certain time
46  * frame (e.g pinch).
47  *
48  * To receive a particular gesture, the application has to create and connect to the appropriate
49  * GestureDetector.
50  *
51  * @SINCE_1_9.28
52  * @note An instance of this class cannot be created.
53  * @see GestureDetector
54  *
55  */
56 class DALI_CORE_API Gesture : public BaseHandle
57 {
58 public:
59
60   /**
61    * @brief Creates an uninitialized Gesture handle.
62    *
63    * Calling member functions with an uninitialized Actor handle is not allowed.
64    * @SINCE_1_9.28
65    */
66   Gesture();
67
68   /**
69    * @brief Copy constructor.
70    * @SINCE_1_9.28
71    * @param[in] rhs A reference to the copied handle
72    */
73   Gesture( const Gesture& rhs );
74
75   /**
76    * @brief Move constructor.
77    * @SINCE_1_9.28
78    * @param[in] rhs A reference to the handle to move
79    */
80   Gesture( Gesture&& rhs );
81
82   /**
83    * @brief Assignment operator.
84    * @SINCE_1_9.28
85    * @param[in] rhs A reference to the copied handle
86    * @return A reference to this
87    */
88   Gesture& operator=( const Gesture& rhs );
89
90   /**
91    * @brief Move assignment operator.
92    * @SINCE_1_9.28
93    * @param[in] rhs A reference to the handle to move
94    * @return A reference to this
95    */
96   Gesture& operator=( Gesture&& rhs );
97
98   /**
99    * @brief Non virtual destructor.
100    * @SINCE_1_9.28
101    */
102   ~Gesture();
103
104   /**
105    * @brief The gesture type.
106    * @SINCE_1_9.28
107    * @return The gesture type
108    */
109   GestureType::Value GetType() const;
110
111   /**
112    * @brief The gesture state.
113    *
114    * Please see the description in the sub-classes to see the states
115    * used by the actual gesture.
116    * @SINCE_1_9.28
117    * @return The state of the gesture
118    */
119   GestureState GetState() const;
120
121   /**
122    * @brief The time the gesture took place.
123    * @SINCE_1_9.28
124    * @return The time the gesture took place
125    */
126   uint32_t GetTime() const;
127
128 public: // Not intended for application developers
129
130   /// @cond internal
131   /**
132    * @brief Internal constructor.
133    * @SINCE_1_9.28
134    * @param[in] gesture Pointer to internal gesture
135    */
136   explicit DALI_INTERNAL Gesture(Internal::Gesture* gesture);
137   /// @endcond
138 };
139
140 /**
141  * @}
142  */
143 } // namespace Dali
144
145 #endif // DALI_GESTURE_H