Emscripten workarounds and llvm syntax fixes
[platform/core/uifw/dali-core.git] / capi / 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) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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  * @addtogroup CAPI_DALI_FRAMEWORK
22  * @{
23  */
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/events/gesture-detector.h>
27 #include <dali/public-api/signals/dali-signal-v2.h>
28
29 namespace Dali DALI_IMPORT_API
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class PinchGestureDetector;
35 }
36
37 struct PinchGesture;
38
39 /**
40  * This class looks for pinching gestures involving two touches.  It tries to detect when the user moves two
41  * touch points towards or away from each other.  Please see PinchGesture for more information.
42  *
43  * The application programmer can use this gesture detector as follows:
44  * @code
45  * PinchGestureDetector detector = PinchGestureDetector::New();
46  * detector.Attach(myActor);
47  * detector.SignalDetected().Connect(this, &MyApplication::OnPinch);
48  * @endcode
49  *
50  * @see PinchGesture
51  */
52 class PinchGestureDetector : public GestureDetector
53 {
54 public: // Typedefs
55
56   typedef SignalV2< void (Actor, PinchGesture) > DetectedSignalV2;
57
58   //Signal Names
59   static const char* const SIGNAL_PINCH_DETECTED;
60
61 public: // Creation & Destruction
62
63   /**
64    * Create an uninitialized PinchGestureDetector; this can be initialized with PinchGestureDetector::New()
65    * Calling member functions with an uninitialized Dali::Object is not allowed.
66    */
67   PinchGestureDetector();
68
69   /*
70    * Create an initialized PinchGestureDetector.
71    * @return A handle to a newly allocated Dali resource.
72    */
73   static PinchGestureDetector New();
74
75   /**
76    * Downcast an Object handle to PinchGestureDetector handle. If handle points to a PinchGestureDetector object the
77    * downcast produces valid handle. If not the returned handle is left uninitialized.
78    * @param[in] handle to An object
79    * @return handle to a PinchGestureDetector object or an uninitialized handle
80    */
81   static PinchGestureDetector DownCast( BaseHandle handle );
82
83   /**
84    * Virtual destructor.
85    * Dali::Object derived classes typically do not contain member data.
86    */
87   virtual ~PinchGestureDetector();
88
89   /**
90    * @copydoc Dali::BaseHandle::operator=
91    */
92   using BaseHandle::operator=;
93
94 public: // Signals
95
96   /**
97    * This signal is emitted when the pinch gesture is detected on the attached actor.
98    * A callback of the following type may be connected:
99    * @code
100    *   void YourCallbackName(Actor actor, PinchGesture gesture);
101    * @endcode
102    * @pre The gesture detector has been initialized.
103    * @return The signal to connect to.
104    */
105   DetectedSignalV2& DetectedSignal();
106
107 public: // Not intended for Application developers
108
109   /**
110    * This constructor is used by Dali New() methods.
111    * @param [in]  internal  A pointer to a newly allocated Dali resource.
112    */
113   explicit DALI_INTERNAL PinchGestureDetector(Internal::PinchGestureDetector* internal);
114
115 };
116
117 } // namespace Dali
118
119 /**
120  * @}
121  */
122 #endif // __DALI_PINCH_GESTURE_DETECTOR_H__