1 #ifndef __DALI_INTERNAL_EVENT_HANDLER_H__
2 #define __DALI_INTERNAL_EVENT_HANDLER_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/integration-api/events/touch-event-combiner.h>
23 #include <style-monitor.h>
26 #include <damage-observer.h>
27 #include <drag-and-drop-detector-impl.h>
28 #include <accessibility-manager-impl.h>
29 #include <clipboard-event-notifier-impl.h>
30 #include <imf-manager-impl.h>
31 #include <rotation-observer.h>
44 class CoreEventInterface;
49 * The Event Handler class is responsible for setting up receiving of Ecore events and then converts them
50 * to TouchEvents when it does receive them.
52 * These TouchEvents are then passed on to Core.
60 * @param[in] surface The surface where events will be sent to.
61 * @param[in] coreEventInterface Used to send events to Core.
62 * @param[in] gestureManager The Gesture Manager.
63 * @param[in] damageObserver The damage observer (to pass damage events to).
64 * @param[in] dndDetector The Drag & Drop listener (to pass DnD events to).
66 EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
74 * Feed (Send) touch event to core and gesture manager
75 * @param[in] touchEvent The touch event holding the touch point information.
77 void FeedTouchPoint( TouchPoint& point, int timeStamp );
80 * Feed (Send) mouse wheel event to core and gesture manager
81 * @param[in] wheelEvent The mouse wheel event
83 void FeedWheelEvent( MouseWheelEvent& wheelEvent );
86 * Feed (Send) key event to core
87 * @param[in] keyEvent The key event holding the key information.
89 void FeedKeyEvent( KeyEvent& keyEvent );
92 * Feed (Send) an event to core
93 * @param[in] event The event information.
95 void FeedEvent( Integration::Event& event );
98 * Resets the event handler.
103 * Sets the Drag & Drop detector.
104 * @param[in] detector An intrusive pointer to the Drag & Drop listener to set. To unset pass in NULL.
106 void SetDragAndDropDetector( DragAndDropDetectorPtr detector );
109 * Set the rotation observer (note, some adaptors may not have a rotation observer)
110 * @param[in] observer The rotation observer
112 void SetRotationObserver( RotationObserver* observer );
117 * Send touch event to core.
118 * @param[in] point The touch point information.
119 * @param[in] timeStamp The time the touch occurred.
121 void SendEvent(TouchPoint& point, unsigned long timeStamp);
124 * Send key event to core.
125 * @param[in] keyEvent The KeyEvent to send.
127 void SendEvent(KeyEvent& keyEvent);
130 * Send mouse wheel event to core.
131 * @param[in] wheelEvent The mouse wheel event
133 void SendMouseWheelEvent( MouseWheelEvent& wheelEvent );
136 * Send a style change event to the style monitor.
137 * @param[in] styleChange The style that has changed.
139 void SendEvent( StyleChange::Type styleChange );
142 * Send a window damage event to the observer.
143 * @param[in] area Damaged area.
145 void SendEvent( const DamageArea& area );
148 * Inform rotation observer of rotation prepare event
149 * @param[in] rotation The rotation event
151 void SendRotationPrepareEvent( const RotationEvent& rotation );
154 * Inform rotation observer of rotation prepare event
156 void SendRotationRequestEvent( );
160 CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
161 Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
162 GestureManager& mGestureManager; ///< Reference to the GestureManager, set on construction, to send touch events to for analysis.
163 Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to.
164 DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to.
165 RotationObserver* mRotationObserver; ///< Pointer to rotation observer, if present.
167 DragAndDropDetectorPtr mDragAndDropDetector; ///< Pointer to the drag & drop detector, to send Drag & Drop events to.
168 Dali::AccessibilityManager mAccessibilityManager; ///< Pointer to the accessibility manager
169 Dali::ClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier
170 Dali::Clipboard mClipboard;///< Pointer to the clipboard
172 struct Impl; ///< Contains Ecore specific information
173 Impl* mImpl; ///< Created on construction and destroyed on destruction.
176 } // namespace Adaptor
178 } // namespace Internal
182 #endif // __DALI_INTERNAL_EVENT_HANDLER_H__