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 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 #include <dali/public-api/render-tasks/render-task.h>
22 #include <dali/internal/event/common/proxy-object.h>
43 * <h3>Multi-Touch Event Processing:</h3>
45 * The TouchEventProcessor processes touch events and emits the Touched signal on the hit actor (and
48 * - Hit Testing & Touch Event Delivery are described in Dali::Actor.
50 class TouchEventProcessor
55 * Create an event processor.
56 * @param[in] stage The stage.
58 TouchEventProcessor( Stage& stage );
61 * Non-virtual destructor; TouchEventProcessor is not a base class
63 ~TouchEventProcessor();
66 * This function is called by the event processor whenever a touch event occurs.
67 * @param[in] event The touch event that has occurred.
69 void ProcessTouchEvent( const Integration::TouchEvent& event );
74 TouchEventProcessor(const TouchEventProcessor&);
77 TouchEventProcessor& operator=(const TouchEventProcessor& rhs);
82 * Stores an actor pointer and connects/disconnects to any required signals appropriately when set/unset.
84 struct ActorObserver : public ProxyObject::Observer
88 // Construction & Destruction
96 * Non virtual destructor
103 * Return the stored Actor pointer.
104 * @return The Actor pointer.
109 * Assignment operator.
110 * This disconnects the required signals from the currently set actor and connects to the required
111 * signals for the the actor specified (if set).
113 void SetActor( Actor* actor );
118 ActorObserver( const ActorObserver& );
119 ActorObserver& operator=( const ActorObserver& );
124 * This will never get called as we do not observe objects that have not been added to the scene.
125 * @param[in] proxy The proxy object.
126 * @see ProxyObject::Observer::SceneObjectAdded()
128 virtual void SceneObjectAdded(ProxyObject& proxy) { }
131 * This will be called when the actor is removed from the stage, we should clear and stop
133 * @param[in] proxy The proxy object.
134 * @see ProxyObject::Observer::SceneObjectRemoved()
136 virtual void SceneObjectRemoved(ProxyObject& proxy);
139 * This will be called when the actor is destroyed. We should clear the actor.
140 * No need to stop observing as the object is being destroyed anyway.
141 * @see ProxyObject::Observer::ProxyDestroyed()
143 virtual void ProxyDestroyed(ProxyObject& proxy);
146 Actor* mActor; ///< Raw pointer to an Actor.
149 Stage& mStage; ///< Used to deliver touch events
150 ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
151 ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
152 Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
155 } // namespace Internal
159 #endif // __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__