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