Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / events / rotation-gesture.h
1 #ifndef DALI_ROTATION_GESTURE_H
2 #define DALI_ROTATION_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 // INTERNAL INCLUDES
22 #include <dali/public-api/events/gesture.h>
23 #include <dali/public-api/math/radian.h>
24 #include <dali/public-api/math/vector2.h>
25
26 namespace Dali
27 {
28 namespace Internal DALI_INTERNAL
29 {
30 class RotationGesture;
31 }
32
33 /**
34  * @brief A RotationGesture is emitted when the user moves two fingers that are opposite each other
35  * in a rotational/circular gesture.
36  *
37  * This gesture can be in one of three states; when the rotation gesture is first detected, its
38  * state is set to GestureState::STARTED.  After this, if there is change in the gesture, the state will
39  * be GestureState::CONTINUING. Finally, when the gesture ends, the state of the gesture changes to
40  * GestureState::FINISHED.
41  *
42  * A rotation gesture will continue to be sent to the actor under the center point of the rotation
43  * until the rotation ends.
44  * @SINCE_1_9.28
45  */
46 class DALI_CORE_API RotationGesture : public Gesture
47 {
48 public:
49   /**
50    * @brief Creates an uninitialized RotationGesture handle.
51    *
52    * Calling member functions with an uninitialized Actor handle is not allowed.
53    * @SINCE_1_9.28
54    */
55   RotationGesture();
56
57   /**
58    * @brief Copy constructor.
59    * @SINCE_1_9.28
60    * @param[in] rhs A reference to the copied handle
61    */
62   RotationGesture(const RotationGesture& rhs);
63
64   /**
65    * @brief Move constructor.
66    * @SINCE_1_9.28
67    * @param[in] rhs A reference to the moved handle
68    */
69   RotationGesture(RotationGesture&& rhs) noexcept;
70
71   /**
72    * @brief Assignment operator.
73    * @SINCE_1_9.28
74    * @param[in] rhs A reference to the copied handle
75    * @return A reference to this
76    */
77   RotationGesture& operator=(const RotationGesture& rhs);
78
79   /**
80    * @brief Move assignment operator.
81    * @SINCE_1_9.28
82    * @param[in] rhs A reference to the moved handle
83    * @return A reference to this
84    */
85   RotationGesture& operator=(RotationGesture&& rhs) noexcept;
86
87   /**
88    * @brief Non virtual destructor.
89    * @SINCE_1_9.28
90    */
91   ~RotationGesture();
92
93   /**
94    * @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
95    * @SINCE_1_9.28
96    * @return The rotation from the start of the rotation gesture till the latest rotation gesture.
97    */
98   const Radian& GetRotation() const;
99
100   /**
101    * @brief The center point of the two points that caused the rotation gesture in screen coordinates.
102    * @SINCE_1_9.28
103    * @return The center point in screen coordinates
104    */
105   const Vector2& GetScreenCenterPoint() const;
106
107   /**
108    * @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
109    * @SINCE_1_9.28
110    * @return The center point in local actor coordinates
111    */
112   const Vector2& GetLocalCenterPoint() const;
113
114 public: // Not intended for application developers
115   /// @cond internal
116   /**
117    * @brief This constructor is used internally to Create an initialized RotationGesture handle.
118    *
119    * @param[in] rotationGesture A pointer to a newly allocated Dali resource
120    * @SINCE_1_9.28
121    */
122   explicit DALI_INTERNAL RotationGesture(Internal::RotationGesture* rotationGesture);
123   /// @endcond
124 };
125
126 } // namespace Dali
127
128 #endif // DALI_ROTATION_GESTURE_H