Revert "[3.0] Exclude internal tag module in Public API reference"
[platform/core/uifw/dali-core.git] / dali / public-api / events / gesture-detector.h
1 #ifndef __DALI_GESTURE_DETECTOR_H__
2 #define __DALI_GESTURE_DETECTOR_H__
3
4 /*
5  * Copyright (c) 2015 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/vector-wrapper.h>
23 #include <dali/public-api/object/handle.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_events
29  * @{
30  */
31
32 namespace Internal DALI_INTERNAL
33 {
34 class GestureDetector;
35 }
36
37 class Actor;
38
39 /**
40  * @brief GestureDetectors analyse a stream of touch events and attempt to determine the intention of the user.
41  *
42  * An actor is attached to a gesture detector and if the detector recognises a pattern in its analysis, it will
43  * emit a detected signal to the application.
44  *
45  * This is the base class for different gesture detectors available and provides functionality that is common
46  * to all the gesture detectors.
47  *
48  * @SINCE_1_0.0
49  * @see Gesture
50  */
51 class DALI_IMPORT_API GestureDetector : public Handle
52 {
53 public: // Creation & Destruction
54
55   /**
56    * @brief Create an uninitialized GestureDetector.
57    *
58    * This can be initialized with one of the derived gesture detectors' New() methods. For example, PanGestureDetector::New().
59    *
60    * Calling member functions with an uninitialized Dali::GestureDetector handle is not allowed.
61    * @SINCE_1_0.0
62    */
63   GestureDetector();
64
65   /**
66    * @brief Downcast a handle to GestureDetector handle.
67    *
68    * If handle points to a GestureDetector object the
69    * downcast produces valid handle. If not the returned handle is left uninitialized.
70    * @SINCE_1_0.0
71    * @param[in] handle Handle to an object
72    * @return Handle to a GestureDetector object or an uninitialized handle
73    */
74   static GestureDetector DownCast( BaseHandle handle );
75
76   /**
77    * @brief Dali::GestureDetector is intended as a base class
78    *
79    * This is non-virtual since derived Handle types must not contain data or virtual methods.
80    * @SINCE_1_0.0
81    */
82   ~GestureDetector();
83
84   /**
85    * @brief This copy constructor is required for (smart) pointer semantics.
86    *
87    * @SINCE_1_0.0
88    * @param [in] handle A reference to the copied handle
89    */
90   GestureDetector(const GestureDetector& handle);
91
92   /**
93    * @brief This assignment operator is required for (smart) pointer semantics.
94    *
95    * @SINCE_1_0.0
96    * @param [in] rhs  A reference to the copied handle
97    * @return A reference to this
98    */
99   GestureDetector& operator=(const GestureDetector& rhs);
100
101 public: // Actor related
102
103   /**
104    * @brief Attaches an actor to the gesture.
105    *
106    * The detected signal will be dispatched when the gesture occurs on
107    * the attached actor.
108    * @SINCE_1_0.0
109    * @param[in]  actor  The actor to attach to the gesture detector
110    * @pre The gesture detector has been initialized.
111    * @note You can attach several actors to a gesture detector.
112    */
113   void Attach(Actor actor);
114
115   /**
116    * @brief Detaches the attached actor from the gesture detector.
117    *
118    * @SINCE_1_0.0
119    * @param[in]  actor  The actor to detach from the gesture detector.
120    * @pre The gesture detector has been initialized.
121    * @pre The specified actor has been attached to the gesture detector.
122    */
123   void Detach(Actor actor);
124
125   /**
126    * @brief Detaches all the actors that have been attached to the gesture detector.
127    *
128    * @SINCE_1_0.0
129    * @pre The gesture detector has been initialized.
130    * @pre At least one actor has been attached to the gesture detector.
131    */
132   void DetachAll();
133
134   /**
135    * @brief Returns the number of actors attached to the gesture detector.
136    *
137    * @SINCE_1_0.0
138    * @return The count
139    * @pre The gesture detector has been initialized.
140    */
141   size_t GetAttachedActorCount() const;
142
143   /**
144    * @brief Returns an actor by index. An empty handle if the index is not valid.
145    *
146    * @SINCE_1_0.0
147    * @return The attached actor or an empty handle.
148    * @pre The gesture detector has been initialized.
149    */
150   Actor GetAttachedActor(size_t index) const;
151
152 protected:
153
154   /**
155    * @brief This constructor is used by New() methods of derived classes (For example, PanGestureDetector::New()).
156    *
157    * @SINCE_1_0.0
158    * @param [in]  internal  A pointer to a newly allocated Dali resource.
159    */
160   explicit DALI_INTERNAL GestureDetector(Internal::GestureDetector* internal);
161 };
162
163 /**
164  * @}
165  */
166 } // namespace Dali
167
168 #endif // __DALI_GESTURE_DETECTOR_H__