1 #ifndef __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__
2 #define __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_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/render-tasks/render-task.h>
23 #include <dali/internal/event/common/proxy-object.h>
44 * <h3>Multi-Touch Event Processing:</h3>
46 * The TouchEventProcessor processes touch events and emits the Touched signal on the hit actor (and
49 * - Hit Testing & Touch Event Delivery are described in Dali::Actor.
51 class TouchEventProcessor
56 * Create an event processor.
57 * @param[in] stage The stage.
59 TouchEventProcessor( Stage& stage );
62 * Non-virtual destructor; TouchEventProcessor is not a base class
64 ~TouchEventProcessor();
67 * This function is called by the event processor whenever a touch event occurs.
68 * @param[in] event The touch event that has occurred.
70 void ProcessTouchEvent( const Integration::TouchEvent& event );
75 TouchEventProcessor(const TouchEventProcessor&);
78 TouchEventProcessor& operator=(const TouchEventProcessor& rhs);
83 * Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset.
85 struct ActorObserver : public ProxyObject::Observer
89 // Construction & Destruction
97 * Non virtual destructor
104 * Return the stored Actor pointer.
105 * @return The Actor pointer.
110 * Assignment operator.
111 * This disconnects the required signals from the currently set actor and connects to the required
112 * signals for the the actor specified (if set).
114 void SetActor( Actor* actor );
117 * Resets the set actor and disconnects any connected signals.
124 ActorObserver( const ActorObserver& );
125 ActorObserver& operator=( const ActorObserver& );
130 * This will never get called as we do not observe objects that have not been added to the scene.
131 * @param[in] proxy The proxy object.
132 * @see ProxyObject::Observer::SceneObjectAdded()
134 virtual void SceneObjectAdded(ProxyObject& proxy) { }
137 * This will be called when the actor is removed from the stage, we should clear and stop
139 * @param[in] proxy The proxy object.
140 * @see ProxyObject::Observer::SceneObjectRemoved()
142 virtual void SceneObjectRemoved(ProxyObject& proxy);
145 * This will be called when the actor is destroyed. We should clear the actor.
146 * No need to stop observing as the object is being destroyed anyway.
147 * @see ProxyObject::Observer::ProxyDestroyed()
149 virtual void ProxyDestroyed(ProxyObject& proxy);
152 Actor* mActor; ///< Raw pointer to an Actor.
153 bool mActorDisconnected; ///< Indicates whether the actor has been disconnected from the scene
156 Stage& mStage; ///< Used to deliver touch events
157 ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
158 ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
159 Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
162 } // namespace Internal
166 #endif // __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__