d28989eaa17f431474272b502eb1d21bd922446e
[platform/core/uifw/dali-core.git] / dali / internal / event / events / hover-event-processor.h
1 #ifndef __DALI_INTERNAL_HOVER_EVENT_PROCESSOR_H__
2 #define __DALI_INTERNAL_HOVER_EVENT_PROCESSOR_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
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 // INTERNAL INCLUDES
22 #include <dali/public-api/render-tasks/render-task.h>
23 #include <dali/internal/event/events/actor-observer.h>
24
25 namespace Dali
26 {
27
28 class Actor;
29 struct Vector2;
30 struct Vector4;
31
32 namespace Integration
33 {
34 struct HoverEvent;
35 }
36
37 namespace Internal
38 {
39
40 struct ActorObserver;
41 class Stage;
42
43 /**
44  * <h3>Multi-Hover Event Processing:</h3>
45  *
46  * The HoverEventProcessor processes hover events and emits the Hovered signal on the hit actor (and
47  * its parents).
48  *
49  * - Hit Testing & Hover Event Delivery are described in Dali::Actor.
50  */
51 class HoverEventProcessor
52 {
53 public:
54
55   /**
56    * Create an event processor.
57    * @param[in] stage The stage.
58    */
59   HoverEventProcessor( Stage& stage );
60
61   /**
62    * Non-virtual destructor; HoverEventProcessor is not a base class
63    */
64   ~HoverEventProcessor();
65
66   /**
67    * This function is called by the event processor whenever a hover event occurs.
68    * @param[in] event The hover event that has occurred.
69    */
70   void ProcessHoverEvent( const Integration::HoverEvent& event );
71
72 private:
73
74   // Undefined
75   HoverEventProcessor(const HoverEventProcessor&);
76
77   // Undefined
78   HoverEventProcessor& operator=(const HoverEventProcessor& rhs);
79
80   Stage& mStage; ///< Used to deliver touch events
81   ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
82   ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
83   ActorObserver mHoverStartConsumedActor; ///< Stores the hover-start consumed actor
84   Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
85 };
86
87 } // namespace Internal
88
89 } // namespace Dali
90
91 #endif // __DALI_INTERNAL_HOVER_EVENT_PROCESSOR_H__