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/key-event-integ.h>
23 #include <dali/integration-api/events/point.h>
24 #include <dali/integration-api/events/touch-event-combiner.h>
25 #include <style-monitor.h>
28 #include <damage-observer.h>
29 #include <drag-and-drop-detector-impl.h>
30 #include <accessibility-adaptor-impl.h>
31 #include <clipboard-event-notifier-impl.h>
32 #include <imf-manager-impl.h>
33 #include <rotation-observer.h>
46 class CoreEventInterface;
51 * The Event Handler class is responsible for setting up receiving of Ecore events and then converts them
52 * to TouchEvents when it does receive them.
54 * These TouchEvents are then passed on to Core.
62 * @param[in] surface The surface where events will be sent to.
63 * @param[in] coreEventInterface Used to send events to Core.
64 * @param[in] gestureManager The Gesture Manager.
65 * @param[in] damageObserver The damage observer (to pass damage events to).
66 * @param[in] dndDetector The Drag & Drop listener (to pass DnD events to).
68 EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
76 * Feed (Send) touch event to core and gesture manager
77 * @param[in] touchEvent The touch event holding the touch point information.
79 void FeedTouchPoint( TouchPoint& point, int timeStamp );
82 * Feed (Send) wheel event to core and gesture manager
83 * @param[in] wheelEvent The wheel event
85 void FeedWheelEvent( WheelEvent& wheelEvent );
88 * Feed (Send) key event to core
89 * @param[in] keyEvent The key event holding the key information.
91 void FeedKeyEvent( KeyEvent& keyEvent );
94 * Feed (Send) an event to core
95 * @param[in] event The event information.
97 void FeedEvent( Integration::Event& event );
100 * Called when the adaptor is paused.
105 * Called when the adaptor is resumed (from pause).
110 * Sets the Drag & Drop detector.
111 * @param[in] detector An intrusive pointer to the Drag & Drop listener to set. To unset pass in NULL.
113 void SetDragAndDropDetector( DragAndDropDetectorPtr detector );
116 * Set the rotation observer (note, some adaptors may not have a rotation observer)
117 * @param[in] observer The rotation observer
119 void SetRotationObserver( RotationObserver* observer );
124 * Send touch event to core.
125 * @param[in] point The touch point information.
126 * @param[in] timeStamp The time the touch occurred.
128 void SendEvent(Integration::Point& point, unsigned long timeStamp);
131 * Send key event to core.
132 * @param[in] keyEvent The KeyEvent to send.
134 void SendEvent(Integration::KeyEvent& keyEvent);
137 * Send wheel event to core.
138 * @param[in] wheelEvent The wheel event
140 void SendWheelEvent( WheelEvent& wheelEvent );
143 * Send a style change event to the style monitor.
144 * @param[in] styleChange The style that has changed.
146 void SendEvent( StyleChange::Type styleChange );
149 * Send a window damage event to the observer.
150 * @param[in] area Damaged area.
152 void SendEvent( const DamageArea& area );
155 * Inform rotation observer of rotation prepare event
156 * @param[in] rotation The rotation event
158 void SendRotationPrepareEvent( const RotationEvent& rotation );
161 * Inform rotation observer of rotation prepare event
163 void SendRotationRequestEvent();
166 * Resets the event handler.
167 * Called when the adaptor is paused or resumed.
174 EventHandler( const EventHandler& eventHandler );
177 EventHandler& operator=( const EventHandler& eventHandler );
181 CoreEventInterface& mCoreEventInterface; ///< Used to send events to Core.
182 Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
183 GestureManager& mGestureManager; ///< Reference to the GestureManager, set on construction, to send touch events to for analysis.
184 Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to.
185 DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to.
186 RotationObserver* mRotationObserver; ///< Pointer to rotation observer, if present.
188 DragAndDropDetectorPtr mDragAndDropDetector; ///< Pointer to the drag & drop detector, to send Drag & Drop events to.
189 Dali::AccessibilityAdaptor mAccessibilityAdaptor; ///< Pointer to the accessibility adaptor
190 Dali::ClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier
191 Dali::Clipboard mClipboard;///< Pointer to the clipboard
193 struct Impl; ///< Implementation
194 Impl* mImpl; ///< Created on construction and destroyed on destruction.
196 bool mPaused; ///< The paused state of the adaptor.
199 } // namespace Adaptor
201 } // namespace Internal
205 #endif // __DALI_INTERNAL_EVENT_HANDLER_H__