Revert "[Tizen] Adding deviceClass to KeyEvent Integ"
[platform/core/uifw/dali-core.git] / dali / internal / event / events / event-processor.h
1 #ifndef __DALI_INTERNAL_EVENT_PROCESSOR_H__
2 #define __DALI_INTERNAL_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/internal/event/events/touch-event-processor.h>
23 #include <dali/internal/event/events/hover-event-processor.h>
24 #include <dali/internal/event/events/key-event-processor.h>
25 #include <dali/internal/event/events/wheel-event-processor.h>
26 #include <dali/internal/common/message-buffer.h>
27
28 namespace Dali
29 {
30
31 namespace Integration
32 {
33 struct Event;
34 struct GestureEvent;
35 }
36
37 namespace Internal
38 {
39
40 class Stage;
41 class GestureEventProcessor;
42 class NotificationManager;
43
44 /**
45  * The EventProcessor processes any events that are received by Dali.  Such events include
46  * touch events, key events, wheel events, and notification events.
47  *
48  * When the EventProcessor receives an event, it determines its type and passes it on to the
49  * appropriate processor.
50  */
51 class EventProcessor
52 {
53 public:
54
55   /**
56    * Constructor
57    * @param[in] stage                  The stage.
58    * @param[in] notificationManager    The Notification Manager.
59    * @param[in] gestureEventProcessor  The gesture event processor.
60    */
61   EventProcessor(Stage& stage, NotificationManager& notificationManager, GestureEventProcessor& gestureEventProcessor);
62
63   /**
64    * Destructor
65    */
66   virtual ~EventProcessor();
67
68 public:
69
70   /**
71    * This function is called by Core when an event is queued.
72    * @param[in] event A event to queue.
73    */
74   void QueueEvent( const Integration::Event& event );
75
76   /**
77    * This function is called by Core when events are processed.
78    */
79   void ProcessEvents();
80
81 private:
82
83   /**
84    * Helper for QueueEvent()
85    */
86   void QueueGestureEvent(const Integration::GestureEvent& event);
87
88 private:
89
90   TouchEventProcessor      mTouchEventProcessor;        ///< Processes touch events.
91   HoverEventProcessor      mHoverEventProcessor;        ///< Processes hover events.
92   GestureEventProcessor&   mGestureEventProcessor;      ///< Processes gesture events.
93   KeyEventProcessor        mKeyEventProcessor;          ///< Processes key events.
94   WheelEventProcessor      mWheelEventProcessor;        ///< Processes wheel events.
95
96   // Allow messages to be added safely to one queue, while processing (iterating through) the second queue.
97   MessageBuffer mEventQueue0;        ///< An event queue.
98   MessageBuffer mEventQueue1;        ///< Another event queue.
99   MessageBuffer* mCurrentEventQueue; ///< QueueEvent() will queue here.
100 };
101
102 } // namespace Internal
103
104 } // namespace Dali
105
106 #endif // __DALI_INTERNAL_EVENT_PROCESSOR_H__
107