1 #ifndef __DALI_PINCH_GESTURE_DETECTOR_H__
2 #define __DALI_PINCH_GESTURE_DETECTOR_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
21 * @addtogroup CAPI_DALI_FRAMEWORK
26 #include <dali/public-api/events/gesture-detector.h>
27 #include <dali/public-api/signals/dali-signal-v2.h>
29 namespace Dali DALI_IMPORT_API
32 namespace Internal DALI_INTERNAL
34 class PinchGestureDetector;
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.
43 * The application programmer can use this gesture detector as follows:
45 * PinchGestureDetector detector = PinchGestureDetector::New();
46 * detector.Attach(myActor);
47 * detector.SignalDetected().Connect(this, &MyApplication::OnPinch);
52 class PinchGestureDetector : public GestureDetector
56 typedef SignalV2< void (Actor, PinchGesture) > DetectedSignalV2;
59 static const char* const SIGNAL_PINCH_DETECTED;
61 public: // Creation & Destruction
64 * Create an uninitialized PinchGestureDetector; this can be initialized with PinchGestureDetector::New()
65 * Calling member functions with an uninitialized Dali::Object is not allowed.
67 PinchGestureDetector();
70 * Create an initialized PinchGestureDetector.
71 * @return A handle to a newly allocated Dali resource.
73 static PinchGestureDetector New();
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
81 static PinchGestureDetector DownCast( BaseHandle handle );
85 * Dali::Object derived classes typically do not contain member data.
87 virtual ~PinchGestureDetector();
90 * @copydoc Dali::BaseHandle::operator=
92 using BaseHandle::operator=;
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:
100 * void YourCallbackName(Actor actor, PinchGesture gesture);
102 * @pre The gesture detector has been initialized.
103 * @return The signal to connect to.
105 DetectedSignalV2& DetectedSignal();
107 public: // Not intended for Application developers
110 * This constructor is used by Dali New() methods.
111 * @param [in] internal A pointer to a newly allocated Dali resource.
113 explicit DALI_INTERNAL PinchGestureDetector(Internal::PinchGestureDetector* internal);
122 #endif // __DALI_PINCH_GESTURE_DETECTOR_H__