1 #ifndef __DALI_INTERNAL_GESTURE_MANAGER_H__
2 #define __DALI_INTERNAL_GESTURE_MANAGER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/math/vector2.h>
24 #include <dali/integration-api/gesture-manager.h>
27 #include <events/gesture-detector.h>
43 class CallbackManager;
44 class CoreEventInterface;
45 class EnvironmentOptions;
48 * Implementation of the Integration::GestureManager.
50 * Contains a list of adaptor gesture detectors. It passes touch events to each required detector which
51 * in turn process them to determine if their corresponding gesture has occurred.
53 class GestureManager : public Integration::GestureManager
59 * @param[in] coreEventInterface Used to send events to Core.
60 * @param[in] screenSize The size of the screen.
61 * @param[in] callbackManager used to install callbacks
62 * @param[in] environmentOptions Environment Options
64 GestureManager(CoreEventInterface& coreEventInterface, Vector2 screenSize, CallbackManager* callbackManager, EnvironmentOptions& environmentOptions);
69 virtual ~GestureManager();
74 * Used by the event handler to send touch events to the Gesture Manager.
75 * @param[in] event The latest touch event.
77 void SendEvent(const Integration::TouchEvent& event);
80 * Used by the event handler to stop the GestureManager detection.
85 * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to
86 * trigger a pinch gesture
88 * @param[in] distance The minimum pinch distance in pixels
90 void SetMinimumPinchDistance(float distance);
92 public: // GestureManager overrides
95 * copydoc Dali::Integration::GestureManager::Register(const Integration::GestureRequest&)
97 virtual void Register(const Integration::GestureRequest& request);
100 * copydoc Dali::Integration::GestureManager::Unregister(const Integration::GestureRequest&)
102 virtual void Unregister(const Integration::GestureRequest& request);
105 * copydoc Dali::Integration::GestureManager::Unregister(const Integration::GestureRequest&)
107 virtual void Update(const Integration::GestureRequest& request);
112 * Used to delete the gesture detector of the given type.
114 void DeleteGestureDetector( Gesture::Type type );
118 typedef std::vector<GestureDetectorPtr> GestureDetectorContainer;
120 CoreEventInterface& mCoreEventInterface;
121 GestureDetectorContainer mGestureDetectors;
123 CallbackManager* mCallbackManager;
124 EnvironmentOptions& mEnvironmentOptions;
125 float mMinimumDistanceDelta; ///< The minimum distance before a pinch is applicable. (-1.0f means pinch detector uses default value)
126 bool mRunning; ///< States whether the GestureManager is running or not.
129 } // namespace Adaptor
131 } // namespace Internal
135 #endif // __DALI_INTERNAL_GESTURE_MANAGER_H__