Ensure BaseHandle class move noexcept (core 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) 2022 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/events/gesture-enumerations.h>
27 #include <dali/public-api/object/base-handle.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    * @brief Creates an uninitialized Gesture handle.
61    *
62    * Calling member functions with an uninitialized Actor handle is not allowed.
63    * @SINCE_1_9.28
64    */
65   Gesture();
66
67   /**
68    * @brief Copy constructor.
69    * @SINCE_1_9.28
70    * @param[in] rhs A reference to the copied handle
71    */
72   Gesture(const Gesture& rhs);
73
74   /**
75    * @brief Move constructor.
76    * @SINCE_1_9.28
77    * @param[in] rhs A reference to the handle to move
78    */
79   Gesture(Gesture&& rhs) noexcept;
80
81   /**
82    * @brief Assignment operator.
83    * @SINCE_1_9.28
84    * @param[in] rhs A reference to the copied handle
85    * @return A reference to this
86    */
87   Gesture& operator=(const Gesture& rhs);
88
89   /**
90    * @brief Move assignment operator.
91    * @SINCE_1_9.28
92    * @param[in] rhs A reference to the handle to move
93    * @return A reference to this
94    */
95   Gesture& operator=(Gesture&& rhs) noexcept;
96
97   /**
98    * @brief Non virtual destructor.
99    * @SINCE_1_9.28
100    */
101   ~Gesture();
102
103   /**
104    * @brief The gesture type.
105    * @SINCE_1_9.28
106    * @return The gesture type
107    */
108   GestureType::Value GetType() const;
109
110   /**
111    * @brief The gesture state.
112    *
113    * Please see the description in the sub-classes to see the states
114    * used by the actual gesture.
115    * @SINCE_1_9.28
116    * @return The state of the gesture
117    */
118   GestureState GetState() const;
119
120   /**
121    * @brief The time the gesture took place.
122    * @SINCE_1_9.28
123    * @return The time the gesture took place
124    */
125   uint32_t GetTime() const;
126
127   /**
128    * @brief Gets the value of which source the gesture was started with. (ex : mouse)
129    * @SINCE_2_2.0
130    * @return The gesture input source.
131    */
132   GestureSourceType GetSourceType() const;
133
134   /**
135    * @brief Gets the data of the source type.
136    * @SINCE_2_2.0
137    * @return The gesture source data.
138    */
139   GestureSourceData GetSourceData() const;
140
141 public: // Not intended for application developers
142   /// @cond internal
143   /**
144    * @brief Internal constructor.
145    * @SINCE_1_9.28
146    * @param[in] gesture Pointer to internal gesture
147    */
148   explicit DALI_INTERNAL Gesture(Internal::Gesture* gesture);
149   /// @endcond
150 };
151
152 /**
153  * @}
154  */
155 } // namespace Dali
156
157 #endif // DALI_GESTURE_H