[3.0] Update doxygen comments
[platform/core/uifw/dali-core.git] / dali / public-api / events / pinch-gesture-detector.h
1 #ifndef __DALI_PINCH_GESTURE_DETECTOR_H__
2 #define __DALI_PINCH_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/events/gesture-detector.h>
23 #include <dali/public-api/signals/dali-signal.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_events
29  * @{
30  */
31
32 namespace Internal DALI_INTERNAL
33 {
34 class PinchGestureDetector;
35 }
36
37 struct PinchGesture;
38
39 /**
40  * @brief This class looks for pinching gestures involving two touches.
41  *
42  * It tries to detect when the user moves two touch points towards or
43  * away from each other.  Please see PinchGesture for more
44  * information.
45  *
46  * The application programmer can use this gesture detector as follows:
47  * @code
48  * PinchGestureDetector detector = PinchGestureDetector::New();
49  * detector.Attach(myActor);
50  * detector.DetectedSignal().Connect(this, &MyApplication::OnPinch);
51  * @endcode
52  *
53  * @SINCE_1_0.0
54  * @see PinchGesture
55  *
56  * Signals
57  * | %Signal Name   | Method                |
58  * |----------------|-----------------------|
59  * | pinchDetected  | @ref DetectedSignal() |
60  */
61 class DALI_IMPORT_API PinchGestureDetector : public GestureDetector
62 {
63 public: // Typedefs
64
65   /**
66    * @brief Signal type.
67    * @SINCE_1_0.0
68    */
69   typedef Signal< void ( Actor, const PinchGesture& ) > DetectedSignalType;
70
71 public: // Creation & Destruction
72
73   /**
74    * @brief Creates an uninitialized PinchGestureDetector; this can be initialized with PinchGestureDetector::New().
75    *
76    * Calling member functions with an uninitialized PinchGestureDetector handle is not allowed.
77    * @SINCE_1_0.0
78    */
79   PinchGestureDetector();
80
81   /**
82    * @brief Creates an initialized PinchGestureDetector.
83    *
84    * @SINCE_1_0.0
85    * @return A handle to a newly allocated Dali resource
86    */
87   static PinchGestureDetector New();
88
89   /**
90    * @brief Downcasts a handle to PinchGestureDetector handle.
91    *
92    * If handle points to a PinchGestureDetector object, the
93    * downcast produces valid handle. If not, the returned handle is left uninitialized.
94    * @SINCE_1_0.0
95    * @param[in] handle Handle to an object
96    * @return Handle to a PinchGestureDetector object or an uninitialized handle
97    */
98   static PinchGestureDetector DownCast( BaseHandle handle );
99
100   /**
101    * @brief Destructor.
102    *
103    * This is non-virtual since derived Handle types must not contain data or virtual methods.
104    * @SINCE_1_0.0
105    */
106   ~PinchGestureDetector();
107
108   /**
109    * @brief This copy constructor is required for (smart) pointer semantics.
110    *
111    * @SINCE_1_0.0
112    * @param[in] handle A reference to the copied handle
113    */
114   PinchGestureDetector(const PinchGestureDetector& handle);
115
116   /**
117    * @brief This assignment operator is required for (smart) pointer semantics.
118    *
119    * @SINCE_1_0.0
120    * @param[in] rhs A reference to the copied handle
121    * @return A reference to this
122    */
123   PinchGestureDetector& operator=(const PinchGestureDetector& rhs);
124
125 public: // Signals
126
127   /**
128    * @brief This signal is emitted when the pinch gesture is detected on the attached actor.
129    *
130    * A callback of the following type may be connected:
131    * @code
132    *   void YourCallbackName( Actor actor, const PinchGesture& gesture );
133    * @endcode
134    * @SINCE_1_0.0
135    * @return The signal to connect to
136    * @pre The gesture detector has been initialized.
137    */
138   DetectedSignalType& DetectedSignal();
139
140 public: // Not intended for Application developers
141
142   /**
143    * @internal
144    * @brief This constructor is used by PinchGestureDetector::New() methods.
145    *
146    * @SINCE_1_0.0
147    * @param[in] internal A pointer to a newly allocated Dali resource
148    */
149   explicit DALI_INTERNAL PinchGestureDetector(Internal::PinchGestureDetector* internal);
150
151 };
152
153 /**
154  * @}
155  */
156 } // namespace Dali
157
158 #endif // __DALI_PINCH_GESTURE_DETECTOR_H__